From 0924dd5cc88cf33b9a459f1f0e8b57601698d367 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 14 Dec 2014 23:36:21 -0500 Subject: [PATCH] Revert the removal of some features...for now This reverts commit f61c05ac34f3ebf0067de022a30c88564846b4dc. --- admin/admin_settings.php | 14 ++++++++++++++ admin/admin_settings_save.php | 6 +++++- admin/admin_ticket.php | 2 +- admin/index.php | 1 + inc/header.inc.php | 4 ++++ maintenance.php | 24 ++++++++++++++++++++++++ modsForHesk_settings.inc.php | 5 ++++- 7 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 maintenance.php diff --git a/admin/admin_settings.php b/admin/admin_settings.php index 4ac24a06..a0899dd4 100644 --- a/admin/admin_settings.php +++ b/admin/admin_settings.php @@ -1817,6 +1817,20 @@ if ( defined('HESK_DEMO') ) +
+ +
+
+ +
+
+
diff --git a/admin/admin_settings_save.php b/admin/admin_settings_save.php index bb29ae1c..d409ba78 100644 --- a/admin/admin_settings_save.php +++ b/admin/admin_settings_save.php @@ -537,6 +537,7 @@ $set['hesk_version'] = $hesk_settings['hesk_version']; // Save the modsForHesk_settings.inc.php file $set['rtl'] = empty($_POST['rtl']) ? 0 : 1; $set['show-icons'] = empty($_POST['show-icons']) ? 0 : 1; +$set['maintenance-mode'] = empty($_POST['maintenance-mode']) ? 0 : 1; $set['navbarBackgroundColor'] = hesk_input(hesk_POST('navbarBackgroundColor')); $set['navbarBrandColor'] = hesk_input(hesk_POST('navbarBrandColor')); $set['navbarBrandHoverColor'] = hesk_input(hesk_POST('navbarBrandHoverColor')); @@ -567,7 +568,10 @@ $modsForHesk_settings[\'questionMarkColor\'] = \''.$set['questionMarkColor'].'\' $modsForHesk_settings[\'rtl\'] = '.$set['rtl'].'; //-- Set this to 1 to show icons next to navigation menu items -$modsForHesk_settings[\'show_icons\'] = '.$set['show-icons'].';'; +$modsForHesk_settings[\'show_icons\'] = '.$set['show-icons'].'; + +//-- Set this to 1 to enable maintenance mode +$modsForHesk_settings[\'maintenance_mode\'] = '.$set['maintenance-mode'].';'; // Write the file if ( ! file_put_contents(HESK_PATH . 'modsForHesk_settings.inc.php', $modsForHesk_file_content) ) diff --git a/admin/admin_ticket.php b/admin/admin_ticket.php index a55e8985..64b9bef9 100644 --- a/admin/admin_ticket.php +++ b/admin/admin_ticket.php @@ -1020,7 +1020,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
-
:
+
: '.$ticket['ip'].''; ?>
diff --git a/admin/index.php b/admin/index.php index 25f222b6..f23f0ffe 100644 --- a/admin/index.php +++ b/admin/index.php @@ -34,6 +34,7 @@ define('IN_SCRIPT',1); define('HESK_PATH','../'); +define('ON_LOGIN_PAGE',1); /* Get all the required files and functions */ require(HESK_PATH . 'hesk_settings.inc.php'); diff --git a/inc/header.inc.php b/inc/header.inc.php index 70375a1a..90b4810e 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 . 'modsForHesk_settings.inc.php'); +// Check to see if we're in maintenance mode before sending anything to the DOM +if ($modsForHesk_settings['maintenance_mode'] && !defined('ON_MAINTENANCE_PAGE') && !defined('ON_LOGIN_PAGE')) { + header('Location: '.HESK_PATH.'maintenance.php'); +} ?> diff --git a/maintenance.php b/maintenance.php new file mode 100644 index 00000000..0037c119 --- /dev/null +++ b/maintenance.php @@ -0,0 +1,24 @@ + +
+
+
+

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

+
+
+ \ No newline at end of file diff --git a/modsForHesk_settings.inc.php b/modsForHesk_settings.inc.php index 2d9a5780..fa9c9135 100644 --- a/modsForHesk_settings.inc.php +++ b/modsForHesk_settings.inc.php @@ -17,4 +17,7 @@ $modsForHesk_settings['questionMarkColor'] = '#000000'; $modsForHesk_settings['rtl'] = 0; //-- Set this to 1 to show icons next to navigation menu items -$modsForHesk_settings['show_icons'] = 0; \ No newline at end of file +$modsForHesk_settings['show_icons'] = 0; + +//-- Set this to 1 to enable maintenance mode +$modsForHesk_settings['maintenance_mode'] = 0; \ No newline at end of file