summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/gallery.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-08-01 21:00:30 -0700
committerBharat Mediratta <bharat@menalto.com>2010-08-01 21:00:30 -0700
commitc33b24c9faf5d83e4f1bfc6d3778da6c37139b3f (patch)
tree0284f35a4d3d58c474e562d5e149ca0d1a212244 /modules/gallery/helpers/gallery.php
parent49eb3e32b9b8df20360ee6ceb388f00828063efa (diff)
Make maintenance mode a variable instead of a config. Then create
links on the Admin > Maintenance page to allow you to turn it on and off. This should be efficient since we cache all vars and look them up on every request anyway. This also allows us to have the Fix task enable maintenance mode while it's running which greatly reduces the chances that somebody will come along and hork the database while we're tinkering with MPTT pointers. Fixes ticket #1259.
Diffstat (limited to 'modules/gallery/helpers/gallery.php')
-rw-r--r--modules/gallery/helpers/gallery.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php
index d4078209..33a6830c 100644
--- a/modules/gallery/helpers/gallery.php
+++ b/modules/gallery/helpers/gallery.php
@@ -25,9 +25,9 @@ class gallery_Core {
* down for maintenance" page.
*/
static function maintenance_mode() {
- $maintenance_mode = Kohana::config("core.maintenance_mode", false, false);
-
- if (Router::$controller != "login" && !empty($maintenance_mode) && !identity::active_user()->admin) {
+ if (Router::$controller != "login" &&
+ module::get_var("gallery", "maintenance_mode", false) &&
+ !identity::active_user()->admin) {
Router::$controller = "maintenance";
Router::$controller_path = MODPATH . "gallery/controllers/maintenance.php";
Router::$method = "index";