(1024 * 500)) { $errors["Local NS File"] = "Too big!"; } elseif ($_FILES['exp_nsfile']['name'] == "") { $errors["Local NS File"] = "Local filename does not appear to be valid"; } elseif ($_FILES['exp_nsfile']['tmp_name'] == "") { $errors["Local NS File"] = "Temp filename does not appear to be valid"; } elseif (!preg_match("/^([-\@\w\.\/]+)$/", $_FILES['exp_nsfile']['tmp_name'])) { $errors["Local NS File"] = "Temp path includes illegal characters"; } # # For the benefit of the form. Remember to pass back actual filename, not # the php temporary file name. Note that there appears to be some kind # of breakage, at least in opera; filename has no path. # $formfields['exp_nsfile'] = $_FILES['exp_nsfile']['name']; if (count($errors)) { SPITFORM($formfields, $errors); PAGEFOOTER(); exit(1); } # Read the entire file into a string. $file_contents = file_get_contents($_FILES['exp_nsfile']['tmp_name']); if (!$file_contents || $file_contents == "") { $errors["Local NS File"] = "Error reading file on server"; SPITFORM($formfields, $errors); PAGEFOOTER(); exit(1); } $formfields["exp_nsfile_contents"] = urlencode($file_contents); } $args = array(); $args[0] = $formfields; $xmlcode = xmlrpc_encode_request("dummy", $args); return $xmlcode; } # # Spit the form out using the array of data. # function SPITFORM($formfields, $errors) { global $TBDB_PIDLEN, $TBDB_GIDLEN, $TBDB_EIDLEN, $TBDOCBASE; global $view, $view_style, $projlist, $linktest_levels; global $EXPOSELINKTEST, $EXPOSEARCHIVE; global $EXPOSESTATESAVE; global $TBVALIDDIRS_HTML; PAGEHEADER("Begin a Testbed Experiment"); echo "\n"; if ($errors) { echo "
Oops, please fix the following errors! | |
---|---|
$name: | $message |
To finish creating your slice, edit the following information as needed, and click Submit. PlanetLab requires users to provide detail on what their slice will be doing via its description (i.e., what kind of network traffic it will be producing). Be sure to read over the PlanetLab AUP if you haven't already.
Your automatically generated NS file has been " . "uploaded. To finish creating your experiment, " . "please fill out the following information:
"; } } } } echo "