Index: index.php
===================================================================
RCS file: /cvs/drupal/drupal/index.php,v
retrieving revision 1.87
diff -u -r1.87 index.php
--- index.php	28 Aug 2005 18:26:20 -0000	1.87
+++ index.php	29 Sep 2005 22:32:08 -0000
@@ -20,6 +20,9 @@
   case MENU_ACCESS_DENIED:
     drupal_access_denied();
     break;
+  case MENU_SITE_OFFLINE:
+    drupal_site_offline();
+    break;
   default:
     if (!empty($return)) {
       print theme('page', $return);
Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.85
diff -u -r1.85 menu.inc
--- includes/menu.inc	18 Sep 2005 17:03:26 -0000	1.85
+++ includes/menu.inc	29 Sep 2005 22:32:10 -0000
@@ -164,6 +164,7 @@
 define('MENU_FOUND', 1);
 define('MENU_NOT_FOUND', 2);
 define('MENU_ACCESS_DENIED', 3);
+define('MENU_SITE_OFFLINE', 4);
 
 /**
  * @} End of "Menu status codes".
@@ -324,6 +325,12 @@
  * act as if the user were in a different location on the site.
  */
 function menu_execute_active_handler() {
+  global $user;
+
+  if ($user->uid != 1 && variable_get('site_offline', 0)) {
+    return MENU_SITE_OFFLINE;
+  }
+
   $menu = menu_get_menu();
 
   // Determine the menu item containing the callback.
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.480
diff -u -r1.480 common.inc
--- includes/common.inc	29 Sep 2005 12:33:34 -0000	1.480
+++ includes/common.inc	29 Sep 2005 22:32:11 -0000
@@ -263,6 +263,16 @@
   exit();
 }
 
+
+/**
+ * Generates a site offline message
+ */
+function drupal_site_offline() {
+  $msg = variable_get('site_offline_message', 'Under maintenance');
+  drupal_set_title(t('Site Offline'));
+  print theme('maintenance_page', $msg);
+}
+
 /**
  * Generates a 404 error if the request can not be handled.
  */
Index: modules/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system.module,v
retrieving revision 1.235
diff -u -r1.235 system.module
--- modules/system.module	18 Sep 2005 10:37:57 -0000	1.235
+++ modules/system.module	29 Sep 2005 22:32:12 -0000
@@ -279,6 +279,12 @@
 
   $output .= form_group_collapsible(t('Date settings'), $group, TRUE);
 
+  // Site Offline/Maintenance settings
+  $group = '';
+  $group .= form_radios(t('Site Status'), 'site_offline', variable_get('site_offline', 0), array(t('Online'), t('Offline')), t('This allows you to take the site offline for maintenance.'));
+  $group .= form_textarea(t('Site Offline Message'), 'site_offline_message', variable_get('site_offline_message', 'Site is currently under maintenance. Please come back later.'), 60, 5, t('This text will be displayed when the site is offline.'));
+  $output .= form_group_collapsible(t('Site Maintenance'), $group, TRUE);
+
   // String handling: report status and errors.
   $output .= form_group_collapsible(t('String handling'), unicode_settings(), TRUE);
 
