From bdf2460755a5bd73666c6e05c1da1fae77283f61 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 14 Sep 2014 01:36:13 -0400 Subject: [PATCH] Closes #34: Very basic maintenance mode up and running --- inc/header.inc.php | 5 +++++ maintenance.php | 24 ++++++++++++++++++++++++ nuMods_settings.inc.php | 3 +++ 3 files changed, 32 insertions(+) create mode 100644 maintenance.php diff --git a/inc/header.inc.php b/inc/header.inc.php index e8d28894..0f76fa02 100644 --- a/inc/header.inc.php +++ b/inc/header.inc.php @@ -35,6 +35,10 @@ /* Check if this is a valid include */ if (!defined('IN_SCRIPT')) {die('Invalid attempt');} require(HESK_PATH . 'nuMods_settings.inc.php'); +// Check to see if we're in maintenance mode before sending anything to the DOM +if ($nuMods_settings['maintenance_mode'] && !defined('ON_MAINTENANCE_PAGE')) { + header('Location: '.HESK_PATH.'maintenance.php'); +} ?> @@ -62,6 +66,7 @@ require(HESK_PATH . 'nuMods_settings.inc.php'); +
+
+
+

The helpdesk is currently undergoing maintenance. Please come back later.

+
+
+ \ No newline at end of file diff --git a/nuMods_settings.inc.php b/nuMods_settings.inc.php index 09b5bb15..b30b23cf 100644 --- a/nuMods_settings.inc.php +++ b/nuMods_settings.inc.php @@ -19,5 +19,8 @@ $nuMods_settings['rtl'] = 0; //-- Set this to 1 to show icons next to navigation menu items $nuMods_settings['show_icons'] = 0; +//-- Set this to 1 to enable maintenance mode +$nuMods_settings['maintenance_mode'] = 0; + /* DO NOT EDIT ANYTHING BELOW THIS LINE */ $nuMods_settings['version']='1.3.0';