Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.1198
diff -u -r1.1198 user.module
--- modules/user/user.module	5 Sep 2010 02:21:38 -0000	1.1198
+++ modules/user/user.module	6 Sep 2010 22:47:46 -0000
@@ -1763,12 +1763,12 @@
         case 'user/login':
         case 'user/password':
           // Disable offline mode.
-          $menu_site_status = MENU_SITE_ONLINE;
+          $menu_site_status = MENU_SITE_SEMI_ONLINE;
           break;
         default:
           if (strpos($path, 'user/reset/') === 0) {
             // Disable offline mode.
-            $menu_site_status = MENU_SITE_ONLINE;
+            $menu_site_status = MENU_SITE_SEMI_ONLINE;
           }
           break;
       }
Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.408
diff -u -r1.408 menu.inc
--- includes/menu.inc	1 Sep 2010 02:59:04 -0000	1.408
+++ includes/menu.inc	6 Sep 2010 22:48:19 -0000
@@ -244,6 +244,14 @@
 define('MENU_SITE_ONLINE', 5);
 
 /**
+ * Internal menu status code -- Site is offline, but show this content using the
+ * "maintenance" page template anyway. Useful for showing the user login and
+ * password retrieval forms while the site is in maintenance mode, but not
+ * showing any other page content besides that (such as sidebar content, etc).
+ */
+define('MENU_SITE_SEMI_ONLINE', 6);
+
+/**
  * @} End of "Menu status codes".
  */
 
@@ -457,16 +465,16 @@
  */
 function menu_execute_active_handler($path = NULL, $deliver = TRUE) {
   // Check if site is offline.
-  $page_callback_result = _menu_site_is_offline() ? MENU_SITE_OFFLINE : MENU_SITE_ONLINE;
+  $offline_status = _menu_site_is_offline() ? MENU_SITE_OFFLINE : MENU_SITE_ONLINE;
 
   // Allow other modules to change the site status but not the path because that
   // would not change the global variable. hook_url_inbound_alter() can be used
   // to change the path. Code later will not use the $read_only_path variable.
   $read_only_path = !empty($path) ? $path : $_GET['q'];
-  drupal_alter('menu_site_status', $page_callback_result, $read_only_path);
+  drupal_alter('menu_site_status', $offline_status, $read_only_path);
 
   // Only continue if the site status is not set.
-  if ($page_callback_result == MENU_SITE_ONLINE) {
+  if ($offline_status == MENU_SITE_ONLINE || $offline_status == MENU_SITE_SEMI_ONLINE) {
     // Rebuild if we know it's needed, or if the menu masks are missing which
     // occurs rarely, likely due to a race condition of multiple rebuilds.
     if (variable_get('menu_rebuild_needed', FALSE) || !variable_get('menu_masks', array())) {
@@ -487,12 +495,21 @@
       $page_callback_result = MENU_NOT_FOUND;
     }
   }
+  else {
+    $page_callback_result = $offline_status;
+  }
 
   // Deliver the result of the page callback to the browser, or if requested,
   // return it raw, so calling code can do more processing.
   if ($deliver) {
-    $default_delivery_callback = (isset($router_item) && $router_item) ? $router_item['delivery_callback'] : NULL;
-    drupal_deliver_page($page_callback_result, $default_delivery_callback);
+    if ($offline_status == MENU_SITE_SEMI_ONLINE && !is_int($page_callback_result)) {
+      drupal_maintenance_theme();
+      print theme('maintenance_page', array('content' => drupal_render($page_callback_result)));
+    }
+    else {
+      $default_delivery_callback = (isset($router_item) && $router_item) ? $router_item['delivery_callback'] : NULL;
+      drupal_deliver_page($page_callback_result, $default_delivery_callback);
+    }
   }
   else {
     return $page_callback_result;
