{$_REQUEST['command']},"; foreach ($_COOKIE['history'] as $h) { echo "$h,"; }; echo "
\n"; //echo "" . isset($_COOKIE['history']) . ',' . array_search($_REQUEST['command'], $_COOKIE['history']) . "
\n"; if (isset($_COOKIE['history']) && array_search($_REQUEST['command'], $_COOKIE['history'])!==FALSE) { // this command is already in the history, so do not need to add it } else { $i = isset($_COOKIE['history']) ? count($_COOKIE['history']) : 0; setcookie("history[$i]", $_REQUEST['command'], $expire_time); } //print_r($_COOKIE); //get the command and the options $cmd = @$_REQUEST["command"]; $noderange = @$_REQUEST["noderange"]; //$group = @$_REQUEST["nodegrps"]; $copy = @$_REQUEST["copy_script"]; $psh = @$_REQUEST["run_psh"]; $serial = @$_REQUEST["serial"]; $monitor = @$_REQUEST["monitor"]; $verify = @$_REQUEST["verify"]; $collapse = @$_REQUEST["collapse"]; $fanout = @$_REQUEST["fanout"]; $userID = @$_REQUEST["userID"]; $rshell = @$_REQUEST["rshell"]; $shell_opt = @$_REQUEST["shell_opt"]; $ret_code = @$_REQUEST["ret_code"]; // Set the cmd arguments //if (!empty($group)) $noderange = $group; //else $noderange = $node; if ($copy) $args[] = "-e"; if ($serial) $args[] = "-s"; //streaming mode if ($monitor) $args[] = "-m"; if ($verify) $args[] = "-v"; if (!empty($fanout)) { $args[] = "-f"; $args[] = $fanout; } if (!empty($userID)) { $args[] = "-l"; $args[] = $userID; } if (!empty($rshell)) { $args[] = "-r"; $args[] = $rshell; } if (!empty($shell_opt)) { $args[] = "-o"; $args[] = $shell_opt; } if ($ret_code) $args[] = "-z"; if (!$psh) $command = "xdsh"; else $command = "psh"; //todo: if ($collapse == "on") $command_string .= " | dshbak -c"; // Run the script $args[] = $cmd; echo "Command: $command $noderange " . implode(' ',$args) . "
";
$xml = docmd($command, $noderange, $args); //todo: do streaming output
foreach ($xml->children() as $response) foreach ($response->children() as $line) { echo "$line
"; }
echo "