menu.php3 29.3 KB
Newer Older
1
<?php
Leigh B. Stoller's avatar
Leigh B. Stoller committed
2
3
#
# EMULAB-COPYRIGHT
4
# Copyright (c) 2000-2006 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
$noheaders	  = 0;
12
$autorefresh      = 0;
13

14
15
16
17
18
19
#
# 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	  = "";

Timothy Stack's avatar
   
Timothy Stack committed
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#
# 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;
}

# Blank space dividers in the menus are handled by adding a class to the menu
# item that starts a new group.
$nextsidebarcl    = "";
$nextsubmenucl    = "";

41
#
42
43
# TOPBARCELL - Make a cell for the topbar. Actually, the name lies, it can be
# used for cells in a bottombar too.
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#
function TOPBARCELL($contents) {
    echo "<td class=\"topbaropt\">";
    echo "<span class=\"topbaroption\">&nbsp;";
    echo $contents;
    echo "&nbsp;</span>";
    echo "</td>";
    echo "\n";
}

#
# WRITETOPBARBUTTON(text, base, link): Write a button in the topbar
#
function WRITETOPBARBUTTON($text, $base, $link ) {
    $link = "$base/$link";
    TOPBARCELL("<a href=\"$link\">$text</a>");
}
# same as above with "new" gif next to it.
function WRITETOPBARBUTTON_NEW($text, $base, $link ) {
    $link = "$base/$link";
    TOPBARCELL("<a href=\"$link\">$text</a>&nbsp;<img src=\"/new.gif\" />");
}

67
68
69
70
#
# WRITESIDEBARDIVIDER(): Put a bit of whitespace in the sidebar
#
function WRITESIDEBARDIVIDER() {
Timothy Stack's avatar
   
Timothy Stack committed
71
72
73
    global $nextsidebarcl;
    
    $nextsidebarcl = "newgroup";
74
75
}

76
77
78
79
80
#
# 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.
#
Timothy Stack's avatar
   
Timothy Stack committed
81
82
83
function WRITESIDEBARBUTTON($text, $base, $link, $extratext="") {
    global $nextsidebarcl;
    
84
85
    if ($base)
	$link = "$base/$link";
Timothy Stack's avatar
   
Timothy Stack committed
86
87
88
89
90
91
    $cl = "";
    if ($nextsidebarcl != "") {
	$cl = "class='$nextsidebarcl'";
	$nextsidebarcl = "";
    }
    echo "<li $cl><a href=\"$link\">$text</a>$extratext</li>\n";
Chad Barb's avatar
   
Chad Barb committed
92
}
93

Chad Barb's avatar
   
Chad Barb committed
94
# same as above with "new" gif next to it.
Timothy Stack's avatar
   
Timothy Stack committed
95
96
97
98
99
function WRITESIDEBARBUTTON_NEW($text, $base, $link) {
    WRITESIDEBARBUTTON($text,
		       $base,
		       $link,
		       "&nbsp;<img src=\"/new.gif\" />");
Chad Barb's avatar
   
Chad Barb committed
100
101
}

Chad Barb's avatar
   
Chad Barb committed
102
103
104
# same as above with "cool" gif next to it.
function WRITESIDEBARBUTTON_COOL($text, $base, $link ) {
    $link = "$base/$link";
Timothy Stack's avatar
   
Timothy Stack committed
105
    echo "<li><a href=\"$link\">$text</a>&nbsp;<img src=\"/cool.gif\" /></li>\n";
Chad Barb's avatar
   
Chad Barb committed
106
107
}

Leigh B. Stoller's avatar
Leigh B. Stoller committed
108
109
function WRITESIDEBARBUTTON_ABS($text, $base, $link ) {
    $link = "$link";
Timothy Stack's avatar
   
Timothy Stack committed
110
    echo "<li><a href=\"$link\">$text</a></li>\n";
Leigh B. Stoller's avatar
Leigh B. Stoller committed
111
112
}

Chad Barb's avatar
   
Chad Barb committed
113
114
function WRITESIDEBARBUTTON_ABSCOOL($text, $base, $link ) {
    $link = "$link";
Timothy Stack's avatar
   
Timothy Stack committed
115
    echo "<li><a href=\"$link\">$text</a>&nbsp;<img src=\"/cool.gif\" /></li>\n";
Chad Barb's avatar
Chad Barb committed
116
117
}

Chad Barb's avatar
   
Chad Barb committed
118
119
# writes a message to the sidebar, without clickability.
function WRITESIDEBARNOTICE($text) {
Timothy Stack's avatar
   
Timothy Stack committed
120
    echo "<span class='notice'>$text</span>\n";
121
122
123
124
125
126
127
128
129
130
131
132
133
}

#
# Something like the sidebar, but across the top, with only a few options.
# Think Google. For PlanetLab users, but it would be easy enough to make
# others. Still a work in progress.
#
function WRITEPLABTOPBAR() {
    echo "<table class=\"topbar\" width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" align=\"center\">\n";
    global $login_status, $login_uid;
    global $TBBASE, $TBDOCBASE, $BASEPATH;
    global $THISHOMEBASE;

134
135
    WRITETOPBARBUTTON("Create a Slice",
        $TBBASE, "plab_ez.php3");
136

137
    WRITETOPBARBUTTON("Nodes",
138
139
140
141
142
143
144
145
        $TBBASE, "plabmetrics.php3");

    WRITETOPBARBUTTON("My Testbed",
	$TBBASE,
	"showuser.php3?target_uid=$login_uid");


    WRITETOPBARBUTTON("Advanced Experiment",
146
        $TBBASE, "beginexp_html.php3");
147

148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
    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) {
	     WRITETOPBARBUTTON_NEW("Approve Users",
				   $TBBASE, "approveuser_form.php3");
	} else {
	    WRITETOPBARBUTTON("Approve Users",
			       $TBBASE, "approveuser_form.php3");
	}
    }

    WRITETOPBARBUTTON("Log Out", $TBBASE, "logout.php3?next_page=" .
	urlencode($TBBASE . "/login_plab.php3"));

177
178
179
    echo "</table>\n";
    echo "<br>\n";

180
181
}

182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198

#
# Put a few things that PlanetLab users should see, but are non-essential,
# across the bottom of the page rather than the top
#
function WRITEPLABBOTTOMBAR() {
    global $login_status, $login_uid;
    global $TBBASE, $TBDOCBASE, $BASEPATH;
    global $THISHOMEBASE;

    if ($login_uid) {
	$newsBase = $TBBASE; 
    } else {
	$newsBase = $TBDOCBASE;
    }

    echo "
199
200
201
	   <center>
	   <br>
	   <font size=-1>
202
	   <form method=get action=$TBDOCBASE/search.php3>
203
204
205
206
	   [ <a href='$TBDOCBASE/doc.php3'>
		Documentation</a> : <input name=query size = 15/>
		  <input type=submit style='font-size:10px;' value='Search' /> ]
	   [ <a href='$newsBase/news.php3'>
207
		News</a> ]
208
209
210
211
	   </form>
	   </font>
	   <br>
	   </center>\n";
212
213
214

}

215
216
217
218
219
#
# WRITESIDEBAR(): Write the menu. The actual menu options the user
# sees depends on the login status and the DB status.
#
function WRITESIDEBAR() {
220
221
    global $login_status, $login_uid, $pid, $gid;
    global $TBBASE, $TBDOCBASE, $BASEPATH, $WIKISUPPORT, $MAILMANSUPPORT;
222
    global $BUGDBSUPPORT, $BUGDBURL, $CVSSUPPORT, $CHATSUPPORT;
223
    global $CHECKLOGIN_WIKINAME;
224
    global $THISHOMEBASE;
225
    $firstinitstate = TBGetFirstInitState();
226
227
228

    #
    # The document base cannot be a mix of secure and nonsecure.
229
    #
Chad Barb's avatar
   
Chad Barb committed
230
    
Timothy Stack's avatar
   
Timothy Stack committed
231
    # create the main menu list
Chad Barb's avatar
   
Chad Barb committed
232
233
234
235
236
237
238
239
240

    #
    # 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 ".
241
		     "WHERE archived=0 ".
Chad Barb's avatar
   
Chad Barb committed
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
		     "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
263
?>
264
  <script type='text/javascript' language='javascript' src='textbox.js'></script>
Timothy Stack's avatar
   
Timothy Stack committed
265
266
    <h3 class="menuheader">Information</h3>
  <ul class="menu">
Chad Barb's avatar
   
Chad Barb committed
267
<?php
Chad Barb's avatar
   
Chad Barb committed
268
269
270
271
272
273
    if (0 == strcasecmp($THISHOMEBASE, "emulab.net")) {
	$rootEmulab = 1;
    } else {
	$rootEmulab = 0;
    }

274
    WRITESIDEBARBUTTON("Home", $TBDOCBASE, "index.php3?stayhome=1");
275

Chad Barb's avatar
   
Chad Barb committed
276
277

    if ($rootEmulab) {
278
	WRITESIDEBARBUTTON("Other Emulabs", $TBDOCBASE,
Chad Barb's avatar
   
Chad Barb committed
279
280
281
282
283
284
			       "docwrapper.php3?docname=otheremulabs.html");
    } else {
	WRITESIDEBARBUTTON_ABS("Utah Emulab", $TBDOCBASE,
			       "http://www.emulab.net/");

    }
Chad Barb's avatar
   
Chad Barb committed
285

Chad Barb's avatar
   
Chad Barb committed
286
287
288
289
290
291
    if ($newNews) {
	WRITESIDEBARBUTTON_NEW("News $newsDate", $newsBase, "news.php3");
    } else {
	WRITESIDEBARBUTTON("News $newsDate", $newsBase, "news.php3");
    }

292
    WRITESIDEBARBUTTON("Documentation", $TBDOCBASE, "doc.php3");
Chad Barb's avatar
   
Chad Barb committed
293
294

    if ($rootEmulab) {
295
	# Leave _NEW here about 2 weeks
296
	WRITESIDEBARBUTTON_NEW("Papers and Talks (Feb 22)", $TBDOCBASE, "pubs.php3");
297
	WRITESIDEBARBUTTON("Software (Jul 18)",
298
			       $TBDOCBASE, "software.php3");
299
300
	#WRITESIDEBARBUTTON("Add Widearea Node (CD)",
	#		    $TBDOCBASE, "cdrom.php");
301

Timothy Stack's avatar
   
Timothy Stack committed
302
	echo "<li><a href=\"$TBDOCBASE/people.php3\">People</a> and " .
303
304
	     "<a href=\"$TBDOCBASE/gallery/gallery.php3\">Photos</a>" .
	     "&nbsp;<img src=\"/new.gif\" /></li>";
305

Timothy Stack's avatar
   
Timothy Stack committed
306
307
308
309
	echo "<li>Emulab <a href=\"$TBDOCBASE/doc/docwrapper.php3? " .
	     "docname=users.html\">Users</a> and " .
	     "<a href=\"$TBDOCBASE/docwrapper.php3? " .
	     "docname=sponsors.html\">Sponsors</a></li>";
Chad Barb's avatar
   
Chad Barb committed
310
    } else {
311
	# Link ALWAYS TO UTAH
312
313
	#WRITESIDEBARBUTTON_ABSCOOL("Add Widearea Node (CD)",
	#		       $TBDOCBASE, "http://www.emulab.net/cdrom.php");
Timothy Stack's avatar
   
Timothy Stack committed
314
315
	WRITESIDEBARBUTTON("Projects on Emulab", $TBDOCBASE,
		"projectlist.php3");
Chad Barb's avatar
   
Chad Barb committed
316
    }
Timothy Stack's avatar
   
Timothy Stack committed
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
    
    echo "</ul>\n";

    # The search box.  Placed in a table so the text input fills available
    # space.
    echo "<div id='searchrow'>
        <FORM method=get ACTION=$newsBase/search.php3>
        <table border=0 cellspacing=0 cellpadding=0><tr>
             <td width=100%><input class='textInputEmpty' name=query
                        value='Search String' id='searchbox'
                        onfocus='focus_text(this, \"Search String\")'
                        onblur='blur_text(this, \"Search String\")' /></td>
	     <td><input type=submit id='searchsub' value=Search /></td>
        </table>
        </form>
	</div>\n";
333
334
335
336
337
338
339

    #
    # Cons up a nice message.
    # 
    switch ($login_status & CHECKLOGIN_STATUSMASK) {
    case CHECKLOGIN_LOGGEDIN:
	if ($login_status & CHECKLOGIN_PSWDEXPIRED)
Timothy Stack's avatar
   
Timothy Stack committed
340
	    $login_message = "(Password Expired!)";
341
	elseif ($login_status & CHECKLOGIN_UNAPPROVED)
Timothy Stack's avatar
   
Timothy Stack committed
342
343
344
	    $login_message = "(Unapproved!)";
	else
	    $login_message = 0;
345
346
347
348
349
350
351
352
353
354
	break;
    case CHECKLOGIN_TIMEDOUT:
	$login_message = "Login Timed out.";
	break;
    default:
	$login_message = 0;
	break;
    }

    #
Timothy Stack's avatar
   
Timothy Stack committed
355
    # Now the login box.
356
    # We want the links to the login pages to always be https,
357
358
359
    # 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.
360
361
362
    #
    if (! ($login_status & (CHECKLOGIN_LOGGEDIN|CHECKLOGIN_MAYBEVALID)) &&
	!NOLOGINS()) {
Timothy Stack's avatar
   
Timothy Stack committed
363
364
365
366
367
	echo "<div id='loginbox'>";

	if ($login_message) {
	    echo "<strong>$login_message</strong>";
	}
368
369
370
371
372
373

	if (!$firstinitstate) {
	    echo "<a href=\"$TBBASE/reqaccount.php3\">";
	    echo "<img alt=\"Request Account\" border=0 ";
	    echo "src=\"$BASEPATH/requestaccount.gif\"></a>";

Timothy Stack's avatar
   
Timothy Stack committed
374
	    echo "<strong>or</strong>";
375
376
377
378
379
380
	}

	echo "<a href=\"$TBBASE/login.php3\">";
	echo "<img alt=\"logon\" border=0 ";
	echo "src=\"$BASEPATH/logon.gif\"></a>\n";

Timothy Stack's avatar
   
Timothy Stack committed
381
	echo "</div>";
382
383
384
385
386
387
388
    }

    #
    # Login message. Set via 'web/message' site variable
    #
    $message = TBGetSiteVar("web/message");
    if (0 != strcmp($message,"")) {
Timothy Stack's avatar
   
Timothy Stack committed
389
	WRITESIDEBARNOTICE($message);
390
391
    }

392
393
394
395
396
397
    #
    # 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()) {
Timothy Stack's avatar
   
Timothy Stack committed
398
399
	echo "<a id='webdisabled' href='$TBDOCBASE/nologins.php3'>".
	    "Web Interface Temporarily Unavailable</a>";
400

Chad Barb's avatar
   
Chad Barb committed
401
402
403
        if (!$login_uid || !ISADMIN($login_uid)) {	
	    WRITESIDEBARNOTICE("Please Try Again Later");
        }
Timothy Stack's avatar
   
Timothy Stack committed
404
405
406
407
408
409
    }

    # Start Interaction section if going to spit out interaction options.
    if ($login_status & (CHECKLOGIN_LOGGEDIN|CHECKLOGIN_MAYBEVALID)) {
	echo "<h3 class='menuheader'>Experimentation</h3>
              <ul class=menu>\n";
410
    }
Chad Barb's avatar
   
Chad Barb committed
411

412
    if ($login_status & (CHECKLOGIN_LOGGEDIN|CHECKLOGIN_MAYBEVALID)) {
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
	if ($firstinitstate != null) {    
	    if ($firstinitstate == "createproject") {
		WRITESIDEBARBUTTON("Create First Project",
				   $TBBASE, "newproject.php3");
	    }
	    elseif ($firstinitstate == "approveproject") {
		$firstinitpid = TBGetFirstInitPid();
		
		WRITESIDEBARBUTTON("Approve First Project",
				   $TBBASE,
				   "approveproject.php3?pid=$firstinitpid".
				   "&approval=approve");
	    }
	}
	elseif ($login_status & CHECKLOGIN_ACTIVE) {
428
	    if ($login_status & CHECKLOGIN_PSWDEXPIRED) {
429
		WRITESIDEBARBUTTON("Change Your Password",
430
				   $TBBASE, "moduserinfo.php3");
431
	    }
Leigh B. Stoller's avatar
Leigh B. Stoller committed
432
	    elseif ($login_status & (CHECKLOGIN_WEBONLY|CHECKLOGIN_WIKIONLY)) {
433
434
435
		WRITESIDEBARBUTTON("My Emulab",
				   $TBBASE,
				   "showuser.php3?target_uid=$login_uid");
436
437
438
439
440

		if ($WIKISUPPORT && $CHECKLOGIN_WIKINAME != "") {
		    $wikiname = $CHECKLOGIN_WIKINAME;
		
		    WRITESIDEBARBUTTON_ABSCOOL("My Wikis",
441
442
			       "gotowiki.php3?redurl=Main/$wikiname",
			       "gotowiki.php3?redurl=Main/$wikiname");
443
		}
444

445
446
447
		WRITESIDEBARBUTTON("Update User Information",
				   $TBBASE, "moduserinfo.php3");
	    }
448
	    else {
Leigh B. Stoller's avatar
Leigh B. Stoller committed
449
		WRITESIDEBARBUTTON("My Emulab",
450
451
				   $TBBASE,
				   "showuser.php3?target_uid=$login_uid");
452

453
		#
454
455
456
457
                # 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.
                #
458
459
 		WRITESIDEBARBUTTON("Begin an Experiment",
				   $TBBASE, "beginexp_html.php3");
460
	
461
462
		# Put _NEW back when Plab is working again.
		WRITESIDEBARBUTTON("Create a PlanetLab Slice",
463
464
465
466
467
468
				       $TBBASE, "plab_ez.php3");

		WRITESIDEBARBUTTON("Experiment List",
				   $TBBASE, "showexp_list.php3");

		WRITESIDEBARDIVIDER();
Timothy Stack's avatar
   
Timothy Stack committed
469
		
470
		WRITESIDEBARBUTTON("Node Status",
471
472
				   $TBBASE, "nodecontrol_list.php3");

Timothy Stack's avatar
   
Timothy Stack committed
473
		echo "<li>List <a " .
474
475
			"href=\"$TBBASE/showimageid_list.php3\">" .
	        	"ImageIDs</a> or <a " .
Timothy Stack's avatar
   
Timothy Stack committed
476
	                "href=\"$TBBASE/showosid_list.php3\">OSIDs</a></li>";
477

478
		if ($login_status & CHECKLOGIN_TRUSTED) {
479
		  WRITESIDEBARDIVIDER();
480
481
482
                  # Only project/group leaders can do these options
                  # Show a "new" icon if there are people waiting for approval
		  $query_result =
483
484
485
		    DBQueryFatal("select g.* from group_membership as authed ".
				 "left join group_membership as g on ".
				 " g.pid=authed.pid and g.gid=authed.gid ".
486
				 "left join users as u on u.uid=g.uid ".
487
				 "where u.status!='".
488
				 TBDB_USERSTATUS_UNVERIFIED . "' and ".
489
490
491
492
493
494
				 " 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') ".
495
496
497
498
499
				 "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 {
500
501

		      WRITESIDEBARBUTTON("New User Approval",
502
				       $TBBASE, "approveuser_form.php3");
503
		  }
504
		}
505
	    }
506
	}
507
	elseif ($login_status & (CHECKLOGIN_UNVERIFIED|CHECKLOGIN_NEWUSER)) {
508
509
	    WRITESIDEBARBUTTON("New User Verification",
			       $TBBASE, "verifyusr_form.php3");
510
	    WRITESIDEBARBUTTON("Update User Information",
511
			       $TBBASE, "moduserinfo.php3");
512
	}
513
	elseif ($login_status & (CHECKLOGIN_UNAPPROVED)) {
514
	    WRITESIDEBARBUTTON("Update User Information",
515
			       $TBBASE, "moduserinfo.php3");
516
	}
517
518
	#
	# Standard options for logged in users!
519
520
	#
	if (!$firstinitstate) {
Timothy Stack's avatar
   
Timothy Stack committed
521
522
	    echo "<li class='newgroup'><a href=\"$TBBASE/newproject.php3\">Start</a> or " .
		"<a href=\"$TBBASE/joinproject.php3\">Join</a> a Project</li>";
523
	}
524
    }
525
526
    #WRITESIDEBARLASTBUTTON_COOL("Take our Survey",
    #    $TBDOCBASE, "survey.php3");
527

528
    # Terminate Interaction menu.
529
    if ($login_status & (CHECKLOGIN_LOGGEDIN|CHECKLOGIN_MAYBEVALID)) {
530
        # Logout option. No longer take up space with an image.
Timothy Stack's avatar
   
Timothy Stack committed
531
532
	WRITESIDEBARBUTTON("<b>Logout</b>",
			   $TBBASE, "logout.php3?target_uid=$login_uid");
533
	
Timothy Stack's avatar
   
Timothy Stack committed
534
	echo "</ul>\n";
535
    }
Chad Barb's avatar
Chad Barb committed
536

537
    # And now the Collaboration menu.
Leigh B. Stoller's avatar
Leigh B. Stoller committed
538
539
540
    if (($login_status & (CHECKLOGIN_LOGGEDIN|CHECKLOGIN_MAYBEVALID)) &&
	($WIKISUPPORT || $MAILMANSUPPORT || $BUGDBSUPPORT ||
	 $CVSSUPPORT  || $CHATSUPPORT)) {
Timothy Stack's avatar
   
Timothy Stack committed
541
542
543
	echo "<h3 class='menuheader'>Collaboration</h3>
              <ul class=menu>";

544
545
546
547
548
	if ($WIKISUPPORT && $CHECKLOGIN_WIKINAME != "") {
	    $wikiname = $CHECKLOGIN_WIKINAME;
		
	    WRITESIDEBARBUTTON("My Wikis", $TBBASE,
			       "gotowiki.php3?redurl=Main/$wikiname");
549
	}
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
	if ($MAILMANSUPPORT || $BUGDBSUPPORT) {
	    if (!isset($pid) || $pid == "") {
		$query_result =
		    DBQueryFatal("select pid from group_membership where ".
				 "uid='$login_uid' and pid=gid and ".
				 "trust!='none' ".
				 "order by date_approved asc limit 1");
		if (mysql_num_rows($query_result)) {
		    $row = mysql_fetch_array($query_result);
		    $firstpid = $row[pid];
		}
	    }
	}
	if ($MAILMANSUPPORT) {
	    $mmurl  = "showmmlists.php3?target_uid=$login_uid";
	    WRITESIDEBARBUTTON("My Mailing Lists", $TBBASE, $mmurl);
	}
	if ($BUGDBSUPPORT) {
	    $bugdburl = "gotobugdb.php3";
		    
	    if (isset($pid) && !empty($pid)) {
		$bugdburl .= "?project_title=$pid";
	    }
	    elseif (isset($firstpid)) {
		$bugdburl .= "?project_title=$firstpid";
	    }
	    WRITESIDEBARBUTTON("My Bug Databases", $TBBASE, $bugdburl);
	}
	if ($CVSSUPPORT) {
579
580
	    WRITESIDEBARBUTTON("My CVS Repositories", $TBBASE,
			       "listrepos.php3?target_uid=$login_uid");
581
	}
582
583
	if ($CHATSUPPORT) {
	    WRITESIDEBARBUTTON("My Chat Buddies", $TBBASE,
584
585
			       "mychat.php3?target_uid=$login_uid");
	}
Timothy Stack's avatar
   
Timothy Stack committed
586
	echo "</ul>\n";
587
    }
588

589
590
    # Optional ADMIN menu.
    if ($login_status & CHECKLOGIN_LOGGEDIN && ISADMIN($login_uid)) {
Timothy Stack's avatar
   
Timothy Stack committed
591
592
	echo "<h3 class='menuheader'>Administration</h3>
              <ul class=menu>";
593
	
Timothy Stack's avatar
   
Timothy Stack committed
594
595
596
597
	echo "<li>List <a " .
	    " href=\"$TBBASE/showproject_list.php3\">" .
	    "Projects</a> or <a " .
	    "href=\"$TBBASE/showuser_list.php3\">Users</a></li>";
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621

	WRITESIDEBARBUTTON("View Testbed Stats",
			   $TBBASE, "showstats.php3");

	WRITESIDEBARBUTTON("Approve New Projects",
			   $TBBASE, "approveproject_list.php3");

	WRITESIDEBARBUTTON("Edit Site Variables",
			   $TBBASE, "editsitevars.php3");

	WRITESIDEBARBUTTON("Edit Knowledge Base",
			   $TBBASE, "kb-manage.php3");
		    
	$query_result = DBQUeryFatal("select new_node_id from new_nodes");
	if (mysql_num_rows($query_result) > 0) {
	    WRITESIDEBARBUTTON_NEW("Add Testbed Nodes",
				   $TBBASE, "newnodes_list.php3");
	}
	else {
	    WRITESIDEBARBUTTON("Add Testbed Nodes",
			       $TBBASE, "newnodes_list.php3");
	}
	WRITESIDEBARBUTTON("Approve Widearea User",
			   $TBBASE, "approvewauser_form.php3");
Chad Barb's avatar
   
Chad Barb committed
622

623
	# Link ALWAYS TO UTAH
Timothy Stack's avatar
   
Timothy Stack committed
624
625
626
	WRITESIDEBARBUTTON("Add Widearea Node (CD)",
			   $TBDOCBASE, "http://www.emulab.net/cdrom.php");
	echo "</ul>\n";
627
    }
628
629
}

630
631
632
633
634
635
#
# Simple version of above, that just writes the given menu.
# 
function WRITESIMPLESIDEBAR($menudefs) {
    $menutitle = $menudefs['title'];
    
Timothy Stack's avatar
   
Timothy Stack committed
636
637
    echo "<h3 class='menuheader'>$menutitle</h3>
          <ul class=menu>";
638
639
640
641
642

    each($menudefs);    
    while (list($key, $val) = each($menudefs)) {
	WRITESIDEBARBUTTON("$key", null, "$val");
    }
Timothy Stack's avatar
   
Timothy Stack committed
643
    echo "</ul>\n";
644
645
}

Chad Barb's avatar
   
Chad Barb committed
646
647
648
#
# spits out beginning part of page
#
649
650
function PAGEBEGINNING( $title, $nobanner = 0, $nocontent = 0,
        $extra_headers = NULL ) {
651
    global $BASEPATH, $TBMAINSITE, $THISHOMEBASE, $ELABINELAB;
Chad Barb's avatar
Chad Barb committed
652
    global $TBDIR, $WWW;
Chad Barb's avatar
   
Chad Barb committed
653
    global $MAINPAGE;
654
    global $TBDOCBASE;
655
    global $autorefresh;
Chad Barb's avatar
   
Chad Barb committed
656

657
658
    $MAINPAGE = !strcmp($TBDIR, "/usr/testbed/");

Chad Barb's avatar
   
Chad Barb committed
659
660
661
662
663
    echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 
          'http://www.w3.org/TR/html4/loose.dtd'>
	<html>
	  <head>
	    <title>$THISHOMEBASE - $title</title>
664
665
            <!--<link rel=\"SHORTCUT ICON\" HREF=\"netbed.ico\">-->
            <link rel=\"SHORTCUT ICON\" HREF=\"netbed.png\" TYPE=\"image/png\">
Chad Barb's avatar
   
Chad Barb committed
666
667
    	    <!-- dumbed-down style sheet for any browser that groks (eg NS47). -->
	    <link REL='stylesheet' HREF='$BASEPATH/common-style.css' TYPE='text/css' />
668
669
    	    <!-- do not import full style sheet into NS47, since it does bad job
            of handling it. NS47 does not understand '@import'. -->
Chad Barb's avatar
   
Chad Barb committed
670
    	    <style type='text/css' media='all'>
Timothy Stack's avatar
   
Timothy Stack committed
671
            <!-- @import url($BASEPATH/style.css); -->";
Chad Barb's avatar
   
Chad Barb committed
672

673
    if (!$MAINPAGE) {
Timothy Stack's avatar
   
Timothy Stack committed
674
	echo "<!-- @import url($BASEPATH/style-nonmain.css); -->";
675
    } 
Chad Barb's avatar
   
Chad Barb committed
676

Leigh B. Stoller's avatar
Leigh B. Stoller committed
677
    echo "</style>\n";
Chad Barb's avatar
   
Chad Barb committed
678
679

    if ($TBMAINSITE) {
Leigh B. Stoller's avatar
Leigh B. Stoller committed
680
	echo "<meta NAME=\"keywords\" ".
Leigh B. Stoller's avatar
Leigh B. Stoller committed
681
682
	           "CONTENT=\"network, emulation, internet, emulator, ".
	           "mobile, wireless, robotic\">\n";
Leigh B. Stoller's avatar
Leigh B. Stoller committed
683
684
685
686
687
	echo "<meta NAME=\"robots\" ".
	           "CONTENT=\"NOARCHIVE\">\n";
	echo "<meta NAME=\"description\" ".
                   "CONTENT=\"emulab - network emulation testbed home\">\n";
    }
688
689
690
    if ($extra_headers) {
        echo $extra_headers;
    }
Chad Barb's avatar
   
Chad Barb committed
691
692
    echo "</head>
            <body bgcolor='#FFFFFF' 
693
             topmargin='0' leftmargin='0' marginheight='0' marginwidth='0'>\n";
694
695
696
697
    
    if ($autorefresh) {
	echo "<meta HTTP-EQUIV=\"Refresh\" CONTENT=\"$autorefresh\">\n";
    }
698
    if (! $nobanner ) {
699
700
701
702
703
704
	echo "<map name=overlaymap>
                 <area shape=rect coords=\"100,60,369,100\"
                       href='http://www.emulab.net/index.php3'>
                 <area shape=rect coords=\"0,0,369,100\"
                       href='$TBDOCBASE/index.php3'>
              </map>
Timothy Stack's avatar
   
Timothy Stack committed
705
706
707
            <div class='bannercell'>
	       <iframe src=$BASEPATH/currentusage.php3 class='usageframe'
                 scrolling=no frameborder=0></iframe></td>
708
709
710
711
712
713
714
715
716
              <img width=369 height=100 border=0 usemap=\"#overlaymap\" ";

	if ($ELABINELAB) {
	    echo "src='$BASEPATH/overlay.elabinelab.gif' ";
	}
	else {
	    echo "src='$BASEPATH/overlay.".strtolower($THISHOMEBASE).".gif' ";
	}
	echo "alt='$THISHOMEBASE - the network testbed'>\n";
717
        if (!$MAINPAGE) {
Timothy Stack's avatar
   
Timothy Stack committed
718
	     echo "<span class='devpagename'>$WWW</span>";
719
	}
Timothy Stack's avatar
   
Timothy Stack committed
720
        echo "</div>\n";
721
722
    }
    if (! $nocontent ) {
Timothy Stack's avatar
   
Timothy Stack committed
723
	echo "<div class='leftcell'>
724
                  <!-- sidebar begins -->";
Chad Barb's avatar
   
Chad Barb committed
725
    }
Chad Barb's avatar
   
Chad Barb committed
726
727
728
729
730
}

#
# finishes sidebar td
#
731
function FINISHSIDEBAR($contentname = "content", $nocontent = 0)
Chad Barb's avatar
   
Chad Barb committed
732
{
733
    global $TBMAINSITE;
734
735
736
737
738
739
740
741

    if (!$nocontent) {
	if (!$TBMAINSITE) {
	    #
	    # It is a violation of Emulab licensing restrictions to remove
	    # this logo!
	    #
	    echo "       <a class='builtwith' href='http://www.emulab.net'>
742
                         <img src='$BASEPATH/builtwith.png'></a>";
743
744
745
	}
	echo "<!-- sidebar ends -->
              </div>";
746
    }
747
748

    echo "
Timothy Stack's avatar
   
Timothy Stack committed
749
750
        <div class='$contentname'>
          <!-- content body -->";
Chad Barb's avatar
   
Chad Barb committed
751
752
}

753
754
755
#
# Spit out a vanilla page header.
#
756
function PAGEHEADER($title, $view = NULL, $extra_headers = NULL) {
757
    global $login_status, $login_uid, $TBBASE, $TBDOCBASE, $THISHOMEBASE;
758
    global $BASEPATH, $SSL_PROTOCOL, $drewheader, $autorefresh;
759
    global $TBMAINSITE;
760
761

    $drewheader = 1;
762
763
764
    if (isset($_GET['refreshrate']) && is_numeric($_GET['refreshrate'])) {
	$autorefresh = $_GET['refreshrate'];
    }
765

766
    #
767
    # Figure out who is logged in, if anyone.
768
    # 
769
770
771
772
    if (($known_uid = GETUID()) != FALSE) {
        #
        # Check to make sure the UID is logged in (not timed out).
        #
773
774
775
        $login_status = CHECKLOGIN($known_uid);
	if ($login_status & (CHECKLOGIN_LOGGEDIN|CHECKLOGIN_MAYBEVALID)) {
	    $login_uid = $known_uid;
776
777
778
	}
    }

779
780
781
782
783
784
785
    #
    # If no view options were specified, get the ones for the current user
    #
    if (!$view) {
	$view = GETUSERVIEW();
    }

786
    #
787
788
    # Check for NOLOGINS. 
    # We want to allow admin types to continue using the web interface,
789
790
    # and logout anyone else that is currently logged in!
    #
791
792
793
794
    if (NOLOGINS() && $login_uid && !ISADMIN($login_uid)) {
	DOLOGOUT($login_uid);
	$login_status = CHECKLOGIN_NOTLOGGEDIN;
	$login_uid    = 0;
795
    }
796
    
797
798
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    
799
    if (1) {
800
801
802
803
804
805
806
	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
807

808
809
810
811
812
    if (isset($view['hide_banner'])) {
	$nobanner = 1;
    } else {
	$nobanner = 0;
    }
Timothy Stack's avatar
   
Timothy Stack committed
813
    $contentname = "content";
814
    $nocontent = isset($view['hide_sidebar']) && !isset($view['menu']);
Timothy Stack's avatar
   
Timothy Stack committed
815
    PAGEBEGINNING( $title, $nobanner,
816
		   $nocontent,
Timothy Stack's avatar
   
Timothy Stack committed
817
		   $extra_headers );
818
819
820
    if (!isset($view['hide_sidebar'])) {
	WRITESIDEBAR();
    }
821
822
823
    elseif (isset($view['menu'])) {
	WRITESIMPLESIDEBAR($view['menu']);
    }
Timothy Stack's avatar
   
Timothy Stack committed
824
825
826
    else {
	$contentname = "fullcontent";
    }
827
    FINISHSIDEBAR($contentname, $nocontent);
Chad Barb's avatar
   
Chad Barb committed
828

Timothy Stack's avatar
   
Timothy Stack committed
829
830
831
832
833
834
    echo "<div class='contentbody'>";
    echo "<div id='logintime'>";
    echo "<span id='loggedin'>";
    $now = date("D M d g:ia T");
    if ($login_uid) {
	echo "<span class='uid'>$login_uid</span> Logged in.";
835
    }
Timothy Stack's avatar
   
Timothy Stack committed
836
837
838
839
    echo "</span>";
    echo "<span class='timestamp'>$now</span>\n";
    echo "</div>";
    
840
841
842
843
    $major = "";
    $minor = "";
    $build = "";
    TBGetVersionInfo($major, $minor, $build);
844
845
846
847
    if ($view['hide_versioninfo'] == 1)
	$versioninfo = "";
    else
	$versioninfo = "Vers: $major.$minor Build: $build";
Timothy Stack's avatar
   
Timothy Stack committed
848
849
850
851
852
853
854
855
856
857
858
859
    echo "<div id='versioninfo'>$versioninfo</div>";

    echo "<h2 class='contenttitle'>\n";
    if ($login_uid && ISADMINISTRATOR()) {
	if (ISADMIN($login_uid)) {
	    echo "<a href=$TBBASE/toggle.php?target_uid=$login_uid&type=adminoff&value=1><img src='/redball.gif'
                          border=0 alt='Admin On'></a>\n";
	}
	else {
	    echo "<a href=$TBBASE/toggle.php?target_uid=$login_uid&type=adminoff&value=0><img src='/greenball.gif'
                          border=0 alt='Admin Off'></a>\n";
	}
Chad Barb's avatar
   
Chad Barb committed
860
    }
Timothy Stack's avatar
   
Timothy Stack committed
861
862
    echo "$title</h2>\n";

Chad Barb's avatar
   
Chad Barb committed
863
    echo "<!-- begin content -->\n";
864
865
866
    if ($view['show_topbar'] == "plab") {
	WRITEPLABTOPBAR();
    }
867
868
869
}

#
Timothy Stack's avatar
   
Timothy Stack committed
870
# ENDPAGE(): This terminates the div started above.
871
872
# 
function ENDPAGE() {
Timothy Stack's avatar
   
Timothy Stack committed
873
  echo "</div>";
874
875
876
877
878
}

#
# Spit out a vanilla page footer.
#
879
function PAGEFOOTER($view = NULL) {
880
    global $TBDOCBASE, $TBMAILADDR, $THISHOMEBASE, $BASEPATH;
Leigh B. Stoller's avatar
Leigh B. Stoller committed
881
    global $TBMAINSITE, $SSL_PROTOCOL;
882

883
884
885
886
    if (!$view) {
	$view = GETUSERVIEW();
    }

887
888
    $today = getdate();
    $year  = $today["year"];
Chad Barb's avatar
   
Chad Barb committed
889

890
    echo "<!-- end content -->\n";
Timothy Stack's avatar
   
Timothy Stack committed
891

892
893
894
895
896
    if ($view['show_bottombar'] == "plab") {
	WRITEPLABBOTTOMBAR();
    }

    echo "
Timothy Stack's avatar
   
Timothy Stack committed
897
              <div class=contentfooter>\n";
898
899
    if (!$view['hide_copyright']) {
	echo "
Timothy Stack's avatar
   
Timothy Stack committed
900
901
902
903
904
905
906
907
                <ul class='navlist'>
		<li>[ <a href=http://www.cs.utah.edu/flux/>
                    Flux&nbsp;Research&nbsp;Group</a> ]</li>
	        <li>[ <a href=http://www.cs.utah.edu/>
                    School&nbsp;of&nbsp;Computing</a> ]</li>
		<li>[ <a href=http://www.utah.edu/>
                    University&nbsp;of&nbsp;Utah</a> ]</li>
                </ul>
Chad Barb's avatar
   
Chad Barb committed
908
                <!-- begin copyright -->
Timothy Stack's avatar
   
Timothy Stack committed
909
                <span class='copyright'>
910
911
                <a href='$TBDOCBASE/docwrapper.php3?docname=copyright.html'>
                    Copyright &copy; 2000-$year The University of Utah</a>
Timothy Stack's avatar
   
Timothy Stack committed
912
                </span>\n";
913
    }
Timothy Stack's avatar
   
Timothy Stack committed
914
915
916
917
918
919
920
921
    echo "
                <p class='contact'>
                    Problems?
	            Contact $TBMAILADDR.
                </p>
                <!-- end copyright -->\n";
    echo "</div>";
    echo "</div>";
Chad Barb's avatar
   
Chad Barb committed
922
923

    ENDPAGE();
924

Leigh B. Stoller's avatar
Leigh B. Stoller committed
925
926
927
    # Plug the home site from all others.
    echo "\n<p><a href=\"www.emulab.net/netemu.php3\"></a>\n";

Chad Barb's avatar
   
Chad Barb committed
928
    echo "</body></html>\n";
929
}
930
931

function PAGEERROR($msg) {
932
    global $drewheader, $noheaders;
933

934
    if (! $drewheader && ! $noheaders)
935
	PAGEHEADER("Page Error");
936
937
938

    echo "$msg\n";

939
940
    if (! $noheaders) 
	PAGEFOOTER();
941
942
    die("");
}
943
944
945
946

#
# Sub Page/Menu Stuff
#
947
function WRITESUBMENUBUTTON($text, $link, $target = "") {
Timothy Stack's avatar
   
Timothy Stack committed
948
    global $nextsubmenucl;
Chad Barb's avatar
   
Chad Barb committed
949

950
951
952
953
954
955
    #
    # Optional 'target' agument, so that we can pop up new windows
    #
    if ($target) {
	$targettext = "target='$target'";
    }
Timothy Stack's avatar
   
Timothy Stack committed
956
957
958
959
960
    $cl = "";
    if ($nextsubmenucl != "") {
	$cl = "class='$nextsubmenucl'";
	$nextsubmenucl = "";
    }
Chad Barb's avatar
   
Chad Barb committed
961

Timothy Stack's avatar
   
Timothy Stack committed
962
    echo "<li $cl><a href='$link' $targettext>$text</a></li>\n";
963
964
}

965
function WRITESUBMENUDIVIDER() {
Timothy Stack's avatar
   
Timothy Stack committed
966
967
968
    global $nextsubmenucl;
    
    $nextsubmenucl = "newgroup";
969
970
}

971
972
973
974
#
# Start/End a page within a page. 
#
function SUBPAGESTART() {
Chad Barb's avatar
   
Chad Barb committed
975
    echo "<!-- begin subpage -->";
Chad Barb's avatar
   
Chad Barb committed
976
    echo "<table class=\"stealth\"
977
	  cellspacing='0' cellpadding='0' width='100%' border='0'>\n
978
            <tr>\n
Chad Barb's avatar
   
Chad Barb committed
979
              <td class=\"stealth\"valign=top>\n";
980
981
982
983
984
985
}

function SUBPAGEEND() {
    echo "    </td>\n
            </tr>\n
          </table>\n";
Chad Barb's avatar
   
Chad Barb committed
986
    echo "<!-- end subpage -->";
987
988
989
990
991
992
993
}

#
# 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
994
995
?>
    <!-- begin submenu -->
Timothy Stack's avatar
   
Timothy Stack committed
996
997
    <h3 class="submenuheader"><?php echo "$title";?></h3>
    <ul class="submenu">
Chad Barb's avatar
   
Chad Barb committed
998
<?php
999
1000
1001
}

function SUBMENUEND() {
Chad Barb's avatar
   
Chad Barb committed
1002
?>
Timothy Stack's avatar
   
Timothy Stack committed
1003
    </ul>
Chad Barb's avatar
   
Chad Barb committed
1004
1005
    <!-- end submenu -->
  </td>
1006
  <td class="stealth" valign=top align=left width='100%'>
Chad Barb's avatar
   
Chad Barb committed
1007
<?php
1008
1009
}

1010
1011
1012
1013
1014
1015
# Start a new section in an existing submenu
# This includes ending the one before it
function SUBMENUSECTION($title) {
    SUBMENUSECTIONEND();
?>
      <!-- new submenu section -->
Timothy Stack's avatar
   
Timothy Stack committed
1016
1017
1018
      </ul>
      <h3 class="submenuheader"><?php echo "$title";?></h3>
      <ul class="submenu">
1019
1020
1021
<?php
}

Timothy Stack's avatar
   
Timothy Stack committed
1022
# End a submenu section - only need this on the last one of the list.
1023
1024
function SUBMENUSECTIONEND() {
?>
Timothy Stack's avatar
   
Timothy Stack committed
1025
      </ul>
1026
1027
<?php
}
Chad Barb's avatar
   
Chad Barb committed
1028
1029
1030
1031
1032

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

function SUBMENUEND_2A() {
?>
Timothy Stack's avatar
   
Timothy Stack committed
1033
    </ul>
Chad Barb's avatar
   
Chad Barb committed
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
    <!-- end submenu -->
<?php
}

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

1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
#
# Get a view, for use with PAGEHEADER and PAGEFOOTER, for the current user
#
function GETUSERVIEW() {
    if (GETUID() && ISPLABUSER()) {
	return array('hide_sidebar' => 1, 'hide_banner' => 1,
	    'show_topbar' => "plab", 'show_bottombar' => 'plab',
	    'hide_copyright' => 1);
    } else {
	# Most users get the default view
	return array();
    }
}

1059
?>