2021-12-14 18:32:47 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
2007-06-30 01:19:11 +00:00
|
|
|
|
2023-01-10 22:44:09 +00:00
|
|
|
namespace Shimmie2;
|
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
class DowntimeTheme extends Themelet
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Show the admin that downtime mode is enabled
|
|
|
|
*/
|
|
|
|
public function display_notification(Page $page)
|
|
|
|
{
|
|
|
|
$page->add_block(new Block(
|
|
|
|
"Downtime",
|
2023-12-25 15:33:57 +00:00
|
|
|
"<span style='font-size: 1.5rem; text-align: center;'><b>DOWNTIME MODE IS ON!</b></span>",
|
2019-05-28 16:59:38 +00:00
|
|
|
"left",
|
|
|
|
0
|
|
|
|
));
|
|
|
|
}
|
2007-06-30 01:19:11 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
/**
|
|
|
|
* Display $message and exit
|
|
|
|
*/
|
|
|
|
public function display_message(string $message)
|
|
|
|
{
|
|
|
|
global $config, $user, $page;
|
2019-08-02 19:40:03 +00:00
|
|
|
$theme_name = $config->get_string(SetupConfig::THEME);
|
2019-05-28 16:59:38 +00:00
|
|
|
$data_href = get_base_href();
|
|
|
|
$login_link = make_link("user_admin/login");
|
|
|
|
$auth = $user->get_auth_html();
|
2015-08-23 15:09:52 +00:00
|
|
|
|
2019-06-19 01:58:28 +00:00
|
|
|
$page->set_mode(PageMode::DATA);
|
2019-05-28 16:59:38 +00:00
|
|
|
$page->set_code(503);
|
|
|
|
$page->set_data(
|
|
|
|
<<<EOD
|
2020-03-13 09:23:54 +00:00
|
|
|
<html lang="en">
|
2007-06-30 01:19:11 +00:00
|
|
|
<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">
|
2014-04-19 00:21:50 +00:00
|
|
|
<section>
|
2020-03-13 09:23:54 +00:00
|
|
|
<h1 style="text-align: center;">Down for Maintenance</h1>
|
2014-04-19 00:21:50 +00:00
|
|
|
<div id="message" class="blockbody">
|
|
|
|
$message
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
<section>
|
|
|
|
<h3>Admin Login</h3>
|
|
|
|
<div id="login" class="blockbody">
|
|
|
|
<form action="$login_link" method="POST">
|
|
|
|
$auth
|
|
|
|
<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>
|
|
|
|
</section>
|
2009-08-03 18:58:12 +00:00
|
|
|
</div>
|
2007-06-30 01:19:11 +00:00
|
|
|
</body>
|
|
|
|
</html>
|
2015-08-23 15:09:52 +00:00
|
|
|
EOD
|
2019-11-02 19:57:34 +00:00
|
|
|
);
|
2019-05-28 16:59:38 +00:00
|
|
|
}
|
2007-06-30 01:19:11 +00:00
|
|
|
}
|