diff options
-rw-r--r-- | modules/gallery/controllers/maintenance.php | 25 | ||||
-rw-r--r-- | modules/gallery/helpers/gallery.php | 8 | ||||
-rw-r--r-- | modules/gallery/views/login_ajax.html.php | 2 | ||||
-rw-r--r-- | modules/gallery/views/maintenance.html.php | 53 |
4 files changed, 6 insertions, 82 deletions
diff --git a/modules/gallery/controllers/maintenance.php b/modules/gallery/controllers/maintenance.php deleted file mode 100644 index 43fdfc55..00000000 --- a/modules/gallery/controllers/maintenance.php +++ /dev/null @@ -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"); - } -}
\ No newline at end of file diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index 82b8a790..54d16322 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -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"; } } diff --git a/modules/gallery/views/login_ajax.html.php b/modules/gallery/views/login_ajax.html.php index 88fe2389..a40d1950 100644 --- a/modules/gallery/views/login_ajax.html.php +++ b/modules/gallery/views/login_ajax.html.php @@ -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> diff --git a/modules/gallery/views/maintenance.html.php b/modules/gallery/views/maintenance.html.php deleted file mode 100644 index 0b832a2d..00000000 --- a/modules/gallery/views/maintenance.html.php +++ /dev/null @@ -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> - - |