Commit da4a4125 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Minor changes and cleanup. Also fix up the problem with duplicate

addslashes getting called, once in the web interface and again in the
perl backend.
parent 710ddd95
......@@ -60,6 +60,8 @@ function INITFORM($formfields, $projlist)
$defaults[exp_autoswap_timeout] = "10";
$defaults[exp_localnsfile] = "";
$defaults[exp_nsfile] = ""; # Multipart data.
$defaults[exp_preload] = "no";
$defaults[exp_batched] = "no";
#
# Allow formfields that are already set to override defaults
......@@ -472,7 +474,7 @@ function SPITFORM($formfields, $errors)
if (isset($view['hide_batch'])) {
if ($formfields['exp_batched']) {
echo "<input type='hidden' name='formfields[exp_batched]'
value='Yep'\n";
value='$formfields[$value]'\n";
}
} else {
echo "<tr>
......@@ -500,7 +502,7 @@ function SPITFORM($formfields, $errors)
if (isset($view['hide_preload'])) {
if ($formfields['exp_preload']) {
echo "<input type='hidden' name='formfields[exp_preload]'
value='Yep'>\n";
value='$formfields[$value]'>\n";
}
} else {
echo "<tr>
......
......@@ -36,11 +36,8 @@ if (isset($view_style) && $view_style == "plab") {
$view['hide_proj'] = $view['hide_group'] = $view['hide_swap'] =
$view['hide_preload'] = $view['hide_batch'] = $view['quiet'] =
$view['plab_ns_message'] = 1;
include("plabexp_form.php3");
}
else {
include("beginexp_form.php3");
}
include("beginexp_form.php3");
# Need this below;
$idleswaptimeout = TBGetSiteVar("idle/threshold");
......@@ -91,6 +88,8 @@ $url = "$TBBASE/beginexp_xml.php3?".
"&xmlcode=" . urlencode($xmlcode);
$reply = "";
# TBERROR(urldecode($url), 0);
$fp = @fopen($url, "r");
if ($fp == FALSE) {
TBERROR("Could not invoke XML backend script. URL was:<br><br>\n".
......
......@@ -74,6 +74,10 @@ if (!isset($xmlcode)) {
# Convert the xml into PHP datatypes; an array of arguments. We ignore the
# the method for now.
$foo = xmlrpc_decode_request($xmlcode, $meth);
if (!isset($foo)) {
TBERROR("Could not decode XML request!\n\n" .
urldecode($xmlcode) . "\n", 1);
}
# First argument is the formfields array.
$formfields = $foo[0];
......@@ -266,7 +270,7 @@ if (count($errors)) {
XMLERROR();
}
$exp_desc = addslashes($formfields[exp_description]);
$exp_desc = escapeshellarg($formfields[exp_description]);
$exp_pid = $formfields[exp_pid];
$exp_gid = ((isset($formfields[exp_gid]) && $formfields[exp_gid] != "") ?
$formfields[exp_gid] : $exp_pid);
......@@ -387,7 +391,7 @@ TBGroupUnixInfo($exp_pid, $exp_gid, $unix_gid, $unix_name);
set_time_limit(0);
$retval = SUEXEC($uid, $unix_gid,
"webbatchexp $batcharg -x \"$exp_expires\" -E \"$exp_desc\" ".
"webbatchexp $batcharg -x \"$exp_expires\" -E $exp_desc ".
"$exp_priority $exp_swappable ".
"-p $exp_pid -g $exp_gid -e $exp_id ".
($nonsfile ? "" : "$thensfile"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment