Commit 990609e1 authored by Leigh B. Stoller's avatar Leigh B. Stoller

As per Jay's request, convert #RON and #PLAB into booleans instead of

actual counts.
parent 0f49a3cb
......@@ -223,6 +223,19 @@ elseif (strcmp($approval, "approve") == 0) {
"WHERE pid='$pid'");
}
#
# Invoke the script. This does it all. If it fails, we will find out
# about it.
#
echo "<br>
Project '$pid' is being created!<br><br>
This will take a minute or two. <b>Please</b> do not click the Stop
button during this time. If you do not receive notification within
a reasonable amount of time, please contact $TBMAILADDR.\n";
flush();
SUEXEC($uid, $TBADMINGROUP, "webmkproj $pid", SUEXEC_ACTION_DIE);
TBMAIL("$headname '$headuid' <$headuid_email>",
"Project '$pid' Approval",
"\n".
......@@ -241,19 +254,6 @@ elseif (strcmp($approval, "approve") == 0) {
"Bcc: $TBMAIL_APPROVAL\n".
"Errors-To: $TBMAIL_WWW");
#
# Invoke the script. This does it all. If it fails, we will find out
# about it.
#
echo "<br>
Project '$pid' is being created!<br><br>
This will take a minute or two. <b>Please</b> do not click the Stop
button during this time. If you do not receive notification within
a reasonable amount of time, please contact $TBMAILADDR.\n";
flush();
SUEXEC($uid, $TBADMINGROUP, "webmkproj $pid", SUEXEC_ACTION_DIE);
if (!$FirstInitState) {
echo "<p><b>
Project $pid (User: $headuid) has been approved.
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# Copyright (c) 2000-2003, 2005 University of Utah and the Flux Group.
# All rights reserved.
#
include("defs.php3");
......@@ -180,6 +180,7 @@ $query_result =
DBQueryFatal("select num_pcplab,num_ron from projects where pid='$pid'");
$row = mysql_fetch_array($query_result);
# These are now booleans, not actual counts.
$num_pcplab = $row[num_pcplab];
$num_ron = $row[num_ron];
......
......@@ -488,26 +488,26 @@ function SPITFORM($formfields, $returning, $errors)
</tr>\n";
echo "<tr>
<td colspan=2>*Estimated #of
<td colspan=2>Request Access to
<a href=\"$TBDOCBASE/docwrapper.php3?docname=widearea.html\" target='_blank'>
Planetlab PCs</a>:</td>
<td class=left>
<input type=text
<input type=checkbox value=checked
name=\"formfields[proj_plabpcs]\"
value=\"" . $formfields[proj_plabpcs] . "\"
size=4>
" . $formfields[proj_plabpcs] . ">
Yes &nbsp
</td>
</tr>\n";
echo "<tr>
<td colspan=2>*Estimated #of
<td colspan=2>Request Access to
<a href=\"$TBDOCBASE/docwrapper.php3?docname=widearea.html\" target='_blank'>
wide-area PCs</a>:</td>
<td class=left>
<input type=text
<input type=checkbox value=checked
name=\"formfields[proj_ronpcs]\"
value=\"" . $formfields[proj_ronpcs] . "\"
size=4>
" . $formfields[proj_ronpcs] . ">
Yes &nbsp
</td>
</tr>\n";
......@@ -600,8 +600,8 @@ if (! isset($_POST['submit'])) {
$defaults[proj_URL] = "$HTTPTAG";
$defaults[usr_URL] = "$HTTPTAG";
$defaults[usr_country] = "USA";
$defaults[proj_ronpcs] = "0";
$defaults[proj_plabpcs] = "0";
$defaults[proj_ronpcs] = "";
$defaults[proj_plabpcs] = "";
$defaults[proj_public] = "checked";
$defaults[proj_linked] = "checked";
......@@ -826,19 +826,16 @@ if (!isset($formfields[proj_pcs]) ||
elseif (! TBvalid_num_pcs($formfields[proj_pcs])) {
$errors["#of PCs"] = TBFieldErrorString();
}
if (!isset($formfields[proj_plabpcs]) ||
strcmp($formfields[proj_plabpcs], "") == 0) {
$errors["#of Planetlab PCs"] = "Missing Field";
}
elseif (! TBvalid_num_pcplab($formfields[proj_plabpcs])) {
$errors["#of Planetlab PCs"] = TBFieldErrorString();
}
if (!isset($formfields[proj_ronpcs]) ||
strcmp($formfields[proj_ronpcs], "") == 0) {
$errors["#of RON PCs"] = "Missing Field";
if (isset($formfields[proj_plabpcs]) &&
strcmp($formfields[proj_plabpcs], "") &&
strcmp($formfields[proj_plabpcs], "checked")) {
$errors["Planetlab Access"] = "Bad Value";
}
elseif (! TBvalid_num_ron($formfields[proj_ronpcs])) {
$errors["#of RON PCs"] = TBFieldErrorString();
if (isset($formfields[proj_ronpcs]) &&
strcmp($formfields[proj_ronpcs], "") &&
strcmp($formfields[proj_ronpcs], "checked")) {
$errors["Ron Access"] = "Bad Value";
}
if (!isset($formfields[proj_why]) ||
strcmp($formfields[proj_why], "") == 0) {
......@@ -989,8 +986,6 @@ $proj_funders = addslashes($formfields[proj_funders]);
$proj_whynotpublic = addslashes($formfields[proj_whynotpublic]);
$proj_members = $formfields[proj_members];
$proj_pcs = $formfields[proj_pcs];
$proj_plabpcs = $formfields[proj_plabpcs];
$proj_ronpcs = $formfields[proj_ronpcs];
$proj_why = addslashes($formfields[proj_why]);
$proj_expires = date("Y:m:d", time() + (86400 * 120));
......@@ -1012,6 +1007,24 @@ else {
$proj_linked = "Yes";
$linked = 1;
}
if (isset($formfields[proj_plabpcs]) &&
$formfields[proj_plabpcs] == "checked") {
$proj_plabpcs = "Yes";
$plabpcs = 1;
}
else {
$proj_plabpcs = "No";
$plabpcs = 0;
}
if (isset($formfields[proj_ronpcs]) &&
$formfields[proj_ronpcs] == "checked") {
$proj_ronpcs = "Yes";
$ronpcs = 1;
}
else {
$proj_ronpcs = "No";
$ronpcs = 0;
}
#
# Check that we can guarantee uniqueness of the unix group name.
......@@ -1099,7 +1112,7 @@ DBQueryFatal("INSERT INTO projects ".
"VALUES ('$pid', now(), '$proj_expires','$proj_name', ".
" '$proj_URL', '$proj_head_uid', '$proj_members', ".
" '$proj_pcs', '$proj_why', ".
" '$proj_funders', NULL, $proj_plabpcs, $proj_ronpcs, ".
" '$proj_funders', NULL, $plabpcs, $ronpcs, ".
" $public, '$proj_whynotpublic', $linked)");
DBQueryFatal("INSERT INTO project_stats (pid) VALUES ('$pid')");
......
......@@ -39,6 +39,7 @@ function SHOWPROJECT($pid, $thisuid) {
$proj_head_uid = $row[head_uid];
$proj_members = $row[num_members];
$proj_pcs = $row[num_pcs];
# These are now booleans, not actual counts.
$proj_ronpcs = $row[num_ron];
$proj_plabpcs = $row[num_pcplab];
$proj_linked = $row[linked_to_us];
......@@ -64,6 +65,20 @@ function SHOWPROJECT($pid, $thisuid) {
$proj_linked = "No";
}
if ($proj_ronpcs) {
$proj_ronpcs = "Yes";
}
else {
$proj_ronpcs = "No";
}
if ($proj_plabpcs) {
$proj_plabpcs = "Yes";
}
else {
$proj_plabpcs = "No";
}
if (!$expt_last) {
$expt_last = "&nbsp";
}
......@@ -180,12 +195,12 @@ function SHOWPROJECT($pid, $thisuid) {
</tr>\n";
echo "<tr>
<td>#Planetlab PCs: </td>
<td>Planetlab Access: </td>
<td class=\"left\">$proj_plabpcs</td>
</tr>\n";
echo "<tr>
<td>#RON PCs: </td>
<td>RON Access: </td>
<td class=\"left\">$proj_ronpcs</td>
</tr>\n";
......@@ -749,6 +764,7 @@ function SHOWEXP($pid, $eid, $short = 0, $sortby = "") {
$mnet_cores = $exprow["modelnet_cores"];
$mnet_edges = $exprow["modelnet_edges"];
$lockdown = $exprow["lockdown"];
$exptidx = $exprow["idx"];
$autoswap_hrs= ($autoswap_timeout/60.0);
$idleswap_hrs= ($idleswap_timeout/60.0);
......@@ -1019,6 +1035,10 @@ function SHOWEXP($pid, $eid, $short = 0, $sortby = "") {
<td class=\"left\">$syncserver</td>
</tr>\n";
}
echo "<tr>
<td>Index: </td>
<td class=\"left\">$exptidx</td>
</tr>\n";
}
echo "</table>\n";
......
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