diff --git a/www/_addproj.php3 b/www/_addproj.php3 index 7b8085e2909586556cffc7dc9d471480b1b86f46..cee8fdc5462c4df4cbbffbbe96e34eddc15f998f 100755 --- a/www/_addproj.php3 +++ b/www/_addproj.php3 @@ -1,39 +1,41 @@ - 0"; - $result = mysql_db_query("tbdb", $query); - $numusers = mysql_num_rows($result); - $query2 = "SELECT timeout FROM login WHERE uid=\"$PHP_AUTH_USER\""; - $result2 = mysql_db_query("tbdb", $query2); - $n = mysql_num_rows($result2); - $row = mysql_fetch_row($result2); - if (($n == 0) || ($numusers == 0) || ($row[0] < time())) { - $cmnd = "DELETE FROM login WHERE uid=\"$PHP_AUTH_USER\""; - mysql_db_query("tbdb", $cmnd); - Header("WWW-Authenticate: Basic realm=\"testbed\""); - Header("HTTP/1.0 401 Unauthorized"); - die ("Authorization Failed\n"); - } - $timeout = time() + 1800; - $cmnd = "UPDATE login SET timeout=\"$timeout\" where uid=\"$PHP_AUTH_USER\""; - mysql_db_query("tbdb", $cmnd); -} -?> - New Project -

Begin a project

- +

Create a New Project

+You are not logged in. Please go back to the "; + echo " Home Page "; + echo "and log in first."; + exit; + } else { + $row = mysql_fetch_row($result); + if ($row[0] < time()) { # if their login expired + echo "

You have been logged out due to inactivity. +Please log in again.

\n"; + $cmnd = "DELETE FROM login WHERE uid=\"$auth_usr\""; + mysql_db_query("tbdb", $cmnd); + exit; + } else { + $timeout = time() + 86400; + $cmnd = "UPDATE login SET timeout=\"$timeout\" where uid=\"$auth_usr\""; + mysql_db_query("tbdb", $cmnd); + } + } +} else { + unset($auth_usr); +} +?> Expiration date: - \ No newline at end of file + diff --git a/www/added.php3 b/www/added.php3 index 7d8d76d1cbd4408c27cc39e231b5e59cc76e520b..70f0f1688653b18df519248760c760ab615a1d2a 100755 --- a/www/added.php3 +++ b/www/added.php3 @@ -8,7 +8,21 @@ echo "

Adding information to the Testbed Database

\n"; $my_passwd=$pswd; -$enc = crypt("$my_passwd", strlen($uid)); +$mypipe = popen(escapeshellcmd( + "/usr/testbed/bin/checkpass $my_passwd $grp_head_uid '$usr_name:$email'"), + "w+"); +if ($mypipe) { + $retval=fgets($mypipe,1024); + if (strcmp($retval,"ok\n")!=0) { + die("

The password you have chosen will not work:

$retval

"); + } +} else { + mail("newbold@cs.utah.edu","TESTBED: checkpass failure", + "\n$usr_name ($grp_head_uid) just tried to set up a testbed account,\n". + "but checkpass pipe did not open (returned '$mypipe').\n". + "\nThanks,\nMac\n"); +} +$enc = crypt("$my_passwd"); array_walk($HTTP_POST_VARS, 'addslashes'); if (isset($pid)) { #add a project to the database if ($trust == 2) { diff --git a/www/addgrp.php3 b/www/addgrp.php3 index a936eaa41c377a86923c27ede176750b365c07cd..e4a34554b80de05bb8b15744cfcc60fa7875d52e 100755 --- a/www/addgrp.php3 +++ b/www/addgrp.php3 @@ -1,6 +1,6 @@ -New Group +New Project @@ -15,13 +15,15 @@ if ( ereg("php3\?([[:alnum:]]+)",$REQUEST_URI,$Vals) ) { ?> + - - - - + + + \n"; } -echo " - + - - + - + - - + \n"; ?> - - + - + - +
-

Apply to use the Utah Network Testbed

+

Apply to Use the Utah Network Testbed

+Only fields marked with * are required
Group InformationGroup Head Information
Group Name:Username: +
Project InformationProject Head Information
*Project Name:*Username:
Group long name:Full Name:"; +echo "
*Project long name:*Full Name:"; if (isset($row)) { echo "
Group URL:Email
Address:
"; +
Project URL:*Email
Address:
"; if (isset($row)) { echo "
When do you
expect to be done -
using the testbed?
When do you
expect to be done
using the testbed?
"; } echo "
Group Affiliation:Phone #:*Project Affiliation:*Phone #:
Password:Retype
Password:
*Password:*Retype
Password:
name="password2"> 
Please describe how and why you plan -to use the Testbed
*Please describe how and why you plan +to use the Testbed:
diff --git a/www/addproj.php3 b/www/addproj.php3 index bcac462a7b4d5e3ab5307c74e48af6e284428c97..b55ee77f2a00523532f142ed34236845d6189e42 100755 --- a/www/addproj.php3 +++ b/www/addproj.php3 @@ -1,46 +1,42 @@ - 0"; - $result = mysql_db_query("tbdb", $query); - $numusers = mysql_num_rows($result); - $query2 = "SELECT timeout FROM login WHERE uid=\"$PHP_AUTH_USER\""; - $result2 = mysql_db_query("tbdb", $query2); - $n = mysql_num_rows($result2); - if (($n == 0) && ($numusers != 0)){ - $cmnd = "INSERT INTO login VALUES ('$PHP_AUTH_USER', '0')"; - mysql_db_query("tbdb", $cmnd); - } else { - $row = mysql_fetch_row($result2); - if (($numusers == 0) || ($row[0] < time())) { - $cmnd = "DELETE FROM login WHERE uid=\"$PHP_AUTH_USER\""; - mysql_db_query("tbdb", $cmnd); - Header("WWW-Authenticate: Basic realm=\"testbed\""); - Header("HTTP/1.0 401 Unauthorized"); - die ("Authorization Failed\n"); - } - } - $timeout = time() + 1800; - $cmnd = "UPDATE login SET timeout=\"$timeout\" where uid=\"$PHP_AUTH_USER\""; - mysql_db_query("tbdb", $cmnd); -} -?> - New Project -

Begin a project

- +

Create a New Project

+You are not logged in. Please go back to the "; + echo " Home Page "; + echo "and log in first."; + exit; + } else { + $row = mysql_fetch_row($result); + if ($row[0] < time()) { # if their login expired + echo "

You have been logged out due to inactivity. +Please log in again.

\n"; + $cmnd = "DELETE FROM login WHERE uid=\"$auth_usr\""; + mysql_db_query("tbdb", $cmnd); + exit; + } else { + $timeout = time() + 86400; + $cmnd = "UPDATE login SET timeout=\"$timeout\" where uid=\"$auth_usr\""; + mysql_db_query("tbdb", $cmnd); + } + } +} else { + unset($auth_usr); +} +?> Only fields in bold red are required Project Name: Group association:\n"; -$query = "SELECT gid FROM grp_memb WHERE uid=\"$PHP_AUTH_USER\""; +$query = "SELECT gid FROM grp_memb WHERE uid=\"$auth_usr\""; $result = mysql_db_query("tbdb", $query); $n = mysql_num_rows($result); if ($n > 1) { @@ -76,4 +72,4 @@ echo "Expiration date: - \ No newline at end of file + diff --git a/www/addusr.php3 b/www/addusr.php3 index f10db83e6a016b3ae8a103c0cc1809284a29c503..00d9ec02071845e859b2477233df401eb225ead2 100755 --- a/www/addusr.php3 +++ b/www/addusr.php3 @@ -12,72 +12,74 @@ if ( ereg("php3\?([[:alnum:]]+)",$REQUEST_URI,$Vals) ) { } else { unset($uid); } -echo "

Apply for Group Membership

\n"; +echo "

Apply for Project Membership

\n"; echo "\n"; echo "\n"; +echo "Only fields marked with * are required\n"; if (isset($uid)) { echo "\n"; echo ""; - echo ""; $query = mysql_db_query("tbdb","select usr_expires,usr_email,usr_addr,usr_name,usr_phone,usr_pswd from users where uid='$uid'"); $row = mysql_fetch_row($query); echo ""; echo "\n"; - echo ""; echo ""; - echo ""; echo ""; - echo ""; - echo ""; } else { echo "\n"; - echo ""; + echo ""; echo ""; echo "\n"; - echo ""; + echo ""; echo ""; - echo ""; echo ""; - echo ""; - echo ""; } -echo "\n"; -} elseif ($n > 1) { # if more than one option make a select button - echo "\n"; -} else { # if no options say this - echo "There don't seem to be any groups in the database\n"; -} +echo ""; +# This used to give the selection box with all the groups... +#$query = "SELECT gid FROM groups"; +#$result = mysql_db_query("tbdb", $query); +#$n = mysql_num_rows($result); +#if ($n == 1) { # if only one option make a readonly field +# $row = mysql_fetch_row($result); +# echo "\n"; +#} elseif ($n > 1) { # if more than one option make a select button +# echo "\n"; +#} else { # if no options say this +# echo "There don't seem to be any groups in the database\n"; +#} ?> diff --git a/www/approval.php3 b/www/approval.php3 index b2e7fc33c18d9e25ca190965f0cbe190ffa2ac23..28e146ee9e04ed8341a1f0f8b1e6151262902976 100755 --- a/www/approval.php3 +++ b/www/approval.php3 @@ -26,7 +26,7 @@ Please log in again.\n"; mysql_db_query("tbdb", $cmnd); exit; } else { - $timeout = time() + 600; + $timeout = time() + 86400; $cmnd = "UPDATE login SET timeout=\"$timeout\" where uid=\"$auth_usr\""; mysql_db_query("tbdb", $cmnd); } @@ -44,8 +44,9 @@ more or less access to your nodes:
  1. User - Can log into machines in your experiments.
  2. Local Root - Can have root access on machines, can create new experiments. -
  3. Group Root - Can approve users, create projects, and update any group info or personal info for group members. -
+"; +#echo "
  • Group Root - Can approve users, create projects, and update any group info or personal info for group members."; +echo "

    \n"; $query="SELECT gid FROM grp_memb WHERE uid='$auth_usr' and trust='group_root'"; $result = mysql_db_query("tbdb", $query); @@ -101,8 +102,9 @@ if ( mysql_num_rows($found) == 0 ) {
  • +"; + #echo ""; + echo "\n"; diff --git a/www/approved.php3 b/www/approved.php3 index f38c4fa1667ca91ca9f70c3391afc54c05235c94..297b25682c16f17ff5810cafb6a525868ee975bd 100755 --- a/www/approved.php3 +++ b/www/approved.php3 @@ -26,7 +26,7 @@ Please log in again.\n"; mysql_db_query("tbdb", $cmnd); exit; } else { - $timeout = time() + 600; + $timeout = time() + 86400; $cmnd = "UPDATE login SET timeout=\"$timeout\" where uid=\"$auth_usr\""; mysql_db_query("tbdb", $cmnd); } @@ -90,7 +90,7 @@ while ($row = mysql_fetch_row($found)) { $cmd = "update grp_memb set trust='$trust' where uid='$uid'"; $cmd .= "and trust='none' and gid='$gid'"; $result = mysql_db_query("tbdb",$cmd); - mail("$usr_email","TESTBED: Group Approval", + mail("$email","TESTBED: Group Approval", "\nThis message is to notify you that you have been approved ". "as a member of \nthe $gid group with $trust permissions.\n". "\nYour status as a Testbed user is now $newstatus.". @@ -109,7 +109,7 @@ while ($row = mysql_fetch_row($found)) { while ( isset($group[$n]) ) { $cmd .= " or gid='$group[$n]'"; $n++; } $cmd .=")"; $result = mysql_db_query("tbdb",$cmd); - mail("$usr_email","TESTBED: Group Membership Denied", + mail("$email","TESTBED: Group Membership Denied", "\nThis message is to notify you that you have been denied ". "as a member of \nthe $gid group.\n". "\nYour status as a Testbed user is still $status.". diff --git a/www/bigview1.jpg b/www/bigview1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..81553327774082e0333df84a6a8ebdb391363e86 Binary files /dev/null and b/www/bigview1.jpg differ diff --git a/www/changeall.csh b/www/changeall.csh new file mode 100755 index 0000000000000000000000000000000000000000..8d296f2071f95454da46b5d4a9d6501fda1241da --- /dev/null +++ b/www/changeall.csh @@ -0,0 +1,14 @@ +#!/bin/csh -v -x +echo "Replacing $1 with $2 in all files in 3 seconds" +sleep 3 +foreach file (*.php3) + echo "Processing $file" + set str = "s/$1/$2/g;print;" + perl -ne $str < $file > .my_tmp + echo "Okay? (2 sec)" + sleep 2 + cp .my_tmp $file + rm .my_tmp +end +echo "Done." + diff --git a/www/faq.html b/www/faq.html index 4d7ad65f0cbd381d94c8b8342f752c289935fd2a..0ab9be488b811176132aea4f56b1325c2009cc62 100644 --- a/www/faq.html +++ b/www/faq.html @@ -36,30 +36,30 @@
  • What do I need to do to be able to use the Testbed?

    If you're here on your own, or you're the leader of a group of people who want to use the Testbed, the first step is to - apply for a group. A group is an entity that has been approved - to use the Testbed, and the group leader is held responsible - for the actions of members of his group. He can allow users to - join his group and use the Testbed as a member of his group. - To get a group, click on the link in the side bar titled - 'Apply for a Group'. Fill out the requested information, and + apply for a project. A project is an entity that has been approved + to use the Testbed, and the project leader is held responsible + for the actions of members of his project. He can allow users to + join his project and use the Testbed as a member of his project. + To get a project, click on the link in the side bar titled + 'Apply to Start a Project'. Fill out the requested information, and your request will be submitted to the Approval Committee.

    -
  • Someone told me to join their group. How do I do +
  • Someone told me to join their project. How do I do that?

    -

    The process of joining an existing group is quite - simple. Go to the 'Apply for Group Membership' page, fill out - the form, and wait for the group leader to approve you. Then - you're in. Your group leader primarily will control how much +

    The process of joining an existing project is quite + simple. Go to the 'Apply to Join a Project' page, fill out + the form, and wait for the project leader to approve you. Then + you're in. Your project leader primarily will control how much access you have to Testbed resources, within the limits given - to the group as a whole. + to the project as a whole.

  • I'm already a Testbed user, but I'm collaborating with - another group. How can I join that group too?

    -

    Go back to the 'Apply for Group Membership' page, put in - your username and password, and the group you want to join. We + another project. How can I join that project too?

  • +

    Go back to the 'Apply for Project Membership' page, put in + your username and password, and the project you want to join. We already have everything else on file. Then submit the request, - and the leader of the group you want to join will be notified, - and if he approves you, you'll be a member of his group as + and the leader of the project you want to join will be notified, + and if he approves you, you'll be a member of his project as well.

  • I've been approved. How do I use my account?

    @@ -68,7 +68,7 @@ be authorized to start projects or experiments, or maybe you'll just be authorized to use the nodes in an experiment. Either way, your options will show up in the side - bar. If someone in your group starts a project or experiment, + bar. If someone in your project starts a project or experiment, they'll need to ap you to it if they want you in it. Once they do that, they can tell you what nodes are reserved for the experiment, and your unix account on those nodes will be diff --git a/www/grpadded.php3 b/www/grpadded.php3 index 2aa1b0be1f6eac26045bf7f2e2cb6e7d11895adc..63abf4480adeaa266e151463a9e2f893fdfc4461 100755 --- a/www/grpadded.php3 +++ b/www/grpadded.php3 @@ -7,8 +7,21 @@ The password you have chosen will not work:

    $retval"); + } +} else { + mail("newbold@cs.utah.edu","TESTBED: checkpass failure", + "\n$usr_name ($grp_head_uid) just tried to set up a testbed account,\n". + "but checkpass pipe did not open (returned '$mypipe').\n". + "\nThanks,\nMac\n"); +} +$enc = crypt("$my_passwd"); array_walk($HTTP_POST_VARS, 'addslashes'); if (isset($gid) && isset($password1) && isset($email) && (($password1 == $password2) || ($enc == $password2))) { @@ -19,14 +32,14 @@ if (isset($gid) && isset($password1) && isset($email) && $result2 = mysql_db_query("tbdb", $query2); if ($row = mysql_fetch_row($result2)) { die("

    The group name you have chosen is already in use. ". - "Please select another. If you are a returning user, you must " - "log in and use your current password.

    "); + "Please select another. If you are a returning user, you must ". + "log in and use your current password."); } elseif ($row = mysql_fetch_row($result)) { #returning user, making new group $usr_pswd = $row[0]; if ($usr_pswd != $enc) { die("

    The username that you have chosen is already in use. ". - "Please select another. If you are a returning user, you must " + "Please select another. If you are a returning user, you must ". "log in and use your current password.

    \n"); } $returning=1; diff --git a/www/index.php3 b/www/index.php3 index 1219b7792dc638c55f61866624980b3be6119e44..bc255743071e517083fb0e369a8689b8e98fd5d9 100755 --- a/www/index.php3 +++ b/www/index.php3 @@ -11,17 +11,21 @@ if (isset($login)) { unset($login); if (isset($auth_usr)) { addslashes($auth_usr); - $PSWD = crypt("$auth_passwd", strlen($auth_usr)); - #echo "
    GOT PWD $PSWD
    "; - $query = "SELECT * FROM users WHERE uid=\"$auth_usr\" ". - "AND usr_pswd=\"$PSWD\""; + $query = "SELECT usr_pswd FROM users WHERE uid=\"$auth_usr\""; $result = mysql_db_query("tbdb", $query); - $correct = mysql_num_rows($result); - if ($correct) { + $row = mysql_fetch_row($result); + $usr_pswd = $row[0]; + #print "Got $usr_pswd from Database\n
    "; + $salt = substr($usr_pswd,0,2); + if ($salt[0] == $salt[1]) { $salt = $salt[0]; } + #print "Got $salt for salt\n
    "; + $PSWD = crypt("$auth_passwd",$salt); + #echo "
    GOT PWD $PSWD
    "; + if ($PSWD == $usr_pswd) { $query2 = "SELECT timeout FROM login WHERE uid=\"$auth_usr\""; $result2 = mysql_db_query("tbdb", $query2); $exists = mysql_num_rows($result2); - $timeout = time() + 600; + $timeout = time() + 86400; if ($exists) { $cmnd="update login set timeout='$timeout' where uid='$auth_usr'"; mysql_db_query("tbdb", $cmnd); @@ -67,7 +71,7 @@ Please log in again.\n"; $cmnd = "DELETE FROM login WHERE uid=\"$auth_usr\""; mysql_db_query("tbdb", $cmnd); } else { - $timeout = time() + 600; + $timeout = time() + 86400; $cmnd = "UPDATE login SET timeout=\"$timeout\" where uid=\"$auth_usr\""; mysql_db_query("tbdb", $cmnd); } @@ -79,12 +83,30 @@ if (isset($auth_usr)) { $result = mysql_db_query("tbdb", $query); $status_row = mysql_fetch_row($result); $status = $status_row[0]; + $query="SELECT trust FROM grp_memb WHERE uid='$auth_usr'"; + $result = mysql_db_query("tbdb", $query); + $row = mysql_fetch_row($result); + $trust = $row[0]; if ($status == "active") { - #echo "

    Update user information

    \n"; - #echo "

    Add a user to your group

    "; - #echo "

    Begin a project

    \n"; - #echo "

    Begin an experiment

    \n"; - echo "New User Approval\n"; + if ($trust == "group_root") { + # Only group leaders can do these options + echo "New User Approval\n"; + echo "

    Add a New User"; + #echo "

    Add a New User"; + echo "

    Begin a Project"; + #echo "

    Begin a Project\n"; + echo "

    "; + } + if (($trust == "group_root") || ($trust == "local_root")) { + # Only local root people can do these options + echo "Begin an Experiment"; + #echo "

    Begin an Experiment\n"; + echo "

    "; + } + # Every active user can do these options + echo "Update user information"; + #echo "

    Update user information\n"; + echo "

    \n"; } elseif ($status == "unapproved") { echo "Your account has not been approved yet. Please try back "; echo "later. Contact "; @@ -106,10 +128,10 @@ if (isset($auth_usr)) { Apply for a Group\n"; +echo "'>Apply to Start a Project\n"; echo "

    Apply for Group Membership"; +echo "'>Apply to Join a Project"; ?>


    Frequently
    Asked
    Questions

  • \n"; -echo "Only fields in bold, red type are required
    Username:"; + echo "
    *Username:"; echo "Expiration date:
    email:*Email:Mailing Address:"; echo "
    Full Name:"; + echo "
    *Full Name:"; echo "Phone #:"; echo "
    Password:"; + echo "
    *Password:"; echo "Retype Password:"; + echo "*Retype Password:"; echo " 
    Username:
    *Username:Expiration date:
    email:
    *Email:Mailing Address:"; echo "
    Full Name:"; + echo "
    *Full Name:"; echo "Phone #:"; echo "
    Password:"; + echo "
    *Password:"; echo "Retype Password:"; + echo "*Retype Password:"; echo "
    Group:"; -$query = "SELECT gid FROM groups"; -$result = mysql_db_query("tbdb", $query); -$n = mysql_num_rows($result); -if ($n == 1) { # if only one option make a readonly field - $row = mysql_fetch_row($result); - echo "
    *Project:"; +echo "
     $uid  $name  $email   $addr  $phone 
    @@ -118,7 +140,7 @@ echo "'>Apply for Group Membership"; if (!isset($auth_usr)) { echo ""; } else { - echo ""; + echo ""; } ?> diff --git a/www/verified.php3 b/www/verified.php3 index 93ad06be2dc95a39946c225e0ad70363ec359c1b..bca04f4b5e1fe9115a1711d5acff6f49ce9541ed 100644 --- a/www/verified.php3 +++ b/www/verified.php3 @@ -25,7 +25,7 @@ Please log in again.\n"; mysql_db_query("tbdb", $cmnd); exit; } else { - $timeout = time() + 600; + $timeout = time() + 86400; $cmnd = "UPDATE login SET timeout=\"$timeout\" where uid=\"$auth_usr\""; mysql_db_query("tbdb", $cmnd); } diff --git a/www/verify.php3 b/www/verify.php3 index b2c326704d3a40947ca92d9a0d64b46ad1817468..8ce3ce46de4b3f0c250d35ed390f3c30fee3bee5 100644 --- a/www/verify.php3 +++ b/www/verify.php3 @@ -26,7 +26,7 @@ Please log in again.\n"; mysql_db_query("tbdb", $cmnd); exit; } else { - $timeout = time() + 600; + $timeout = time() + 86400; $cmnd = "UPDATE login SET timeout=\"$timeout\" where uid=\"$auth_usr\""; mysql_db_query("tbdb", $cmnd); } diff --git a/www/view1.jpg b/www/view1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d2724d7617b80f163bab53c5701a94957d71d14d Binary files /dev/null and b/www/view1.jpg differ diff --git a/www/welcome.html b/www/welcome.html index 2cff55f6c1447fca131a4282d008e570b2c6b29c..f80c59c3f51eb0080985435fdffe7d27f4602f25 100644 --- a/www/welcome.html +++ b/www/welcome.html @@ -5,11 +5,7 @@ -

    Utah Network Testbed

    - -

    Welcome to the Utah Network Testbed. Yadda yadda, ...

    - - SEE ALSO faq.html... +

    Welcome to Testbed Control

    What is the Testbed?

    Username:
    Password: