$$.
#
$exp_eid = strstr($exp_pideid, "\$\$");
$exp_eid = substr($exp_eid, 2);
$exp_pid = substr($exp_pideid, 0, strpos($exp_pideid, "\$\$", 0));
#
# Stop now if the Confirm box was not Depressed
#
if (!isset($confirm) ||
strcmp($confirm, "yes")) {
USERERROR("The \"Confirm\" button was not depressed! If you really ".
"want to end experiment '$exp_eid' in project '$exp_pid', ".
"please go back and try again.", 1);
}
#
# Check to make sure thats this is a valid PID/EID tuple.
#
$query_result = mysql_db_query($TBDBNAME,
"SELECT * FROM experiments WHERE ".
"eid=\"$exp_eid\" and pid=\"$exp_pid\"");
if (mysql_num_rows($query_result) == 0) {
USERERROR("The experiment $exp_eid is not a valid experiment ".
"in project $exp_pid.", 1);
}
#
# Verify that this uid is a member of the project for the experiment
# being displayed.
#
$query_result = mysql_db_query($TBDBNAME,
"SELECT pid FROM proj_memb WHERE uid=\"$uid\" and pid=\"$exp_pid\"");
if (mysql_num_rows($query_result) == 0) {
USERERROR("You are not a member of Project $exp_pid for ".
"Experiment: $exp_eid.", 1);
}
#
# As per what happened when the experiment was created, we need to
# go back to that directory and use the .ir file to terminate the
# experiment, and then delete the files and the directory.
#
# XXX These paths/filenames are setup in beginexp_process.php3.
#
# No need to tell me how bogus this is.
#
$dirname = "$TBWWW_DIR"."$TBNSSUBDIR" . "/" . "$exp_pid" . "-" . "$exp_eid";
$nsname = "$dirname" . "/" . "$exp_eid" . ".ns";
$irname = "$dirname" . "/" . "$exp_eid" . ".ir";
$repname = "$dirname" . "/" . "$exp_eid" . ".report";
$logname = "$dirname" . "/" . "$exp_eid" . ".log";
$assname = "$dirname" . "/" . "assign" . ".log";
#
# Check to see if the experiment directory exists before continuing.
# We will allow experiments to be deleted even without the files
# describing it, since in some cases the user is handling that part on
# his/her own.
#
if (! file_exists($dirname)) {
$query_result = mysql_db_query($TBDBNAME,
"DELETE FROM experiments WHERE eid='$exp_eid' and pid=\"$exp_pid\"");
if (! $query_result) {
$err = mysql_error();
TBERROR("Database Error deleting experiment $exp_eid ".
"in project $exp_pid: $err\n", 1);
}
echo "
Experiment $exp_pid Terminated!
Since there was no IR file to work from, the EID has been removed,
but you will need to make sure the nodes are released yourself.
";
echo "