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