mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-08-22 06:46:05 -04:00
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:
@@ -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");
|
||||
}
|
||||
}
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user