Пример #1
0
# Grab the unix GID for running scripts.
#
$unix_gid = $group->unix_gid();
$unix_pid = $project->unix_gid();
# Okay, we can spit back a header now that there is no worry of redirect.
PAGEHEADER("Create an Experiment Template");
echo "<script type='text/javascript' language='javascript' " . "        src='template_sup.js'>\n";
echo "</script>\n";
STARTBUSY("Starting template creation!");
# And run that script!
$retval = SUEXEC($uid, "{$unix_pid},{$unix_gid}", "webtemplate_create -E {$description} " . "-g {$gid} {$pid} {$tid} {$thensfile}", SUEXEC_ACTION_IGNORE);
if ($deletensfile) {
    unlink($thensfile);
}
/* Clear the various 'loading' indicators. */
HIDEBUSY();
if ($retval) {
    #
    # Fatal Error. Report to the user, even though there is not much he can
    # do with the error. Also reports to tbops.
    #
    if ($retval < 0) {
        SUEXECERROR(SUEXEC_ACTION_CONTINUE);
    }
    # User error. Tell user and exit.
    SUEXECERROR(SUEXEC_ACTION_USERERROR);
    return;
}
#
# Parse the last line of output. Ick.
#
Пример #2
0
function DOTIME($instance, $action)
{
    global $guid, $vers, $pid, $unix_pid, $unix_gid, $eid, $uid;
    $message = "";
    $template = $instance->GetTemplate();
    $experiment = $instance->GetExperiment();
    if ($action == "pause") {
        PAGEHEADER("Pause Experiment Time");
        $message = "Pausing experiment runtime";
    } else {
        PAGEHEADER("Continue Experiment Time");
        $message = "Continuing experiment runtime";
    }
    $command_options = "-e {$eid} -a {$action} ";
    #
    # Avoid SIGPROF in child.
    #
    set_time_limit(0);
    echo $instance->ExpPageHeader();
    echo "<br><br>\n";
    echo "<script type='text/javascript' language='javascript' " . "        src='template_sup.js'>\n";
    echo "</script>\n";
    STARTBUSY($message);
    #
    # Run the backend script.
    #
    $retval = SUEXEC($uid, "{$unix_pid},{$unix_gid}", "webtemplate_exprun {$command_options} {$guid}/{$vers}", SUEXEC_ACTION_IGNORE);
    HIDEBUSY();
    #
    # Fatal Error. Report to the user, even though there is not much he can
    # do with the error. Also reports to tbops.
    #
    if ($retval < 0) {
        SUEXECERROR(SUEXEC_ACTION_CONTINUE);
    }
    # User error. Tell user and exit.
    if ($retval) {
        SUEXECERROR(SUEXEC_ACTION_USERERROR);
        return;
    }
    PAGEREPLACE(CreateURL("showexp", $experiment));
}