menu.php3 18.9 KB
Newer Older
1
<?php
Leigh B. Stoller's avatar
Leigh B. Stoller committed
2 3
#
# EMULAB-COPYRIGHT
4
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
Leigh B. Stoller's avatar
Leigh B. Stoller committed
5 6
# All rights reserved.
#
7

8
$login_status     = CHECKLOGIN_NOTLOGGEDIN;
9
$login_uid        = 0;
10
$drewheader       = 0;
11

12 13 14 15 16 17
#
# This has to be set so we can spit out http or https paths properly!
# Thats because browsers do not like a mix of secure and nonsecure.
# 
$BASEPATH	  = "";

18 19 20 21 22
#
# WRITESIDEBARBUTTON(text, link): Write a button on the sidebar menu.
# We do not currently try to match the current selection so that its
# link looks different. Not sure its really necessary.
#
Chad Barb's avatar
 
Chad Barb committed
23
function WRITESIDEBARBUTTON($text, $base, $link ) {
24
    $link = "$base/$link";
Chad Barb's avatar
 
Chad Barb committed
25
    echo "<tr><td class=\"menuopt\"><a href=\"$link\">$text</a></td></tr>\n";
Chad Barb's avatar
 
Chad Barb committed
26
}
27

Chad Barb's avatar
 
Chad Barb committed
28 29 30
# same as above with "new" gif next to it.
function WRITESIDEBARBUTTON_NEW($text, $base, $link ) {
    $link = "$base/$link";
Chad Barb's avatar
 
Chad Barb committed
31 32
    echo "<tr><td class=\"menuopt\"><a href=\"$link\">$text</a>&nbsp;";
    echo "<img src=\"/new.gif\" /></td></tr>\n";
Chad Barb's avatar
 
Chad Barb committed
33 34
}

Chad Barb's avatar
 
Chad Barb committed
35 36 37 38 39 40 41
# same as above with "cool" gif next to it.
function WRITESIDEBARBUTTON_COOL($text, $base, $link ) {
    $link = "$base/$link";
    echo "<tr><td class=\"menuopt\"><a href=\"$link\">$text</a>&nbsp;";
    echo "<img src=\"/cool.gif\" /></td></tr>\n";
}

Leigh B. Stoller's avatar
Leigh B. Stoller committed
42 43
function WRITESIDEBARBUTTON_ABS($text, $base, $link ) {
    $link = "$link";
Chad Barb's avatar
 
Chad Barb committed
44
    echo "<tr><td class=\"menuopt\"><a href=\"$link\">$text</a></td></tr>\n";
Leigh B. Stoller's avatar
Leigh B. Stoller committed
45 46
}

Chad Barb's avatar
 
Chad Barb committed
47 48 49 50 51
# 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";
Chad Barb's avatar
 
Chad Barb committed
52
    echo "<tr><td class=\"menuoptb\"><a href=\"$link\">$text</a></td></tr>\n";
Chad Barb's avatar
 
Chad Barb committed
53 54 55 56
}

# writes a message to the sidebar, without clickability.
function WRITESIDEBARNOTICE($text) {
Chad Barb's avatar
 
Chad Barb committed
57
    echo "<tr><td class=\"menuopt\"><b>$text</b></td></tr>\n";
58 59 60 61 62 63 64
}

#
# WRITESIDEBAR(): Write the menu. The actual menu options the user
# sees depends on the login status and the DB status.
#
function WRITESIDEBAR() {
65 66
    global $login_status, $login_uid;
    global $TBBASE, $TBDOCBASE, $BASEPATH;
67
    global $THISHOMEBASE;
68 69 70

    #
    # The document base cannot be a mix of secure and nonsecure.
71
    #
Chad Barb's avatar
 
Chad Barb committed
72 73 74
    
    # create the main menu table, which also happens to reside in a form
    # (for search.)
Chad Barb's avatar
 
Chad Barb committed
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104

    #
    # get post time of most recent news;
    # get both displayable version and age in days.
    #
    $query_result = 
	DBQueryFatal("SELECT DATE_FORMAT(date, '%M&nbsp;%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;
	}
    }

Chad Barb's avatar
 
Chad Barb committed
105 106 107 108 109
?>
<FORM method=get ACTION="/cgi-bin/webglimpse/usr/testbed/webglimpse">
  <table class="menu" width=220 cellpadding="0" cellspacing="0">
    <tr><td class="menuheader"><b>Information</b></td></tr>
<?php
110
    WRITESIDEBARBUTTON("Home", $TBDOCBASE, "index.php3");
111
    WRITESIDEBARBUTTON_ABS("Univ. Kentucky Emulab", $TBDOCBASE,
Leigh B. Stoller's avatar
Leigh B. Stoller committed
112 113
			   "http://www.uky.emulab.net");
    
Chad Barb's avatar
 
Chad Barb committed
114
    WRITESIDEBARBUTTON_COOL("Join Netbed (CD)",
115
			   $TBDOCBASE, "cdrom.php");
Chad Barb's avatar
 
Chad Barb committed
116

Chad Barb's avatar
 
Chad Barb committed
117 118 119 120 121 122
    if ($newNews) {
	WRITESIDEBARBUTTON_NEW("News $newsDate", $newsBase, "news.php3");
    } else {
	WRITESIDEBARBUTTON("News $newsDate", $newsBase, "news.php3");
    }

123
    WRITESIDEBARBUTTON("Documentation", $TBDOCBASE, "doc.php3");
Chad Barb's avatar
 
Chad Barb committed
124 125
    WRITESIDEBARBUTTON("Papers", $TBDOCBASE, "pubs.php3");
    WRITESIDEBARBUTTON("Software", $TBDOCBASE, "software.php3");
126
    WRITESIDEBARBUTTON("People", $TBDOCBASE, "people.php3");
127
    WRITESIDEBARBUTTON("Photo Gallery", $TBDOCBASE, "gallery/gallery.php3");
Chad Barb's avatar
 
Chad Barb committed
128
    WRITESIDEBARBUTTON("Projects on Emulab", $TBDOCBASE,
129
		       "projectlist.php3");
Chad Barb's avatar
 
Chad Barb committed
130
    WRITESIDEBARLASTBUTTON("Sponsors", $TBDOCBASE,
Mike Hibler's avatar
Mike Hibler committed
131
		       "docwrapper.php3?docname=sponsors.html");
132

Chad Barb's avatar
 
Chad Barb committed
133 134 135 136 137 138
    # create the search bit, then the second table for the Web Interface.
?>
    <tr><td class="menuoptst"><b>Search Documentation:</b></td></tr>
    <tr><td class="menuopts"><input name=query />
      <input type=submit style="font-size:10px;" value="Go" /></td></tr>
      <tr><td class="menuoptsb" style="font-size:12px;" >[
Chad Barb's avatar
 
Chad Barb committed
139 140
      <a href="<?php echo "$TBDOCBASE/search.php3"; ?>">Advanced 
      Search</a> ]</td></tr>
Chad Barb's avatar
 
Chad Barb committed
141 142 143 144 145
    </td></tr>  
  </table>
</form>
<table class="menu" width=220 cellpadding="0" cellspacing="0">
    <tr><td class="menuheader"><b>Interaction</b></td></tr>
Chad Barb's avatar
 
Chad Barb committed
146
<?php # BACK TO PHP
147

148
    if ($login_status & CHECKLOGIN_LOGGEDIN) {
Chad Barb's avatar
 
Chad Barb committed
149 150
         $freepcs = TBFreePCs();
	 WRITESIDEBARNOTICE( "($freepcs Free PCs.)" );
151
    }
152

153 154 155 156 157 158 159 160
    #
    # Basically, we want to let admin people continue to use
    # the web interface even when nologins set. But, we want to make
    # it clear its disabled.
    # 
    if (NOLOGINS()) {
        WRITESIDEBARBUTTON("<font color=red> ".
			   "Web Interface Temporarily Unavailable</font>",
161 162
			   $TBDOCBASE, "nologins.php3");

Chad Barb's avatar
 
Chad Barb committed
163 164 165
        if (!$login_uid || !ISADMIN($login_uid)) {	
	    WRITESIDEBARNOTICE("Please Try Again Later");
        }
166
    }
Chad Barb's avatar
 
Chad Barb committed
167

168 169 170
    if ($login_status & (CHECKLOGIN_LOGGEDIN|CHECKLOGIN_MAYBEVALID)) {
	if ($login_status & CHECKLOGIN_ACTIVE) {
	    if ($login_status & CHECKLOGIN_PSWDEXPIRED) {
171
		WRITESIDEBARBUTTON("Change Your Password",
172
				   $TBBASE, "moduserinfo.php3");
173
	    }
174 175 176 177 178 179 180 181
	    elseif ($login_status & CHECKLOGIN_WEBONLY) {
		WRITESIDEBARBUTTON("My Emulab",
				   $TBBASE,
				   "showuser.php3?target_uid=$login_uid");
	    
		WRITESIDEBARBUTTON("Update User Information",
				   $TBBASE, "moduserinfo.php3");
	    }
182
	    else {
Leigh B. Stoller's avatar
Leigh B. Stoller committed
183
		WRITESIDEBARBUTTON("My Emulab",
184 185
				   $TBBASE,
				   "showuser.php3?target_uid=$login_uid");
186
	    
187
		if (ISADMIN($login_uid)) {
188 189
		    WRITESIDEBARBUTTON("New Project Approval",
				       $TBBASE, "approveproject_list.php3");
190 191 192

		    WRITESIDEBARBUTTON("Widearea User Approval",
				       $TBBASE, "approvewauser_form.php3");
193 194
		}
		if ($login_status & CHECKLOGIN_TRUSTED) {
195 196 197
                  # Only project/group leaders can do these options
                  # Show a "new" icon if there are people waiting for approval
		  $query_result =
198 199 200
		    DBQueryFatal("select g.* from group_membership as authed ".
				 "left join group_membership as g on ".
				 " g.pid=authed.pid and g.gid=authed.gid ".
201
				 "left join users as u on u.uid=g.uid ".
202
				 "where u.status!='".
203
				 TBDB_USERSTATUS_UNVERIFIED . "' and ".
204 205 206 207 208 209
				 " 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') ".
210 211 212 213 214
				 "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 {
215 216

		      WRITESIDEBARBUTTON("New User Approval",
217
				       $TBBASE, "approveuser_form.php3");
218
		  }
219
		}
220

221 222
                #
                # Since a user can be a member of more than one project,
223 224
                # display this option, and let the form decide if the 
                # user is allowed to do this.
225
                #
Leigh B. Stoller's avatar
Leigh B. Stoller committed
226
		WRITESIDEBARBUTTON("Project List",
227
				   $TBBASE, "showproject_list.php3");
228
	    
229
		if (ISADMIN($login_uid)) {
230 231 232 233
		    WRITESIDEBARBUTTON("User List",
				       $TBBASE, "showuser_list.php3");
		}
	    
Leigh B. Stoller's avatar
Leigh B. Stoller committed
234 235
		WRITESIDEBARBUTTON("Experiment List",
				   $TBBASE, "showexp_list.php3");
236 237
		WRITESIDEBARBUTTON("Begin an Experiment",
				   $TBBASE, "beginexp.php3");
238 239
		WRITESIDEBARBUTTON("ImageIDs and OSIDs",
				   $TBBASE, "showimageid_list.php3");
240
		WRITESIDEBARBUTTON("Update User Information",
241 242
				   $TBBASE, "moduserinfo.php3");
		WRITESIDEBARBUTTON("Node Reservation Status",
243
				   $TBBASE, "nodecontrol_list.php3");
244 245
		WRITESIDEBARBUTTON("Node Up/Down Status",
				   $TBDOCBASE, "updown.php3");
Chad Barb's avatar
 
Chad Barb committed
246 247 248 249 250

		if (ISADMIN($login_uid)) {
		    WRITESIDEBARBUTTON("Edit Site Variables",
				       $TBBASE, "editsitevars.php3");
		}
251 252 253 254 255
		
		if ($login_status & CHECKLOGIN_CVSWEB) {
		    WRITESIDEBARBUTTON("CVS Repository",
				       $TBBASE, "cvsweb/cvsweb.php3");
		}
256
	    }
257
	}
258
	elseif ($login_status & (CHECKLOGIN_UNVERIFIED|CHECKLOGIN_NEWUSER)) {
259 260
	    WRITESIDEBARBUTTON("New User Verification",
			       $TBBASE, "verifyusr_form.php3");
261
	    WRITESIDEBARBUTTON("Update User Information",
262
			       $TBBASE, "moduserinfo.php3");
263
	}
264
	elseif ($login_status & (CHECKLOGIN_UNAPPROVED)) {
265
	    WRITESIDEBARBUTTON("Update User Information",
266
			       $TBBASE, "moduserinfo.php3");
267
	}
268 269 270
	#
	# Standard options for logged in users!
	# 
271
	WRITESIDEBARBUTTON("Start Project", $TBBASE, "newproject.php3");
Chad Barb's avatar
 
Chad Barb committed
272
	WRITESIDEBARLASTBUTTON("Join Project",  $TBBASE, "joinproject.php3");
273
    }
274 275 276 277 278
    else {
        #
        # Standard options for anyone else not logged in.
        #
        if (! NOLOGINS()) {
Chad Barb's avatar
 
Chad Barb committed
279 280 281 282 283
	    echo "<tr><td class='menuopt'>".
	         "<center><a href='$TBBASE/reqaccount.php3'>".
	         "<img border=0 src='requestaccount.gif' ".
		 " alt='Request Account' />".
	         "</a></center></td></tr>";
284 285
	}
    }
286

287 288 289 290 291
    #
    # Cons up a nice message.
    # 
    switch ($login_status & CHECKLOGIN_STATUSMASK) {
    case CHECKLOGIN_LOGGEDIN:
Chad Barb's avatar
 
Chad Barb committed
292
	$login_message = "&quot;$login_uid&quot; Logged In.";
293 294
	    
	if ($login_status & CHECKLOGIN_PSWDEXPIRED)
295
	    $login_message = "$login_message<br>(Password Expired!)";
296 297
	elseif ($login_status & CHECKLOGIN_UNAPPROVED)
	    $login_message = "$login_message<br>(Unapproved!)";
298
	break;
299
    case CHECKLOGIN_TIMEDOUT:
300 301
	$login_message = "Login Timed Out";
	break;
302 303
    default:
	$login_message = 0;
304
	break;
305 306
    }

Chad Barb's avatar
 
Chad Barb committed
307
    if ($login_message) {
Chad Barb's avatar
 
Chad Barb committed
308 309 310 311
      echo "<tr>";
      echo "<td class=\"menufooter\"><center><b>";
      echo "$login_message</b></center></td>";
      echo "</tr>";
Chad Barb's avatar
 
Chad Barb committed
312 313
    }

314 315
    #
    # Now the login/logout box. Remember, already inside a table.
316 317
    # 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
318
    # http or https, since we do not want to mix them, since they
319
    # cause warnings.
320
    # 
321
    if ($login_status & (CHECKLOGIN_LOGGEDIN|CHECKLOGIN_MAYBEVALID)) {
Chad Barb's avatar
 
Chad Barb committed
322 323 324 325 326 327
      echo "<tr>";
      echo "<td class=\"menufooter\" align=center valign=center>";
      echo "<a href=\"$TBBASE/logout.php3?uid=$login_uid\">";
      echo "<img alt=\"logoff\" border=0 ";
      echo "src=\"$BASEPATH/logoff.gif\"></a>\n";
      echo "</td></tr>\n";
328
    }
329
    elseif (!NOLOGINS()) {
Chad Barb's avatar
 
Chad Barb committed
330 331 332 333 334 335
      echo "<tr>";
      echo "<td class=\"menufooter\" align=center valign=center>";
      echo "<a href=\"$TBBASE/login.php3\">";
      echo "<img alt=\"logon\" border=0 ";
      echo "src=\"$BASEPATH/logon.gif\"></a>\n";
      echo "</td></tr>\n";
336
    }
337

338
    #
Chad Barb's avatar
 
Chad Barb committed
339
    # Login message. Set via 'web/message' site variable
340
    #
Chad Barb's avatar
 
Chad Barb committed
341 342 343
    $message = TBGetSiteVar("web/message");
    if (0 != strcmp($message,"")) {
	WRITESIDEBARNOTICE($message);    	
344
    }
Chad Barb's avatar
 
Chad Barb committed
345

Chad Barb's avatar
 
Chad Barb committed
346
    echo "</table>\n";
347 348
}

Chad Barb's avatar
 
Chad Barb committed
349 350 351 352
#
# spits out beginning part of page
#
function PAGEBEGINNING( $title ) {
Chad Barb's avatar
 
Chad Barb committed
353
    global $BASEPATH, $TBMAINSITE, $THISHOMEBASE;
Chad Barb's avatar
 
Chad Barb committed
354 355 356 357 358
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
 "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
Chad Barb's avatar
 
Chad Barb committed
359
    <title><?php echo "$THISHOMEBASE - $title"; ?></title>
Chad Barb's avatar
 
Chad Barb committed
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378
    <!-- dumbed-down style sheet for any browser that groks (eg NS47). -->
    <link REL="stylesheet" HREF="<?php echo "$BASEPATH/common-style.css" ?>" 
          TYPE="text/css" />
    <!-- don't import full style sheet into NS47, since it does a bad job
         of handling it. NS47 doesn't understand '@import'. -->
    <style type="text/css" media="all">
    <!-- @import "<?php echo "$BASEPATH/style.css" ?>"; --></style>
<?php if ($TBMAINSITE) { ?>
    <meta NAME="keywords" CONTENT="network, emulation, internet, emulator">
    <meta NAME="ROBOTS" CONTENT="NOARCHIVE">
<?php } ?>
  </head>
  <body bgcolor="#FFFFFF" topmargin=0 leftmargin=0 
        marginheight=0 marginwidth=0>
    <table cellpadding="0" cellspacing="0" width="100%">
      <tr>
        <td valign="top" class="bannercell" 
            background="<?php echo "$BASEPATH/headerbgbb.jpg" ?>"
            bgcolor=#3D627F ><img width=369 height=100 
Chad Barb's avatar
 
Chad Barb committed
379 380 381
            src="<?php echo "$BASEPATH/overlay." . strtolower($THISHOMEBASE) 
                                                 . ".gif" ?>" 
            alt="<?php echo "$THISHOMEBASE" ?> - the network testbed" /></td>
Chad Barb's avatar
 
Chad Barb committed
382
      </tr>
383 384
    </table>
    <table cellpadding="8" cellspacing="0" height="100%" width="100%">
Chad Barb's avatar
 
Chad Barb committed
385 386 387 388 389 390 391 392 393 394 395 396 397 398
      <tr height=100%>
        <td valign="top" class="leftcell" bgcolor=#ccddee>
<!-- sidebar begins -->
<?php
}

#
# finishes sidebar td
#
function FINISHSIDEBAR()
{
?>
<!-- sidebar ends -->
        </td>
399 400 401
        <td valign="top" width="100%" class="rightcell">
          <!-- content body table -->
          <table class="content" width="100%" cellpadding="0" cellspacing="0">
Chad Barb's avatar
 
Chad Barb committed
402
            <tr>
403
              <td class="contentheader">
Chad Barb's avatar
 
Chad Barb committed
404 405 406
<?php
}

407 408 409 410
#
# Spit out a vanilla page header.
#
function PAGEHEADER($title) {
411 412
    global $login_status, $login_uid, $TBBASE, $TBDOCBASE, $THISHOMEBASE;
    global $BASEPATH, $SSL_PROTOCOL, $drewheader;
413
    global $TBMAINSITE;
414 415

    $drewheader = 1;
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431

    #
    # Determine the proper basepath, which depends on whether the page
    # was loaded as http or https. This lets us be consistent in the URLs
    # we spit back, so that users do not get those pesky warnings. These
    # warnings are generated when a page *loads* (say, images, style files),
    # a mix of http and https. Links can be mixed, and in fact when there
    # is no login active, we want to spit back http for the documentation,
    # but https for the start/join pages.
    #
    if (isset($SSL_PROTOCOL)) {
	$BASEPATH = $TBBASE;
    }
    else {
	$BASEPATH = $TBDOCBASE;
    }
432

433
    #
434
    # Figure out who is logged in, if anyone.
435
    # 
436 437 438 439
    if (($known_uid = GETUID()) != FALSE) {
        #
        # Check to make sure the UID is logged in (not timed out).
        #
440 441 442
        $login_status = CHECKLOGIN($known_uid);
	if ($login_status & (CHECKLOGIN_LOGGEDIN|CHECKLOGIN_MAYBEVALID)) {
	    $login_uid = $known_uid;
443 444 445
	}
    }

446
    #
447 448
    # Check for NOLOGINS. 
    # We want to allow admin types to continue using the web interface,
449 450
    # and logout anyone else that is currently logged in!
    #
451 452 453 454
    if (NOLOGINS() && $login_uid && !ISADMIN($login_uid)) {
	DOLOGOUT($login_uid);
	$login_status = CHECKLOGIN_NOTLOGGEDIN;
	$login_uid    = 0;
455
    }
456
    
457 458
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    
459
    if (1) {
460 461 462 463 464 465 466
	header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
	header("Cache-Control: no-cache, must-revalidate");
	header("Pragma: no-cache");
    }
    else {
	header("Expires: " . gmdate("D, d M Y H:i:s", time() + 300) . " GMT"); 
    }
Chad Barb's avatar
 
Chad Barb committed
467 468 469 470

    PAGEBEGINNING( $title );
    WRITESIDEBAR();
    FINISHSIDEBAR();
471
    echo "<h2 class=\"nomargin\">\n";
Chad Barb's avatar
 
Chad Barb committed
472

473
    if ($login_uid && ISADMINISTRATOR()) {
Chad Barb's avatar
 
Chad Barb committed
474 475 476 477 478 479 480 481 482 483
	if (ISADMIN($login_uid)) {
	    echo "<a href=adminmode.php3?target_uid=$login_uid&adminoff=1>
	             <img src='/redball.gif'
                          border=0 alt='Admin On'></a>\n";
	}
	else {
	    echo "<a href=adminmode.php3?target_uid=$login_uid&adminoff=0>
	             <img src='/greenball.gif'
                          border=0 alt='Admin Off'></a>\n";
	}
484
    }
485 486
    $now = date("D M d g:ia T");
    echo "$title</h2></td>\n";
487
    echo "<td class=contentheader align=right>\n";
Chad Barb's avatar
 
Chad Barb committed
488
    if ($login_uid) {
489 490 491 492
	echo "<font size=-1><b>$login_uid</b> logged in<br>$now</font>\n";
    }
    else {
	echo "$now";
Chad Barb's avatar
 
Chad Barb committed
493 494 495 496
    }
    echo "</td>";
    echo "</tr>\n";
    echo "<tr><td colspan=3 class=\"contentbody\" width=*>";
Chad Barb's avatar
 
Chad Barb committed
497
    echo "<!-- begin content -->\n";
498 499 500 501 502 503
}

#
# ENDPAGE(): This terminates the table started above.
# 
function ENDPAGE() {
Chad Barb's avatar
 
Chad Barb committed
504 505
  echo "</td></tr></table>";
  echo "</td></tr></table>";
506 507 508 509 510 511
}

#
# Spit out a vanilla page footer.
#
function PAGEFOOTER() {
512
    global $TBDOCBASE, $TBMAILADDR, $THISHOMEBASE;
Leigh B. Stoller's avatar
Leigh B. Stoller committed
513
    global $TBMAINSITE, $SSL_PROTOCOL;
514

Chad Barb's avatar
 
Chad Barb committed
515 516 517 518 519 520 521
#    echo "<!-- Force full window! -->
#	  <base target=_top>

?>
<!-- end content -->
              </td>
            </tr><tr>
522
              <td colspan=2 class="contentbody">
523
	        <center><font size=-1>
524
		[&nbsp;<a href="http://www.cs.utah.edu/flux/"
525 526
                >The&nbsp;Flux&nbsp;Research&nbsp;Group</a>&nbsp;]
		[&nbsp;<a href="http://www.cs.utah.edu/"
527
                >School&nbsp;of&nbsp;Computing</a>&nbsp;]
528
		[&nbsp;<a href="http://www.utah.edu/"
529 530 531
                >The&nbsp;University&nbsp;of&nbsp;Utah</a>&nbsp;]
		</font>
		<br>
Chad Barb's avatar
 
Chad Barb committed
532
                <!-- begin copyright -->
533
                <font size=-2>
Chad Barb's avatar
 
Chad Barb committed
534
<a href="<?php echo "$TBDOCBASE"; ?>/docwrapper.php3?docname=copyright.html">
535
                    Copyright &copy; 2000-2002 The University of Utah</a>
Chad Barb's avatar
 
Chad Barb committed
536 537
                  </font>
                  <br />
538 539
		</center>
                <p align=right>
Chad Barb's avatar
 
Chad Barb committed
540 541 542 543 544 545 546 547 548
		  <font size=-2>
                    Problems?
	            Contact <?php echo "$TBMAILADDR\n"; ?>
                  </font>
                </p>
                <!-- end copyright -->
<?php

    ENDPAGE();
549 550 551

    if ($TBMAINSITE) {
	echo "<p>
Chad Barb's avatar
 
Chad Barb committed
552
              <a href=\"$TBDOCBASE/netemu.php3\"></a>\n";#
Leigh B. Stoller's avatar
Leigh B. Stoller committed
553 554 555 556 557 558 559 560

	if (! isset($SSL_PROTOCOL)) {
	    echo "<a href=http://www.addme.com>
	             <img width=8 height=2
	                 src='http://www.addme.com/link8.gif'
   	                 alt='Add Me!' border=0>
	          </a>\n";
	}
561
    }
Chad Barb's avatar
 
Chad Barb committed
562
    echo "</body></html>\n";
563
}
564 565 566 567 568 569 570 571 572 573 574 575

function PAGEERROR($msg) {
    global $drewheader;

    if (! $drewheader)
	PAGEHEADER("");

    echo "$msg\n";

    PAGEFOOTER();
    die("");
}
576 577 578 579 580

#
# Sub Page/Menu Stuff
#
function WRITESUBMENUBUTTON($text, $link) {
Chad Barb's avatar
 
Chad Barb committed
581 582


583 584 585 586 587 588 589 590 591 592 593 594 595 596 597
    echo "<!-- Table row for button $text -->
          <tr>
            <td valign=center align=left nowrap>
                <b>
         	 <a class=sidebarbutton href='$link'>$text</a>\n";

    echo "      </b>
            </td>
          </tr>\n";
}

#
# Start/End a page within a page. 
#
function SUBPAGESTART() {
Chad Barb's avatar
 
Chad Barb committed
598
    echo "<!-- begin subpage -->";
Chad Barb's avatar
 
Chad Barb committed
599 600
    echo "<table class=\"stealth\" cellspacing=0 cellpadding=0 width='85%' 
          border=0>\n
601
            <tr>\n
Chad Barb's avatar
 
Chad Barb committed
602
              <td class=\"stealth\"valign=top>\n";
603 604 605 606 607 608
}

function SUBPAGEEND() {
    echo "    </td>\n
            </tr>\n
          </table>\n";
Chad Barb's avatar
 
Chad Barb committed
609
    echo "<!-- end subpage -->";
610 611 612 613 614 615 616
}

#
# 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) {
Chad Barb's avatar
 
Chad Barb committed
617 618 619 620 621 622 623
?>
    <!-- begin submenu -->
    <table class="menu" width=200 cellpadding="0" cellspacing="0">
      <tr>
        <td class="menuheader"><b><?php echo "$title";?></b></td>
      </tr>
<?php
624 625 626
}

function SUBMENUEND() {
Chad Barb's avatar
 
Chad Barb committed
627 628 629 630 631 632
?>
    </table>
    <!-- end submenu -->
  </td>
  <td class="stealth" valign=top align=left width='85%'>
<?php
633 634
}

Chad Barb's avatar
 
Chad Barb committed
635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651

# These are here so you can wedge something else under the menu in the left column.

function SUBMENUEND_2A() {
?>
    </table>
    <!-- end submenu -->
<?php
}

function SUBMENUEND_2B() {
?>
  </td>
  <td class="stealth" valign=top align=left width='85%'>
<?php
}

652
?>