Commit 1044fcf3 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Add a "nologins" capability. When we want to turn off the web

interface options (but leave the documentation and web page running),
simply do this in mysql:

	insert into nologins (nologins) values(1);

To turn the interface back on:

	delete from nologins;
parent f30f61a6
......@@ -61,6 +61,16 @@ function WRITESIDEBAR() {
</td>
</tr>\n";
if (NOLOGINS()) {
WRITESIDEBARBUTTON("Web Interface Temporarily Unavailable",
$TBDOCBASE, "nologins.php3");
echo "</table>
<br>\n";
return;
}
if ($login_status == $STATUS_LOGGEDIN) {
$query_result = mysql_db_query($TBDBNAME,
"SELECT status,admin,stud FROM users WHERE uid='$uid'");
......
<?php
require("defs.php3");
#
# Standard Testbed Header
#
PAGEHEADER("Web Interface Temporarily Unavailable");
?>
<h3>
The Emulab Web Interface is currently offline so that we may conduct
internal maintenance.
<br>
Please check back again in a little while.
<p>
We apologize for any inconvenience this may cause.
<?php
#
# Standard Testbed Footer
#
PAGEFOOTER();
?>
......@@ -252,6 +252,28 @@ function DOLOGOUT($uid) {
return 0;
}
#
# Primitive "nologins" support.
#
function NOLOGINS() {
global $TBDBNAME;
$query_result = mysql_db_query($TBDBNAME,
"SELECT nologins FROM nologins where nologins=1");
if (! $query_result) {
$err = mysql_error();
TBERROR("Database Error nologins info: $err\n", 1);
}
# No entry
if (($row = mysql_fetch_array($query_result)) == 0) {
return 0;
}
$nologins = $row[nologins];
return $nologins;
}
#
# Beware empty spaces (cookies)!
#
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment