diff --git a/www/TODO b/www/TODO index 921a5f34df4df500197522dfb6073e0269f71b1f..09b351bc62a32df6e29c862bcf6b3081a433f95e 100644 --- a/www/TODO +++ b/www/TODO @@ -63,26 +63,16 @@ I could just figure out how to add a php mode to emacs ... * Backup links in all the pages. -* Page Footers in all the pages. Last modified, link to main testbed page, - email address of the testbed, etc. - * Change to ?uid=stoller&pid=testbed style arguments in all the pages I have not yet fixed (that is, get rid of that regex thing at the top of the page to find the arguments). -* Add a Show Project Information selection page (akin to the Show - Experiments selection page), which invokes the existing showproject - page. Useful for admin types who want to see the information for a - particular project. - * Admin page to remove a project. * Admin page to remove a user. * Admin page to remove an experiment. -* Admin page to control node settings (OS, etc.) - * Add confirm buttons in various places. I did one in the end experiments page, as a simple button (so you gotta press two things). I think this appproach is fine. @@ -92,8 +82,6 @@ I could just figure out how to add a php mode to emacs ... experiment name, downcase it. Mac was going to do this, but I don't know if he got to it. -* Cleanse the database of random entries that have crept in. - * Get people to go use the pages (including modify user information!). * Lastly, macrofy the entire thing and get rid the damn frames! I hate diff --git a/www/addusr.php3 b/www/addusr.php3 index f57178c69b6f9377671d7d0ab899f8445e269f72..8f962690c2ea074e636d4e7dd5bd83b9162e7e17 100755 --- a/www/addusr.php3 +++ b/www/addusr.php3 @@ -1,12 +1,8 @@ - - -New User - - - *Username: - + \n"; echo " @@ -197,12 +194,13 @@ else { # # The only common field! # -# XXX Note CONSTANT size in expression: PID is 12 chars max. +# Note PID max length. # echo " *Project: - + \n"; ?> @@ -210,9 +208,10 @@ echo " - - - - - + diff --git a/www/approveproject.php3 b/www/approveproject.php3 index 274c96064db051e080d264e4f325d452326a7524..b7d9b2a49f9d59d66752b759fad239a305953a6a 100644 --- a/www/approveproject.php3 +++ b/www/approveproject.php3 @@ -1,12 +1,11 @@ - - -New Users Approved - - - - - - diff --git a/www/approveproject_form.php3 b/www/approveproject_form.php3 index 23d4ccd00a6978eb2a97c3a06d762f006434ef9f..873d3d0e9cbe83c51725fa26a52c2a5fb6e7d7f4 100755 --- a/www/approveproject_form.php3 +++ b/www/approveproject_form.php3 @@ -1,12 +1,11 @@ - - -New Project Approval - - - \n"; + +# +# Standard Testbed Footer +# +PAGEFOOTER(); ?> - - diff --git a/www/approveproject_list.php3 b/www/approveproject_list.php3 index 761463e36962ac23be6dd5fa19f4e4a8a22b15a4..840ebb9fcccb26519904d9a9d7179aa556fb9469 100755 --- a/www/approveproject_list.php3 +++ b/www/approveproject_list.php3 @@ -1,12 +1,11 @@ - - -New Project Approval List - - - \n"; } echo "\n"; + +# +# Standard Testbed Footer +# +PAGEFOOTER(); ?> - - diff --git a/www/approveuser.php3 b/www/approveuser.php3 index 61458d5c5ac7dc7b931eadf95298244187ab0420..784bf142ba0c7a5c0e61ff5902fc9b13ba8caf53 100644 --- a/www/approveuser.php3 +++ b/www/approveuser.php3 @@ -1,12 +1,11 @@ - - -New Users Approved - - - - - - diff --git a/www/approveuser_form.php3 b/www/approveuser_form.php3 index 5b248257d1ff4bcdcab9c02436286a6d5b3ce357..8a5443ebef9a7c805f3565b2cf00478315e2f9ee 100755 --- a/www/approveuser_form.php3 +++ b/www/approveuser_form.php3 @@ -1,12 +1,11 @@ - - -New User Approval - - - - - - \n"; + \n"; + +# +# Standard Testbed Footer +# +PAGEFOOTER(); ?> diff --git a/www/beginexp_form.php3 b/www/beginexp_form.php3 index db9c4460c44c4cad9408fc8e10087cde4eca6929..eedb56e63a0e0fe1a579472f9ea741538a061304 100644 --- a/www/beginexp_form.php3 +++ b/www/beginexp_form.php3 @@ -1,12 +1,11 @@ - - -Begin an Experiment - - - # # Experiment ID and Long Name: # -# XXX Note CONSTANT in expression! +# Note DB max length. # echo " *Name (no blanks): + size=$TBDB_EIDLEN maxlength=$TBDB_EIDLEN> \n"; @@ -144,5 +143,10 @@ echo " - - + + diff --git a/www/beginexp_process.php3 b/www/beginexp_process.php3 index e37277957f13a95807c98a82f4c93832e1d9ab50..a3c81a13e00c8fefb51800b2103083bf48f1d57d 100644 --- a/www/beginexp_process.php3 +++ b/www/beginexp_process.php3 @@ -1,46 +1,38 @@ - - -Utah Testbed Begin Experiment - - - 19) { +if (strlen($exp_id) > $TBDB_EIDLEN) { USERERROR("The experiment name \"$exp_id\" is too long! ". "Please select another.", 1); } @@ -304,6 +291,8 @@ mail($TBMAIL_WWW, "TESTBED: New Experiment Created", "Errors-To: $TBMAIL_WWW"); } +# +# Standard Testbed Footer +# +PAGEFOOTER(); ?> - - diff --git a/www/dbdefs.php3 b/www/dbdefs.php3 new file mode 100644 index 0000000000000000000000000000000000000000..4d41833c5a712a30349bc7bfcab22cb2316717ee --- /dev/null +++ b/www/dbdefs.php3 @@ -0,0 +1,19 @@ + diff --git a/www/defs.php3 b/www/defs.php3 index 1d48cbabbef7d75b2fac1298a27e63de73e5a35d..d1cba947952fe5851e435813c6552e827dd8e630 100644 --- a/www/defs.php3 +++ b/www/defs.php3 @@ -13,7 +13,6 @@ $TBMAIL_APPROVE = "Testbed Approval "; #$TBMAIL_WWW = "Testbed WWW "; #$TBMAIL_APPROVE = "Testbed Approval "; -$TBDBNAME = "tbdb"; $TBDIR = "/usr/testbed/"; $TBWWW_DIR = "$TBDIR"."www/"; $TBBIN_DIR = "$TBDIR"."bin/"; @@ -30,6 +29,11 @@ $TBAUTHTIMEOUT = 10800; $TBAUTHDOMAIN = ".emulab.net"; #$TBAUTHDOMAIN = "golden-gw.ballmoss.com"; +# +# Database constants and the like. +# +include("dbdefs.php3"); + # # Generate the KEY from a name # @@ -90,6 +94,14 @@ function USERERROR($message, $death) { } } +# +# A form error. +# +function FORMERROR($field) { + USERERROR("Missing field; ". + "Please go back and fill out the \"$field\" field!", 1); +} + # # Is this user an admin type? # @@ -110,6 +122,40 @@ function ISADMIN($uid) { return $admin; } +# +# Spit out a vanilla page header. +# +function PAGEHEADER($title) { + echo " + + $title + + + \n"; +} + +# +# Spit out a vanilla page footer. +# +function PAGEFOOTER() { + global $TBBASE; + + echo "

+
[Network Testbed Home]
+
+ [Flux Research Group] + [School of Computing] + [University of Utah] +
+

+ + Problems? Contact + + Testbed Operations (testbed-ops@flux.cs.utah.edu) + + \n"; +} + # # Beware empty spaces (cookies)! # diff --git a/www/endexp.php3 b/www/endexp.php3 index 139e3a1cbb6ec1a85a23bb04db7405e4fa2f6ffa..c73277d31f9757a9020314a2a69533c2d1500b4f 100644 --- a/www/endexp.php3 +++ b/www/endexp.php3 @@ -1,12 +1,11 @@ - - -Terminate Experiment - - -
"; echo "

Experiment '$exp_eid' in project '$exp_pid' Terminated!
"; -echo "


"; +echo ""; +echo "\n"; +# +# Standard Testbed Footer +# +PAGEFOOTER(); ?> - - - diff --git a/www/endexp_form.php3 b/www/endexp_form.php3 index 2d9094c76e49f2fc100f674c34f17a493aed7d09..191b661278fd884ec9928ae267330166c3b45a8e 100644 --- a/www/endexp_form.php3 +++ b/www/endexp_form.php3 @@ -1,12 +1,11 @@ - - -Terminate Experiment - - - - - + + diff --git a/www/modusr_form.php3 b/www/modusr_form.php3 index 2a84932c06cee5b8c674a8ba484c1afb930cbd97..0cafa6e2cbf9f3002199ea0eaadc1361a87b298b 100644 --- a/www/modusr_form.php3 +++ b/www/modusr_form.php3 @@ -1,12 +1,11 @@ - - -Modify User Information - - - - - + + diff --git a/www/modusr_process.php3 b/www/modusr_process.php3 index a73bc4a831dbc61c2f020ba8aba41582f0121cff..bfb372af70c0e1d1149f0be8855f9a2a852bc285 100644 --- a/www/modusr_process.php3 +++ b/www/modusr_process.php3 @@ -1,12 +1,11 @@ - - -Utah Testbed Modify User Information - - -

-

User information successfully modified!

+

User information successfully modified!

- - + + diff --git a/www/newproject.php3 b/www/newproject.php3 index 19e6024c505cc2bb0fa57a2f00238ec5fb1949c1..d2614ebe5d779fdb5dbb1a255d7a6c79b696e95a 100755 --- a/www/newproject.php3 +++ b/www/newproject.php3 @@ -1,94 +1,82 @@ - - -Utah Testbed Project Request - - - 12) { +if (strlen($pid) > $TBDB_PIDLEN) { USERERROR("The project name \"$pid\" is too long! ". "Please select another.", 1); } -if (strlen($proj_head_uid) > 8) { +if (strlen($proj_head_uid) > $TBDB_UIDLEN) { USERERROR("The name \"$proj_head_uid\" is too long! ". "Please select another.", 1); } @@ -322,6 +310,9 @@ if (! $returning) { and approved, you will be classified as an active user, and will be granted full access to your user account."; } + +# +# Standard Testbed Footer +# +PAGEFOOTER(); ?> - - diff --git a/www/newproject_form.php3 b/www/newproject_form.php3 index f19b80c51d03cacee82b8d0b36967a90330d1b75..39ddec1b1c5b3a51c8f6c032f1629dd25a52af2a 100644 --- a/www/newproject_form.php3 +++ b/www/newproject_form.php3 @@ -1,12 +1,8 @@ - - -Start a New Project - - - "; } else { - echo "type=\"text\" size=\"8\" maxlength=\"8\">"; + echo "type=\"text\" size=$TBDB_UIDLEN maxlength=$TBDB_UIDLEN>"; } echo " \n"; @@ -230,7 +226,7 @@ echo " echo " *Name (no blanks): + size=$TBDB_PIDLEN maxlength=$TBDB_PIDLEN> \n"; # @@ -299,6 +295,10 @@ echo " - - + diff --git a/www/nodecontrol.php3 b/www/nodecontrol.php3 index d00a2da25af1be36bd2c39816031a7a06925f2b7..6ced91bd3be5ed78e772e7aeb821492406baed9a 100644 --- a/www/nodecontrol.php3 +++ b/www/nodecontrol.php3 @@ -14,6 +14,7 @@ LOGGEDINORDIE($uid); # $isadmin = ISADMIN($uid); if (! $isadmin) { + PAGEHEADER("Node Control"); USERERROR("You do not have admin privledges!", 1); } @@ -23,7 +24,8 @@ if (! $isadmin) { $query_result = mysql_db_query($TBDBNAME, "SELECT node_id FROM nodes WHERE node_id=\"$node_id\""); if (mysql_num_rows($query_result) == 0) { - USERERROR("The node $node_id is not a valid nodeid", 1); + PAGEHEADER("Node Control"); + USERERROR("The node $node_id is not a valid nodeid", 1); } # @@ -39,6 +41,7 @@ $insert_result = mysql_db_query($TBDBNAME, if (! $insert_result) { $err = mysql_error(); + PAGEHEADER("Node Control"); TBERROR("Database Error changing node setup for $node_id: $err", 1); } @@ -47,4 +50,7 @@ if (! $insert_result) { # header("Location: nodecontrol_list.php3?uid=$uid"); +# +# No need to do a footer! +# ?> diff --git a/www/nodecontrol_form.php3 b/www/nodecontrol_form.php3 index 9a2d7ba28538e51559f540ff2b1d20b8200d5f07..4a09c3a3cf335d02c0e8f99368496038a645efe9 100644 --- a/www/nodecontrol_form.php3 +++ b/www/nodecontrol_form.php3 @@ -1,12 +1,11 @@ - - -Node Control - - - \n"; -?> - - +# +# Standard Testbed Footer +# +PAGEFOOTER(); +?> diff --git a/www/nodecontrol_list.php3 b/www/nodecontrol_list.php3 index 47bb2ea02c4b00d32b85d23ad33dd83e054f379d..66335b20ec25660284c2c8a1d838e287912e902e 100644 --- a/www/nodecontrol_list.php3 +++ b/www/nodecontrol_list.php3 @@ -1,12 +1,11 @@ - - -Node Control - - - \n"; + +# +# Standard Testbed Footer +# +PAGEFOOTER(); ?> - - diff --git a/www/showexp.php3 b/www/showexp.php3 index 5a8972a6f9e51773ab0c1c35e6d85617f2fb2c5d..54058b89f3baf5c532d82761cabb71935032e4e1 100644 --- a/www/showexp.php3 +++ b/www/showexp.php3 @@ -1,12 +1,11 @@ - - -Show Experiment Information - - - $proj_expires \n"; -echo "\n"; +echo " + \n"; +# +# Standard Testbed Footer +# +PAGEFOOTER(); ?> - - - diff --git a/www/showexp_form.php3 b/www/showexp_form.php3 index 1f6ceefc01fb40d1e2fbed866692e9778160bb11..6d162544519ad8d949aa1a26ce935d6e5bff3c9a 100644 --- a/www/showexp_form.php3 +++ b/www/showexp_form.php3 @@ -1,12 +1,11 @@ - - -Show Experiment Information - - - - - + + diff --git a/www/showproject.php3 b/www/showproject.php3 index 9f6d4fa97a38950a13ffb7c1ed1b683632fd2f04..04128979f2b847a33fd97ac652e369b6309ae47c 100644 --- a/www/showproject.php3 +++ b/www/showproject.php3 @@ -1,12 +1,12 @@ - - -Show Project Information - - - \n"; + +# +# Standard Testbed Footer +# +PAGEFOOTER(); ?> - - - diff --git a/www/showproject_dump.php3 b/www/showproject_dump.php3 index cdeb8b8d55d5d3a6e855c8c16793b279cfc6ce06..ce277a40a5d492f06b4b22665660b50e1d184977 100644 --- a/www/showproject_dump.php3 +++ b/www/showproject_dump.php3 @@ -1,6 +1,6 @@ - -Show Experiment Information - - - - - + + diff --git a/www/showproject_list.php3 b/www/showproject_list.php3 index a5dab2a323141aa53edb3d79659bc4e14ba29c33..9ae5dc7bfe7ce375dd778c0b95d3590390eaf5cd 100644 --- a/www/showproject_list.php3 +++ b/www/showproject_list.php3 @@ -1,12 +1,11 @@ - - -Show Experiment Information - - - \n"; } echo "\n"; + +# +# Standard Testbed Footer +# +PAGEFOOTER(); ?> - - diff --git a/www/usradded.php3 b/www/usradded.php3 index 2166146e49b292e4c381f8d504bddb5b12f72993..1f9788200cf235768d7e64cec29c1a59f2c0d7d5 100644 --- a/www/usradded.php3 +++ b/www/usradded.php3 @@ -1,61 +1,46 @@ - - Joining a project - - - "; +# +# Standard Testbed Header +# +PAGEHEADER("Join a Project"); + # # First off, sanity check the form to make sure all the required fields # were provided. I do this on a per field basis so that we can be # informative. Be sure to correlate these checks with any changes made to -# the project form. Note that this sequence of statements results in -# only the last bad field being displayed, but thats okay. The user will -# eventually figure out that fields marked with * mean something! +# the project form. # -$formerror="No Error"; if (!isset($uid) || strcmp($uid, "") == 0) { - $formerror = "UserName"; + FORMERROR("UserName"); } if (!isset($usr_email) || strcmp($usr_email, "") == 0) { - $formerror = "Email Address"; + FORMERROR("Email Address"); } if (!isset($usr_name) || strcmp($usr_name, "") == 0) { - $formerror = "Full Name"; + FORMERROR("Full Name"); } if (!isset($pid) || strcmp($pid, "") == 0) { - $formerror = "Project"; + FORMERROR("Project"); } if (!isset($usr_affil) || strcmp($usr_affil, "") == 0) { - $formerror = "Institutional Afilliation"; + FORMERROR("Institutional Afilliation"); } if (!isset($usr_title) || strcmp($usr_title, "") == 0) { - $formerror = "Title/Position"; -} - -if ($formerror != "No Error") { - echo "



- Missing field; Please go back and fill out the \"$formerror\" field!\n -

- - "; - die(""); + FORMERROR("Title/Position"); } # -# Database limit; UID must be 8 chars or less. +# Database limits # -# XXX Note CONSTANT in expression! -# -if (strlen($uid) > 8) { +if (strlen($uid) > $TBDB_UIDLEN) { USERERROR("The name \"$uid\" is too long! ". "Please select another.", 1); } @@ -268,6 +253,9 @@ echo "

The leader of project '$pid' has been notified of your application. He/She will make a decision and either approve or deny your application, and you will be notified as soon as a decision has been made."; + +# +# Standard Testbed Footer +# +PAGEFOOTER(); ?> - - diff --git a/www/verifyusr.php3 b/www/verifyusr.php3 index 5ad39fad763db14c10e6ca52c8219d7cdd78eaea..e90ecabd75d06275e030aab67d61e8520ac59224 100644 --- a/www/verifyusr.php3 +++ b/www/verifyusr.php3 @@ -1,12 +1,11 @@ - - -Confirming Verification - - - - - diff --git a/www/verifyusr_form.php3 b/www/verifyusr_form.php3 index af4610fa6e5b0d08f9c6b426a53ecfd0954ff201..763f5ac8ce16a2e3c88bc037715dd896e212700c 100644 --- a/www/verifyusr_form.php3 +++ b/www/verifyusr_form.php3 @@ -1,12 +1,11 @@ - - -New User Verification - - - echo "\n"; echo "\n"; + +# +# Standard Testbed Footer +# +PAGEFOOTER(); ?> - -