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

Widearea permission changes:

* Two new fields on the new project page that ask the project leader to
  specify how many ron and pcplab nodes they need. There is a link to a
  page that should describe these nodes, but thats blank.

* The project approval page will add a couple of checkboxes for ron and
  pcplab nodes. This will allow the project to be approved independent of
  the ron/pcplab usage. So, you can approve the project but decline the
  request to use those nodes types (or just one of them).

* The project table in the DB has a "list" of remote node types for which
  accounts should be built. Its implemented as a set and it can contain
  just two node types (pcron, pcplab) right now. The set is created in
  the approval page, and someday we can add a page to operate on that
  set directly if we need it.
parent f066d2d9
......@@ -170,6 +170,25 @@ elseif (strcmp($approval, "approve") == 0) {
DBQueryFatal("UPDATE projects set approved='1' WHERE pid='$pid'");
#
# XXX
# Temporary Plab hack.
#
$pcremote_ok = array();
if (isset($pcplab_okay) &&
!strcmp($pcplab_okay, "Yep")) {
$pcremote_ok[] = "pcplab";
}
if (isset($ron_okay) &&
!strcmp($ron_okay, "Yep")) {
$pcremote_ok[] = "pcron";
}
if (count($pcremote_ok)) {
$foo = implode(",", $pcremote_ok);
DBQueryFatal("UPDATE projects set pcremote_ok='$foo' ".
"WHERE pid='$pid'");
}
#
# Change the status if necessary. This only happens for new users
# being approved in their first project. After this, the status is
......
......@@ -5,6 +5,7 @@
# All rights reserved.
#
include("defs.php3");
include("showstuff.php3");
#
# Standard Testbed Header
......@@ -36,10 +37,8 @@ if (!isset($pid) ||
#
# Check to make sure thats this is a valid PID.
#
$query_result =
DBQueryFatal("SELECT * FROM projects WHERE pid='$pid'");
if (mysql_num_rows($query_result) == 0) {
USERERROR("The project $pid is not a valid project.", 1);
if (! TBValidProject($pid)) {
USERERROR("The project $pid is not a valid project.", 1);
}
echo "<center><h3>You have the following choices:</h3></center>
......@@ -76,9 +75,18 @@ echo "<center><h3>You have the following choices:</h3></center>
</table>\n";
#
# This will spit out the info.
# Show stuff
#
include("showproject_dump.php3");
SHOWPROJECT($pid, $uid);
TBProjLeader($pid, $projleader);
echo "<center>
<h3>Project Leader Information</h3>
</center>
<table align=center border=0>\n";
SHOWUSER($projleader);
#
# Now put up the menu choice along with a text box for an email message.
......@@ -101,6 +109,34 @@ echo "<tr>
</td>
</tr>\n";
#
# XXX
# Temporary Plab hack.
# See if remote nodes requested and put up checkboxes to allow override.
#
$query_result =
DBQueryFatal("select num_pcplab,num_ron from projects where pid='$pid'");
$row = mysql_fetch_array($query_result);
$num_pcplab = $row[num_pcplab];
$num_ron = $row[num_ron];
if ($num_ron || $num_pcplab) {
echo "<tr>
<td align=center>\n";
if ($num_pcplab) {
echo "<input type=checkbox value=Yep checked
name=pcplab_okay>
Allow Plab &nbsp\n";
}
if ($num_ron) {
echo "<input type=checkbox value=Yep checked
name=ron_okay>
Allow RON &nbsp\n";
}
echo " </td>
</tr>\n";
}
echo "<tr>
<td>Use the text box (70 columns wide) to add a message to the
......
......@@ -372,12 +372,24 @@ function SPITFORM($formfields, $returning, $errors)
echo "<tr>
<td colspan=2>*Estimated #of
<a href=\"$TBDOCBASE/docwrapper.php3?docname=hardware.html#tbshark\">
Sharks</a>:</td>
<a href=\"$TBDOCBASE/docwrapper.php3?docname=widearea.html\">
Planetlab PCs</a>:</td>
<td class=left>
<input type=text
name=\"formfields[proj_sharks]\"
value=\"" . $formfields[proj_sharks] . "\"
name=\"formfields[proj_plabpcs]\"
value=\"" . $formfields[proj_plabpcs] . "\"
size=4>
</td>
</tr>\n";
echo "<tr>
<td colspan=2>*Estimated #of
<a href=\"$TBDOCBASE/docwrapper.php3?docname=widearea.html\">
RON PCs</a>:</td>
<td class=left>
<input type=text
name=\"formfields[proj_ronpcs]\"
value=\"" . $formfields[proj_ronpcs] . "\"
size=4>
</td>
</tr>\n";
......@@ -461,7 +473,8 @@ if (! isset($submit)) {
$defaults = array();
$defaults[proj_URL] = "$HTTPTAG";
$defaults[usr_URL] = "$HTTPTAG";
$defaults[proj_sharks] = "0";
$defaults[proj_ronpcs] = "0";
$defaults[proj_plabpcs] = "0";
$defaults[proj_public] = "checked";
$defaults[proj_linked] = "checked";
......@@ -615,12 +628,19 @@ if (!isset($formfields[proj_pcs]) ||
elseif (! ereg("^[0-9]+$", $formfields[proj_pcs])) {
$errors["#of PCs"] = "Must be numeric";
}
if (!isset($formfields[proj_sharks]) ||
strcmp($formfields[proj_sharks], "") == 0) {
$errors["#of Sharks"] = "Missing Field";
if (!isset($formfields[proj_plabpcs]) ||
strcmp($formfields[proj_plabpcs], "") == 0) {
$errors["#of Planetlab PCs"] = "Missing Field";
}
elseif (! ereg("^[0-9]+$", $formfields[proj_plabpcs])) {
$errors["#of Planetlab PCs"] = "Must be numeric";
}
if (!isset($formfields[proj_ronpcs]) ||
strcmp($formfields[proj_ronpcs], "") == 0) {
$errors["#of RON PCs"] = "Missing Field";
}
elseif (! ereg("^[0-9]+$", $formfields[proj_sharks])) {
$errors["#of Sharks"] = "Must be numeric";
elseif (! ereg("^[0-9]+$", $formfields[proj_ronpcs])) {
$errors["#of RON PCs"] = "Must be numeric";
}
if (!isset($formfields[proj_why]) ||
strcmp($formfields[proj_why], "") == 0) {
......@@ -728,7 +748,8 @@ $proj_funders = addslashes($formfields[proj_funders]);
$proj_whynotpublic = addslashes($formfields[proj_whynotpublic]);
$proj_members = $formfields[proj_members];
$proj_pcs = $formfields[proj_pcs];
$proj_sharks = $formfields[proj_sharks];
$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));
......@@ -831,12 +852,13 @@ if (! $returning) {
#
DBQueryFatal("INSERT INTO projects ".
"(pid, created, expires, name, URL, head_uid, ".
" num_members, num_pcs, num_sharks, why, funders, unix_gid, ".
" public, public_whynot)".
" num_members, num_pcs, why, funders, unix_gid, ".
" num_pcplab, num_ron, public, public_whynot)".
"VALUES ('$pid', now(), '$proj_expires','$proj_name', ".
" '$proj_URL', '$proj_head_uid', '$proj_members', ".
" '$proj_pcs', '$proj_sharks', '$proj_why', ".
" '$proj_funders', NULL, $public, '$proj_whynotpublic')");
" '$proj_pcs', '$proj_why', ".
" '$proj_funders', NULL, $proj_plabpcs, $proj_ronpcs, ".
" $public, '$proj_whynotpublic')");
DBQueryFatal("INSERT INTO groups ".
"(pid, gid, leader, created, description, unix_gid, unix_name) ".
......@@ -876,7 +898,8 @@ TBMAIL($TBMAIL_APPROVAL,
"Phone: $usr_phone\n".
"Members: $proj_members\n".
"PCs: $proj_pcs\n".
"Sharks: $proj_sharks\n".
"Planetlab PCs: $proj_plabpcs\n".
"RON PCs: $proj_ronpcs\n".
"Unix GID: $unix_name ($unix_gid)\n".
"Reasons:\n$proj_why\n\n".
"Please review the application and when you have made a decision,\n".
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2002 University of Utah and the Flux Group.
# All rights reserved.
#
#
# This is an included file. No headers or footers or includes!
#
$query_result = DBQueryFatal("SELECT * FROM projects WHERE pid='$pid'");
if (mysql_num_rows($query_result) == 0) {
USERERROR("The project $pid is not a valid project.", 1);
}
$row = mysql_fetch_array($query_result);
echo "<center>
<h3>Project Information</h3>
</center>
<table align=center border=1>\n";
$proj_created = $row[created];
$proj_expires = $row[expires];
$proj_name = stripslashes($row[name]);
$proj_URL = $row[URL];
$proj_funders = $row[funders];
$proj_head_uid = $row[head_uid];
$proj_members = $row[num_members];
$proj_pcs = $row[num_pcs];
$proj_sharks = $row[num_sharks];
$proj_why = $row[why];
$control_node = $row[control_node];
#
# Generate the table.
#
echo "<tr>
<td>Name: </td>
<td class=\"left\">$pid</td>
</tr>\n";
echo "<tr>
<td>Long Name: </td>
<td class=\"left\">$proj_name</td>
</tr>\n";
echo "<tr>
<td>Project Head: </td>
<td class=\"left\">$proj_head_uid</td>
</tr>\n";
echo "<tr>
<td>URL: </td>
<td class=\"left\">
<A href='$proj_URL'>$proj_URL</A></td>
</tr>\n";
echo "<tr>
<td>Funders: </td>
<td class=\"left\">$proj_funders</td>
</tr>\n";
echo "<tr>
<td>#Project Members: </td>
<td class=\"left\">$proj_members</td>
</tr>\n";
echo "<tr>
<td>#PCs: </td>
<td class=\"left\">$proj_pcs</td>
</tr>\n";
echo "<tr>
<td>#Sharks: </td>
<td class=\"left\">$proj_sharks</td>
</tr>\n";
echo "<tr>
<td>Created: </td>
<td class=\"left\">$proj_created</td>
</tr>\n";
echo "<tr>
<td>Expires: </td>
<td class=\"left\">$proj_expires</td>
</tr>\n";
echo "<tr>
<td colspan='2'>Why?:</td>
</tr>\n";
echo "<tr>
<td colspan='2' width=600>$proj_why</td>
</tr>\n";
echo "</table>\n";
$userinfo_result =
DBQueryFatal("SELECT * from users where uid='$proj_head_uid'");
$row = mysql_fetch_array($userinfo_result);
$usr_expires = $row[usr_expires];
$usr_email = $row[usr_email];
$usr_URL = $row[usr_URL];
$usr_addr = $row[usr_addr];
$usr_name = $row[usr_name];
$usr_phone = $row[usr_phone];
$usr_title = $row[usr_title];
$usr_affil = $row[usr_affil];
echo "<center>
<h3>Project Leader Information</h3>
</center>
<table align=center border=1>\n";
echo "<tr>
<td>Username:</td>
<td>$proj_head_uid</td>
</tr>\n";
echo "<tr>
<td>Full Name:</td>
<td>$usr_name</td>
</tr>\n";
echo "<tr>
<td>Email Address:</td>
<td>$usr_email</td>
</tr>\n";
echo "<tr>
<td>Home Page URL:</td>
<td><A href='$usr_URL'>$usr_URL</A></td>
</tr>\n";
echo "<tr>
<td>Expiration date:</td>
<td>$usr_expires</td>
</tr>\n";
echo "<tr>
<td>Mailing Address:</td>
<td>$usr_addr</td>
</tr>\n";
echo "<tr>
<td>Phone #:</td>
<td>$usr_phone</td>
</tr>\n";
echo "<tr>
<td>Title/Position:</td>
<td>$usr_title</td>
</tr>\n";
echo "<tr>
<td>Institutional Affiliation:</td>
<td>$usr_affil</td>
</tr>\n";
echo "</table>\n";
#
# This is an included file.
#
?>
......@@ -23,18 +23,19 @@ function SHOWPROJECT($pid, $thisuid) {
echo "<center>
<h3>Project Profile</h3>
</center>
<table align=center border=1>\n";
<table align=center cellpadding=2 border=1>\n";
$proj_created = $row[created];
$proj_expires = $row[expires];
$proj_name = stripslashes($row[name]);
$proj_URL = $row[URL];
$proj_public = $row[public];
$proj_funders = $row[funders];
$proj_funders = stripslashes($row[funders]);;
$proj_head_uid = $row[head_uid];
$proj_members = $row[num_members];
$proj_pcs = $row[num_pcs];
$proj_sharks = $row[num_sharks];
$proj_ronpcs = $row[num_pcplab];
$proj_plabpcs = $row[num_ron];
$proj_why = nl2br($row[why]);
$control_node = $row[control_node];
$approved = $row[approved];
......@@ -99,8 +100,13 @@ function SHOWPROJECT($pid, $thisuid) {
</tr>\n";
echo "<tr>
<td>#Sharks: </td>
<td class=\"left\">$proj_sharks</td>
<td>#Planetlab PCs: </td>
<td class=\"left\">$proj_plabpcs</td>
</tr>\n";
echo "<tr>
<td>#RON PCs: </td>
<td class=\"left\">$proj_ronpcs</td>
</tr>\n";
echo "<tr>
......
<!--
EMULAB-COPYRIGHT
Copyright (c) 2000-2002 University of Utah and the Flux Group.
All rights reserved.
-->
<center>
<h1>
Widearea Nodes
</h1>
</center>
Still under construction ... but if do not already know what widearea
nodes are, you probably do not want to say you need any since it will
likely hold up your project approval.
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