2007-06-30 01:19:11 +00:00
|
|
|
<?php
|
|
|
|
|
2009-08-03 11:07:47 +00:00
|
|
|
class DowntimeTheme extends Themelet {
|
2009-07-21 06:36:12 +00:00
|
|
|
/**
|
2007-07-28 20:30:01 +00:00
|
|
|
* Show the admin that downtime mode is enabled
|
|
|
|
*/
|
2009-01-04 16:30:46 +00:00
|
|
|
public function display_notification(Page $page) {
|
2007-06-30 01:19:11 +00:00
|
|
|
$page->add_block(new Block("Downtime",
|
2012-01-27 03:47:27 +00:00
|
|
|
"<span style='font-size: 1.5em'><b><center>DOWNTIME MODE IS ON!</center></b></span>", "left", 0));
|
2007-06-30 01:19:11 +00:00
|
|
|
}
|
|
|
|
|
2009-07-21 06:36:12 +00:00
|
|
|
/**
|
2007-07-28 20:30:01 +00:00
|
|
|
* Display $message and exit
|
|
|
|
*/
|
2012-02-10 04:04:37 +00:00
|
|
|
public function display_message(/*string*/ $message) {
|
2011-02-23 15:20:09 +00:00
|
|
|
global $config, $user;
|
2009-08-03 18:58:12 +00:00
|
|
|
$theme_name = $config->get_string('theme');
|
|
|
|
$data_href = get_base_href();
|
|
|
|
$login_link = make_link("user_admin/login");
|
2007-06-30 01:19:11 +00:00
|
|
|
header("HTTP/1.0 503 Service Temporarily Unavailable");
|
2009-08-03 18:58:12 +00:00
|
|
|
|
2010-09-22 11:56:19 +00:00
|
|
|
$auth = $user->get_auth_html();
|
2007-06-30 01:19:11 +00:00
|
|
|
print <<<EOD
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Downtime</title>
|
2009-08-03 18:58:12 +00:00
|
|
|
<link rel="stylesheet" href="$data_href/themes/$theme_name/style.css" type="text/css">
|
2007-06-30 01:19:11 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
2009-08-03 18:58:12 +00:00
|
|
|
<div id="downtime">
|
2012-01-27 03:47:27 +00:00
|
|
|
<h1><center>Down for Maintenance</center></h1>
|
2009-08-03 18:58:12 +00:00
|
|
|
<div id="message">
|
|
|
|
$message
|
|
|
|
</div>
|
|
|
|
<h3>Admin Login</h3>
|
|
|
|
<div id="login">
|
|
|
|
<form action="$login_link" method="POST">
|
2010-09-22 11:56:19 +00:00
|
|
|
$auth
|
2009-08-03 18:58:12 +00:00
|
|
|
<table id="login_table" summary="Login Form">
|
|
|
|
<tr>
|
|
|
|
<td width="70"><label for="user">Name</label></td>
|
|
|
|
<td width="70"><input id="user" type="text" name="user"></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><label for="pass">Password</label></td>
|
|
|
|
<td><input id="pass" type="password" name="pass"></td>
|
|
|
|
</tr>
|
|
|
|
<tr><td colspan="2"><input type="submit" value="Log In"></td></tr>
|
|
|
|
</table>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
2007-06-30 01:19:11 +00:00
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
EOD;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|