From 4b0c2bb1f505993c3031f00bbf7f77b5870fae90 Mon Sep 17 00:00:00 2001 From: Shish Date: Tue, 23 Mar 2010 01:08:10 +0000 Subject: [PATCH] remove redundantness --- contrib/downtime/main.php | 16 +++++----------- contrib/downtime/theme.php | 1 - 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/contrib/downtime/main.php b/contrib/downtime/main.php index 7c4261c0..67727b31 100644 --- a/contrib/downtime/main.php +++ b/contrib/downtime/main.php @@ -27,22 +27,16 @@ class Downtime implements Extension { if($event instanceof PageRequestEvent) { if($config->get_bool("downtime")) { - $this->check_downtime($event); + if(!$user->is_admin() && !$this->is_safe_page($event)) { + $msg = $config->get_string("downtime_message"); + $this->theme->display_message($msg); + exit; + } $this->theme->display_notification($page); } } } - private function check_downtime(PageRequestEvent $event) { - global $user, $config; - - if($config->get_bool("downtime") && !$user->is_admin() && - ($event instanceof PageRequestEvent) && !$this->is_safe_page($event)) { - $msg = $config->get_string("downtime_message"); - $this->theme->display_message($msg); - } - } - private function is_safe_page(PageRequestEvent $event) { if($event->page_matches("user_admin/login")) return true; else return false; diff --git a/contrib/downtime/theme.php b/contrib/downtime/theme.php index 749a47c1..7fe05ed0 100644 --- a/contrib/downtime/theme.php +++ b/contrib/downtime/theme.php @@ -51,7 +51,6 @@ class DowntimeTheme extends Themelet { EOD; - exit; } } ?>