Commit fbe6687e authored by Leigh B. Stoller's avatar Leigh B. Stoller

Revamp the web pages. NO MORE FRAMES! YIPPIE!

parent e8bbfa95
...@@ -37,6 +37,8 @@ DOCFILES += $(wildcard $(SRCDIR)/doc/*.gif) ...@@ -37,6 +37,8 @@ DOCFILES += $(wildcard $(SRCDIR)/doc/*.gif)
TUTFILES = $(wildcard $(SRCDIR)/tutorial/*.html) TUTFILES = $(wildcard $(SRCDIR)/tutorial/*.html)
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.jpg) TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.jpg)
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.gif) TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.gif)
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.php3)
TUTFILES += $(wildcard $(SRCDIR)/tutorial/*.ns)
TUTFILES += $(SRCDIR)/tutorial/tb_compat.tcl TUTFILES += $(SRCDIR)/tutorial/tb_compat.tcl
# #
......
<?php <?php
include("defs.php3"); include("defs.php3");
PAGEHEADER("New User"); PAGEHEADER("Apply for Project Membership");
# #
# Get current user. # Get current user.
...@@ -44,11 +44,6 @@ else { ...@@ -44,11 +44,6 @@ else {
?> ?>
<table align="center" border="1"> <table align="center" border="1">
<tr>
<td colspan="2">
<h1 align="center">Apply for Project Membership</h1></td>
</tr>
<tr> <tr>
<td align="center" colspan="2"> <td align="center" colspan="2">
Fields marked with * are required.</td> Fields marked with * are required.</td>
......
...@@ -28,8 +28,6 @@ if (!isset($pid) || ...@@ -28,8 +28,6 @@ if (!isset($pid) ||
USERERROR("You must provide a project ID.", 1); USERERROR("You must provide a project ID.", 1);
} }
echo "<center><h1>Approve a Project</h1></center>\n";
# #
# Check to make sure thats this is a valid PID. # Check to make sure thats this is a valid PID.
# #
......
...@@ -12,8 +12,6 @@ PAGEHEADER("New Project Approval List"); ...@@ -12,8 +12,6 @@ PAGEHEADER("New Project Approval List");
$uid = GETLOGIN(); $uid = GETLOGIN();
LOGGEDINORDIE($uid); LOGGEDINORDIE($uid);
echo "<center><h1>Approve New Projects List</h1></center>\n";
# #
# Of course verify that this uid has admin privs! # Of course verify that this uid has admin privs!
# #
......
...@@ -12,10 +12,6 @@ PAGEHEADER("New Users Approved"); ...@@ -12,10 +12,6 @@ PAGEHEADER("New Users Approved");
$uid = GETLOGIN(); $uid = GETLOGIN();
LOGGEDINORDIE($uid); LOGGEDINORDIE($uid);
echo "<center><h1>
Project Membership Results
</h1></center>";
# #
# Walk the list of post variables, looking for the special post format. # Walk the list of post variables, looking for the special post format.
# See approveuser_form.php3: # See approveuser_form.php3:
......
<html> <html>
<head> <head>
<title>Utah Network Testbed - Policy</title> <title>Utah Network Testbed - Policies</title>
<link rel='stylesheet' href='tbstyle-doc.css' type='text/css'> <link rel='stylesheet' href='tbstyle.css' type='text/css'>
</head> </head>
<body> <body>
<basefont size=4> <basefont size=4>
...@@ -57,7 +57,8 @@ reserve and configure nodes, etc. ...@@ -57,7 +57,8 @@ reserve and configure nodes, etc.
<p> <p>
More detailed information on this More detailed information on this
process can be found in the <a href="faq.html">FAQ</a>. process can be found in the
<a href="docwrapper.php3?docname=faq.html">Emulab FAQ</a>.
<h3>Another way of saying the same thing</h3> <h3>Another way of saying the same thing</h3>
...@@ -117,25 +118,3 @@ You will also receive an account on the users' master host ...@@ -117,25 +118,3 @@ You will also receive an account on the users' master host
"users.emulab.net", and from there will be able to access the test "users.emulab.net", and from there will be able to access the test
nodes' serial line consoles via 'tip' as well as access console log nodes' serial line consoles via 'tip' as well as access console log
files. files.
<hr size=2 noshade>
<center>
<!-- Force full window! -->
<base target=_top>
[<a href="https://www.emulab.net/">Emulab.Net Home</a>]<br>
[<a href="http://www.cs.utah.edu/flux/testbed/">Utah Network Testbed</a>]
[<a href="http://www.cs.utah.edu/flux/">Flux Research Group</a>]
[<a href="http://www.cs.utah.edu/">School of Computing</a>]
[<a href="http://www.utah.edu/">University of Utah</a>]
</center>
<p align=right>
<font size="-1">
<a href="mailto:testbed-ops@flux.cs.utah.edu">
Testbed Operations (testbed-ops@flux.cs.utah.edu)</a>
<br>
Last modified on Apr 4, 2001
</font>
</p>
</body>
</html>
...@@ -4,7 +4,7 @@ include("defs.php3"); ...@@ -4,7 +4,7 @@ include("defs.php3");
# #
# Standard Testbed Header # Standard Testbed Header
# #
PAGEHEADER("Create a Batch Mode Experiment"); PAGEHEADER("Creating a Batch Mode Experiment");
$mydebug = 0; $mydebug = 0;
......
...@@ -30,12 +30,6 @@ if (mysql_num_rows($query_result) == 0) { ...@@ -30,12 +30,6 @@ if (mysql_num_rows($query_result) == 0) {
?> ?>
<table align="center" border="1"> <table align="center" border="1">
<tr>
<td align="center" colspan="2">
<h1>Create a new Batch Mode Experiment on the Testbed</h1>
</td>
</tr>
<tr> <tr>
<td align="center" colspan="3"> <td align="center" colspan="3">
<em>(Fields marked with * are required)</em> <em>(Fields marked with * are required)</em>
......
...@@ -4,7 +4,7 @@ include("defs.php3"); ...@@ -4,7 +4,7 @@ include("defs.php3");
# #
# Standard Testbed Header # Standard Testbed Header
# #
PAGEHEADER("Begin an Experiment Form"); PAGEHEADER("Begin a new Testbed Experiment");
# #
# Only known and logged in users can begin experiments. # Only known and logged in users can begin experiments.
...@@ -30,11 +30,6 @@ if (mysql_num_rows($query_result) == 0) { ...@@ -30,11 +30,6 @@ if (mysql_num_rows($query_result) == 0) {
?> ?>
<table align="center" border="1"> <table align="center" border="1">
<tr>
<td align="center" colspan="2">
<h1>Begin a new Experiment on the Testbed</h1>
</td>
</tr>
<tr> <tr>
<td align="center" colspan="3"> <td align="center" colspan="3">
......
...@@ -4,7 +4,7 @@ include("defs.php3"); ...@@ -4,7 +4,7 @@ include("defs.php3");
# #
# Standard Testbed Header # Standard Testbed Header
# #
PAGEHEADER("Begin an Experiment"); PAGEHEADER("Beginning a Testbed Experiment");
$mydebug = 0; $mydebug = 0;
......
<?php <?php
# #
# Standard definitions! # Standard definitions!
# #
$TBDIR = "@prefix@/"; $TBDIR = "@prefix@/";
$WWWDEFS = "@WWWDEFS@"; $WWWDEFS = "@WWWDEFS@";
...@@ -32,6 +32,19 @@ $TBAUTHTIMEOUT = 21600; ...@@ -32,6 +32,19 @@ $TBAUTHTIMEOUT = 21600;
$HTTPTAG = "http://"; $HTTPTAG = "http://";
#
# Menu Formatting Stuff
#
# Color for the title on each page.
$TITLECOLOR = "#E04050";
$BANNERCOLOR = "#ABABE0";
$THISHOMEBASE = "Emulab.Net";
$THISPROJECT = "The Utah Network Testbed";
#
# Links back to Flux web Pages
#
# #
# Database constants and the like. # Database constants and the like.
# #
...@@ -66,6 +79,9 @@ function TBERROR ($message, $death) { ...@@ -66,6 +79,9 @@ function TBERROR ($message, $death) {
sleep(2); sleep(2);
if ($death) { if ($death) {
ENDPAGE();
echo "</body>
</html>";
die("<br><br><h3>". die("<br><br><h3>".
"$message <p>". "$message <p>".
"Could not continue. Please contact ". "Could not continue. Please contact ".
...@@ -91,6 +107,7 @@ function USERERROR($message, $death) { ...@@ -91,6 +107,7 @@ function USERERROR($message, $death) {
if you feel this message is an error."; if you feel this message is an error.";
if ($death) { if ($death) {
ENDPAGE();
echo "</body> echo "</body>
</html>"; </html>";
die(""); die("");
...@@ -125,52 +142,14 @@ function ISADMIN($uid) { ...@@ -125,52 +142,14 @@ function ISADMIN($uid) {
return $admin; return $admin;
} }
#
# Spit out a vanilla page header.
#
function PAGEHEADER($title) {
echo "<html>
<head>
<title>$title</title>
<link rel=\"stylesheet\" href=\"tbstyle.css\" type=\"text/css\">
</head>
<body>
<basefont size=4>
\n";
}
#
# Spit out a vanilla page footer.
#
function PAGEFOOTER() {
global $TBBASE;
echo "<br><hr>
<!-- Force full window! -->
<base target=_top>
<center>[<a href=\"$TBBASE\">Emulab.Net Home</a>]</center>
<center>
[<a href=\"http://www.cs.utah.edu/flux/testbed/\">
Utah Network Testbed</a>]
[<a href=\"http://www.cs.utah.edu/flux/\">Flux Research Group</a>]
[<a href=\"http://www.cs.utah.edu/\">School of Computing</a>]
[<a href=\"http://www.utah.edu/\">University of Utah</a>]
</center>
<p align=right>
<font size=-2>
Problems? Contact
<a href=\"mailto:testbed-ops@flux.cs.utah.edu\">
Testbed Operations (testbed-ops@flux.cs.utah.edu)</a>
</body>
</html>\n";
}
# #
# Run a program as a user. # Run a program as a user.
# #
function SUEXEC($uid, $gid, $cmdandargs, $die) { function SUEXEC($uid, $gid, $cmdandargs, $die) {
global $TBSUEXEC_PATH; global $TBSUEXEC_PATH;
ignore_user_abort(1);
$output = array(); $output = array();
$retval = 0; $retval = 0;
$result = exec("$TBSUEXEC_PATH $uid $gid $cmdandargs", $result = exec("$TBSUEXEC_PATH $uid $gid $cmdandargs",
...@@ -219,4 +198,9 @@ function VERIFYURL($url) { ...@@ -219,4 +198,9 @@ function VERIFYURL($url) {
# Beware empty spaces (cookies)! # Beware empty spaces (cookies)!
# #
require("tbauth.php3"); require("tbauth.php3");
#
# Okay, this is what checks the login and spits out the menu.
#
require("menu.php3");
?> ?>
...@@ -4,7 +4,7 @@ include("defs.php3"); ...@@ -4,7 +4,7 @@ include("defs.php3");
# #
# Standard Testbed Header # Standard Testbed Header
# #
PAGEHEADER("Terminate Project and Remove all Trace"); PAGEHEADER("Terminating Project and Remove all Trace");
# #
# Only known and logged in users can end experiments. # Only known and logged in users can end experiments.
......
<?php
require("defs.php3");
#
# Standard Testbed Header
#
PAGEHEADER("Documentation");
?>
<ul>
<li> <a href="docwrapper.php3?docname=tutorial/tutorial.html">
Emulab `Getting Started' Tutorial</a>.
<p>
<li> <a href="docwrapper.php3?docname=faq.html">
Emulab Frequently Asked Questions (FAQ)</a>.
<p>
<li> <a href="docwrapper.php3?docname=doc/tmcd.html">
Testbed Master Control Daemon (TMCD) Reference Manual</a>
<p>
<li><b><a href = "docwrapper.php3?docname=auth.html">
Authorization Scheme, Policy, and "How To Get Started"</a></b>
<p>
<li><b><a href = "docwrapper.php3?docname=hardware.html">
Hardware Overview</a></b>
<p>
<li><b><a href = "docwrapper.php3?docname=software.html">
Software Overview</a></b>
<p>
<li><b><a href = "docwrapper.php3?docname=security.html">
Security Issues</a></b>
<p>
<li><b><a href = "docwrapper.php3?docname=policies.html">
Administrative Policies and Disclaimer</a></b>
<p>
<li><b><a href = "docwrapper.php3?docname=sponsors.html">
Emulab Sponsors</a></b>
</ul>
<?php
#
# Standard Testbed Footer
#
PAGEFOOTER();
?>
<html>
<head>
<title>Emulab - Documentation</title>
<link rel='stylesheet' href='../tbstyle-doc.css' type='text/css'>
</head>
<body>
<basefont size=4>
<center>
<h1>
Documentation
</h1>
</center>
<ul>
<li> <a href="../tutorial/tutorial.html">
Emulab `Getting Started' Tutorial</a>.
<p>
<li> <a href="../faq.html">Emulab Frequently Asked Questions (FAQ)</a>.
<p>
<li> <a href="tmcd.html">Testbed Master Control Daemon (TMCD)
Reference Manual</a>
<p>
</ul>
<hr size=2 noshade>
<center>
<!-- Force full window! -->
<base target=_top>
[<a href="https://www.emulab.net/">Emulab.Net Home</a>]<br>
[<a href="http://www.cs.utah.edu/flux/testbed/">Utah Network Testbed</a>]
[<a href="http://www.cs.utah.edu/flux/">Flux Research Group</a>]
[<a href="http://www.cs.utah.edu/">School of Computing</a>]
[<a href="http://www.utah.edu/">University of Utah</a>]
</center>
<p align=right>
<font size="-1">
<a href=\"mailto:testbed-ops@flux.cs.utah.edu\">
Testbed Operations (testbed-ops@flux.cs.utah.edu)</a>
<br>
Last modified on Apr 2, 2001
</font>
</p>
</body>
</html>
<html> <!-- This file is sucked in by the doc wrapper. -->
<head>
<title>Emulab - TMCD</title>
<link rel='stylesheet' href='../tbstyle-doc.css' type='text/css'>
</head>
<body>
<basefont size=4>
<center> <center>
<h1>Testbed Master Control Daemon/Client Reference</h1> <h1>Testbed Master Control Daemon/Client Reference</h1>
...@@ -384,24 +378,3 @@ if a new experiment with the same name is started. ...@@ -384,24 +378,3 @@ if a new experiment with the same name is started.
</ul> </ul>
</ul> </ul>
<hr size=2 noshade>
<center>
<!-- Force full window! -->
<base target=_top>
[<a href="https://www.emulab.net/">Emulab.Net Home</a>]<br>
[<a href="http://www.cs.utah.edu/flux/testbed/">Utah Network Testbed</a>]
[<a href="http://www.cs.utah.edu/flux/">Flux Research Group</a>]
[<a href="http://www.cs.utah.edu/">School of Computing</a>]
[<a href="http://www.utah.edu/">University of Utah</a>]
</center>
<p align=right>
<font size="-1">
<a href="mailto:testbed-ops@flux.cs.utah.edu">
Testbed Operations (testbed-ops@flux.cs.utah.edu)</a>
<br>
Last modified on Mar 14, 2001
</font>
</p>
</body>
</html>
<?php
require("defs.php3");
#
# Standard Testbed Header
#
PAGEHEADER("Emulab Documentation");
#
# Need to sanity check the path! For now, just make sure the path
# does not start with a dot or a slash.
#
$first = substr($docname, 0, 1);
if (strcmp($first, ".") == 0 ||
strcmp($first, "/") == 0) {
USERERROR("Invalid document name: $docname!");
}
#
# Nothing that looks like a ../ is allowed anywhere in the name
#
if (strstr($docname, "../")) {
USERERROR("Invalid document name: $docname!");
}
readfile("$docname");
#
# Standard Testbed Footer
#
PAGEFOOTER();
?>
...@@ -4,7 +4,7 @@ include("defs.php3"); ...@@ -4,7 +4,7 @@ include("defs.php3");
# #
# Standard Testbed Header # Standard Testbed Header
# #
PAGEHEADER("Cancel Batch Mode Experiment"); PAGEHEADER("Cancel a Batch Mode Experiment");
# #
# Only known and logged in users can end experiments. # Only known and logged in users can end experiments.
...@@ -48,13 +48,23 @@ $row = mysql_fetch_array($query_result); ...@@ -48,13 +48,23 @@ $row = mysql_fetch_array($query_result);
if (! $isadmin) { if (! $isadmin) {
$query_result = $query_result =
mysql_db_query($TBDBNAME, mysql_db_query($TBDBNAME,
"SELECT pid FROM proj_memb ". "SELECT pid,trust FROM proj_memb ".
"WHERE uid=\"$uid\" and pid=\"$exp_pid\""); "WHERE uid=\"$uid\" and pid=\"$exp_pid\"");
if (mysql_num_rows($query_result) == 0) { if (mysql_num_rows($query_result) == 0) {
USERERROR("You are not a member of Project $exp_pid for ". USERERROR("You are not a member of Project $exp_pid for ".
"Experiment: $exp_eid.", 1); "Experiment: $exp_eid.", 1);
} }
if (($row = mysql_fetch_row($query_result)) == 0) {
TBERROR("Database Error: Getting trust for uid $uid.", 1);
}
$trust = $row[1];
if (strcmp($trust, "group_root") && strcmp($trust, "local_root")) {
USERERROR("You are not group or local root in Project $exp_pid, ".
"so you cannot end batch experiments", 1);
}
} }
# #
......
...@@ -4,7 +4,7 @@ include("defs.php3"); ...@@ -4,7 +4,7 @@ include("defs.php3");
# #
# Standard Testbed Header # Standard Testbed Header
# #
PAGEHEADER("Terminate Experiment"); PAGEHEADER("Terminate a Testbed Experiment");
# #
# Only known and logged in users can end experiments. # Only known and logged in users can end experiments.
...@@ -84,18 +84,27 @@ if ($batchmode) { ...@@ -84,18 +84,27 @@ if ($batchmode) {
# #
# Verify that this uid is a member of the project for the experiment # Verify that this uid is a member of the project for the experiment
# being displayed, or is an admin type. # being displayed, or is an admin type. Must be group or local root.
# #
if (! $isadmin) { if (! $isadmin) {
$query_result = $query_result =
mysql_db_query($TBDBNAME, mysql_db_query($TBDBNAME,
"SELECT pid FROM proj_memb ". "SELECT pid,trust FROM proj_memb ".
"WHERE uid=\"$uid\" and pid=\"$exp_pid\""); "WHERE uid=\"$uid\" and pid=\"$exp_pid\"");
if (mysql_num_rows($query_result) == 0) { if (mysql_num_rows($query_result) == 0) {
USERERROR("You are not a member of Project $exp_pid for ". USERERROR("You are not a member of Project $exp_pid for ".
"Experiment: $exp_eid.", 1); "Experiment: $exp_eid.", 1);
} }
if (($row = mysql_fetch_row($query_result)) == 0) {
TBERROR("Database Error: Getting trust for uid $uid.", 1);
}
$trust = $row[1];