$text\n"; } # same as above with "new" gif next to it. function WRITESIDEBARBUTTON_NEW($text, $base, $link ) { $link = "$base/$link"; echo "$text "; echo "\n"; } # same as above with "cool" gif next to it. function WRITESIDEBARBUTTON_COOL($text, $base, $link ) { $link = "$base/$link"; echo "$text "; echo "\n"; } function WRITESIDEBARBUTTON_ABS($text, $base, $link ) { $link = "$link"; echo "$text\n"; } # same as above, but uses a slightly different style sheet so there # is more padding below the last button. # The devil is, indeed, in the details. function WRITESIDEBARLASTBUTTON($text, $base, $link) { $link = "$base/$link"; echo "$text\n"; } # writes a message to the sidebar, without clickability. function WRITESIDEBARNOTICE($text) { echo "$text\n"; } # # WRITESIDEBAR(): Write the menu. The actual menu options the user # sees depends on the login status and the DB status. # function WRITESIDEBAR() { global $login_status, $login_uid; global $TBBASE, $TBDOCBASE, $BASEPATH; global $THISHOMEBASE; # # The document base cannot be a mix of secure and nonsecure. # # create the main menu table, which also happens to reside in a form # (for search.) # # get post time of most recent news; # get both displayable version and age in days. # $query_result = DBQueryFatal("SELECT DATE_FORMAT(date, '%M %e') AS prettydate, ". " (TO_DAYS(NOW()) - TO_DAYS(date)) AS age ". "FROM webnews ". "ORDER BY date DESC ". "LIMIT 1"); $newsDate = ""; $newNews = 0; # # This is so an admin can use the editing features of news. # if ($login_uid) { # && ISADMIN($login_uid)) { $newsBase = $TBBASE; } else { $newsBase = $TBDOCBASE; } if ($row = mysql_fetch_array($query_result)) { $newsDate = "(".$row[prettydate].")"; if ($row[age] < 7) { $newNews = 1; } } ?>
". "Web Interface Temporarily Unavailable", $TBDOCBASE, "nologins.php3"); if (!$login_uid || !ISADMIN($login_uid)) { WRITESIDEBARNOTICE("Please Try Again Later"); } } if ($login_status & (CHECKLOGIN_LOGGEDIN|CHECKLOGIN_MAYBEVALID)) { if ($login_status & CHECKLOGIN_ACTIVE) { if ($login_status & CHECKLOGIN_PSWDEXPIRED) { WRITESIDEBARBUTTON("Change Your Password", $TBBASE, "moduserinfo.php3"); } elseif ($login_status & CHECKLOGIN_WEBONLY) { WRITESIDEBARBUTTON("My Emulab", $TBBASE, "showuser.php3?target_uid=$login_uid"); WRITESIDEBARBUTTON("Update User Information", $TBBASE, "moduserinfo.php3"); } else { WRITESIDEBARBUTTON("My Emulab", $TBBASE, "showuser.php3?target_uid=$login_uid"); if (ISADMIN($login_uid)) { WRITESIDEBARBUTTON("New Project Approval", $TBBASE, "approveproject_list.php3"); WRITESIDEBARBUTTON("Widearea User Approval", $TBBASE, "approvewauser_form.php3"); } if ($login_status & CHECKLOGIN_TRUSTED) { # Only project/group leaders can do these options # Show a "new" icon if there are people waiting for approval $query_result = DBQueryFatal("select g.* from group_membership as authed ". "left join group_membership as g on ". " g.pid=authed.pid and g.gid=authed.gid ". "left join users as u on u.uid=g.uid ". "where u.status!='". TBDB_USERSTATUS_UNVERIFIED . "' and ". " u.status!='" . TBDB_USERSTATUS_NEWUSER . "' and g.uid!='$login_uid' and ". " g.trust='". TBDB_TRUSTSTRING_NONE . "' ". " and authed.uid='$login_uid' and ". " (authed.trust='group_root' or ". " authed.trust='project_root') ". "ORDER BY g.uid,g.pid,g.gid"); if (mysql_num_rows($query_result) > 0) { WRITESIDEBARBUTTON_NEW("New User Approval", $TBBASE, "approveuser_form.php3"); } else { WRITESIDEBARBUTTON("New User Approval", $TBBASE, "approveuser_form.php3"); } } # # Since a user can be a member of more than one project, # display this option, and let the form decide if the # user is allowed to do this. # WRITESIDEBARBUTTON("Project List", $TBBASE, "showproject_list.php3"); if (ISADMIN($login_uid)) { WRITESIDEBARBUTTON("User List", $TBBASE, "showuser_list.php3"); } WRITESIDEBARBUTTON("Experiment List", $TBBASE, "showexp_list.php3"); WRITESIDEBARBUTTON("Begin an Experiment", $TBBASE, "beginexp.php3"); WRITESIDEBARBUTTON("ImageIDs and OSIDs", $TBBASE, "showimageid_list.php3"); WRITESIDEBARBUTTON("Update User Information", $TBBASE, "moduserinfo.php3"); WRITESIDEBARBUTTON("Node Reservation Status", $TBBASE, "nodecontrol_list.php3"); WRITESIDEBARBUTTON("Node Up/Down Status", $TBDOCBASE, "updown.php3"); if (ISADMIN($login_uid)) { WRITESIDEBARBUTTON("Edit Site Variables", $TBBASE, "editsitevars.php3"); } if ($login_status & CHECKLOGIN_CVSWEB) { WRITESIDEBARBUTTON("CVS Repository", $TBBASE, "cvsweb/cvsweb.php3"); } } } elseif ($login_status & (CHECKLOGIN_UNVERIFIED|CHECKLOGIN_NEWUSER)) { WRITESIDEBARBUTTON("New User Verification", $TBBASE, "verifyusr_form.php3"); WRITESIDEBARBUTTON("Update User Information", $TBBASE, "moduserinfo.php3"); } elseif ($login_status & (CHECKLOGIN_UNAPPROVED)) { WRITESIDEBARBUTTON("Update User Information", $TBBASE, "moduserinfo.php3"); } # # Standard options for logged in users! # WRITESIDEBARBUTTON("Start Project", $TBBASE, "newproject.php3"); WRITESIDEBARLASTBUTTON("Join Project", $TBBASE, "joinproject.php3"); } else { # # Standard options for anyone else not logged in. # if (! NOLOGINS()) { echo ""; } } # # Cons up a nice message. # switch ($login_status & CHECKLOGIN_STATUSMASK) { case CHECKLOGIN_LOGGEDIN: $login_message = ""$login_uid" Logged In."; if ($login_status & CHECKLOGIN_PSWDEXPIRED) $login_message = "$login_message
(Password Expired!)"; elseif ($login_status & CHECKLOGIN_UNAPPROVED) $login_message = "$login_message
(Unapproved!)"; break; case CHECKLOGIN_TIMEDOUT: $login_message = "Login Timed Out"; break; default: $login_message = 0; break; } if ($login_message) { echo ""; echo ""; echo ""; } # # Now the login/logout box. Remember, already inside a table. # We want the links to the login/logout pages to always be https, # but the images path depends on whether the page was loaded as # http or https, since we do not want to mix them, since they # cause warnings. # if ($login_status & (CHECKLOGIN_LOGGEDIN|CHECKLOGIN_MAYBEVALID)) { echo ""; echo "\n"; } elseif (!NOLOGINS()) { echo ""; echo "\n"; } # # Login message. Set via 'web/message' site variable # $message = TBGetSiteVar("web/message"); if (0 != strcmp($message,"")) { WRITESIDEBARNOTICE($message); } echo "\n"; } # # spits out beginning part of page # function PAGEBEGINNING( $title ) { global $BASEPATH, $TBMAINSITE, $THISHOMEBASE; ?> <?php echo "$THISHOMEBASE - $title"; ?> " TYPE="text/css" />
" bgcolor=#3D627F >" alt=" - the network testbed" />
\n"; echo ""; echo "\n"; echo "
\n"; if ($login_uid && ISADMININSTRATOR()) { if (ISADMIN($login_uid)) { echo " Admin On\n"; } else { echo " Admin Off\n"; } } $now = date("D M d g:ia T"); echo "$titleGenerated "; if ($login_uid) { echo "for $login_uid, "; } echo "$now."; echo "
"; echo "\n"; } # # ENDPAGE(): This terminates the table started above. # function ENDPAGE() { echo "
"; echo "
"; } # # Spit out a vanilla page footer. # function PAGEFOOTER() { global $TBDOCBASE, $TBMAILADDR, $THISHOMEBASE; global $TBMAINSITE, $SSL_PROTOCOL; # echo " # ?>
The Flux Research Group ] [ School of Computing ] [ The University of Utah ]
/docwrapper.php3?docname=copyright.html"> Copyright © 2000-2002 The University of Utah

Problems? Contact

\n";# if (! isset($SSL_PROTOCOL)) { echo " Add Me! \n"; } } echo "\n"; } function PAGEERROR($msg) { global $drewheader; if (! $drewheader) PAGEHEADER(""); echo "$msg\n"; PAGEFOOTER(); die(""); } # # Sub Page/Menu Stuff # function WRITESUBMENUBUTTON($text, $link) { echo " $text\n"; echo " \n"; } # # Start/End a page within a page. # function SUBPAGESTART() { echo ""; echo "\n \n \n \n
\n"; } function SUBPAGEEND() { echo "
\n"; echo ""; } # # Start/End a sub menu, located in the upper left of the main frame. # Note that these cannot be used outside of the SUBPAGE macros above. # function SUBMENUSTART($title) { ?>