Index: modules/block/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.module,v
retrieving revision 1.427
diff -u -r1.427 block.module
--- modules/block/block.module	31 Jul 2010 12:54:58 -0000	1.427
+++ modules/block/block.module	12 Aug 2010 23:28:37 -0000
@@ -682,7 +682,13 @@
  * Load blocks information from the database.
  */
 function _block_load_blocks() {
-  global $theme_key;
+  global $theme_key, $user;
+  
+  // If the user is not logged in and maintenance mode is enabled, do not allow
+  // any blocks to be loaded.
+  if (variable_get('maintenance_mode', FALSE) && $user->uid == 0) {
+    return array();
+  }
 
   $query = db_select('block', 'b');
   $result = $query
