Use the login/html page for maintenance mode; we don't need the

maintenance controller/view anymore.  Fixes ticket #1267.
This commit is contained in:
Bharat Mediratta
2010-08-01 22:09:02 -07:00
parent ca54cdd644
commit 3e8d683ce4
4 changed files with 6 additions and 82 deletions
@@ -1,25 +0,0 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2010 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Maintenance_Controller extends Controller {
function index() {
Session::instance()->set("continue_url", url::abs_site("admin/maintenance"));
print new View("maintenance.html");
}
}
+5 -3
View File
@@ -26,11 +26,13 @@ class gallery_Core {
*/
static function maintenance_mode() {
if (Router::$controller != "login" &&
Router::$controller != "combined" &&
module::get_var("gallery", "maintenance_mode", 0) &&
!identity::active_user()->admin) {
Router::$controller = "maintenance";
Router::$controller_path = MODPATH . "gallery/controllers/maintenance.php";
Router::$method = "index";
Session::instance()->set("continue_url", url::abs_site("admin/maintenance"));
Router::$controller = "login";
Router::$controller_path = MODPATH . "gallery/controllers/login.php";
Router::$method = "html";
}
}
+1 -1
View File
@@ -43,7 +43,7 @@
<li id="g-login-form">
<?= $form ?>
</li>
<? if (identity::is_writable()): ?>
<? if (identity::is_writable() && !module::get_var("gallery", "maintenance_mode")): ?>
<li>
<a href="#" id="g-password-reset" class="g-right g-text-small"><?= t("Forgot your password?") ?></a>
</li>
@@ -1,53 +0,0 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<html>
<head>
<title>
<?= t("Gallery - maintenance mode") ?>
</title>
<style>
body {
background: #ccc;
}
form {
border: 1px solid #555;
background: #999;
width: 300px;
}
fieldset {
border: none;
}
fieldset legend {
font-size: 24px;
display: none !important;
padding-left: 0px;
}
ul {
list-style-type: none;
margin-top: 0px;
padding-left: 0px;
bullet-style: none;
}
ul li {
margin-left: 0px;
}
label {
width: 60px;
display: block;
}
</style>
</head>
<body>
<h1>
<?= t("Gallery - maintenance mode") ?>
</h1>
<p>
<?= t("This site is currently only accessible by site administrators.") ?>
</p>
<?= auth::get_login_form("login/auth_html") ?>
<script type="text/javascript">
document.forms[0].name.focus();
</script>
</body>
</html>