﻿Index: includes/database.mysql.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database.mysql.inc,v
retrieving revision 1.83
diff -u -p -r1.83 database.mysql.inc
--- includes/database.mysql.inc	20 Oct 2007 21:57:49 -0000	1.83
+++ includes/database.mysql.inc	25 Nov 2007 13:29:03 -0000
@@ -88,32 +88,22 @@ function db_connect($url) {
     // Show error screen otherwise
     drupal_maintenance_theme();
     drupal_set_header('HTTP/1.1 503 Service Unavailable');
-    drupal_set_title('Unable to connect to database server');
-    print theme('maintenance_page', '<p>If you still have to install Drupal, proceed to the <a href="'. base_path() .'install.php">installation page</a>.</p>
-<p>If you have already finished installing Drupal, this either means that the username and password information in your <code>settings.php</code> file is incorrect or that we can\'t connect to the MySQL database server. This could mean your hosting provider\'s database server is down.</p>
-<p>The MySQL error was: '. theme('placeholder', mysql_error()) .'.</p>
-<p>Currently, the username is '. theme('placeholder', $url['user']) .' and the database server is '. theme('placeholder', $url['host']) .'.</p>
-<ul>
-  <li>Are you sure you have the correct username and password?</li>
-  <li>Are you sure that you have typed the correct hostname?</li>
-  <li>Are you sure that the database server is running?</li>
-</ul>
-<p>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.</p>');
+    drupal_set_title('Site off-line');
+    $db_error_message = ini_get('display_errors') ? 'The MySQL error was: '. theme('placeholder', mysql_error()) .'. ': '';
+    print theme('maintenance_page', '<p>The site is currently not available due to technical problems. Please try again later. Thank you for your understanding.</p>
+<hr />
+<p><small>If you are the maintainer of this site, please check your database settings in the <code>settings.php</code> file, and whether your hosting provider\'s database server is running. '. $db_error_message .'For more help, see the <a href="http://drupal.org/node/258">handbook</a>, or contact your hosting provider.</small></p>');
     exit;
   }
 
   if (!mysql_select_db(substr($url['path'], 1))) {
     drupal_maintenance_theme();
-    drupal_set_title('Unable to select database');
-    print theme('maintenance_page', '<p>We were able to connect to the MySQL database server (which means your username and password are okay) but not able to select the database.</p>
-<p>The MySQL error was: '. theme('placeholder', mysql_error($connection)) .'.</p>
-<p>Currently, the database is '. theme('placeholder', substr($url['path'], 1)) .'. The username is '. theme('placeholder', $url['user']) .' and the database server is '. theme('placeholder', $url['host']) .'.</p>
-<ul>
-  <li>Are you sure you have the correct database name?</li>
-  <li>Are you sure the database exists?</li>
-  <li>Are you sure the username has permission to access the database?</li>
-</ul>
-<p>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.</p>');
+    drupal_set_header('HTTP/1.1 503 Service Unavailable');
+    drupal_set_title('Site off-line');
+    $db_error_message = ini_get('display_errors') ? 'The MySQL error was: '. theme('placeholder', mysql_error()) .'. ': '';
+    print theme('maintenance_page', '<p>The site is currently not available due to technical problems. Please try again later. Thank you for your understanding.</p>
+<hr />
+<p><small>If you are the maintainer of this site, please check your database settings in the <code>settings.php</code> file. '. $db_error_message .'For more help, see the <a href="http://drupal.org/node/258">handbook</a>, or contact your hosting provider.</small></p>');
     exit;
   }
 
Index: includes/database.mysqli.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database.mysqli.inc,v
retrieving revision 1.48
diff -u -p -r1.48 database.mysqli.inc
--- includes/database.mysqli.inc	20 Oct 2007 21:57:49 -0000	1.48
+++ includes/database.mysqli.inc	25 Nov 2007 13:29:04 -0000
@@ -86,32 +86,21 @@ function db_connect($url) {
   if (mysqli_connect_errno() >= 2000 || mysqli_connect_errno() == 1045) {
     drupal_maintenance_theme();
     drupal_set_header('HTTP/1.1 503 Service Unavailable');
-    drupal_set_title('Unable to connect to database server');
-    print theme('maintenance_page', '<p>If you still have to install Drupal, proceed to the <a href="'. base_path() .'install.php">installation page</a>.</p>
-<p>If you have already finished installing Drupal, this either means that the username and password information in your <code>settings.php</code> file is incorrect or that we can\'t connect to the MySQL database server. This could mean your hosting provider\'s database server is down.</p>
-<p>The MySQL error was: '. theme('placeholder', mysqli_connect_error()) .'.</p>
-<p>Currently, the username is '. theme('placeholder', $url['user']) .' and the database server is '. theme('placeholder', $url['host']) .'.</p>
-<ul>
-  <li>Are you sure you have the correct username and password?</li>
-  <li>Are you sure that you have typed the correct hostname?</li>
-  <li>Are you sure that the database server is running?</li>
-  <li>Are you sure that the mysqli libraries are compiled in your PHP installation? Try using the mysql library instead by editing your <code>settings.php</code> configuration file in Drupal.</li>
-</ul>
-<p>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.</p>');
+    drupal_set_title('Site off-line');
+    $db_error_message = ini_get('display_errors') ? 'The MySQLi error was: '. theme('placeholder', mysqli_connect_error()) .'. ': '';
+    print theme('maintenance_page', '<p>The site is currently not available due to technical problems. Please try again later. Thank you for your understanding.</p>
+<hr />
+<p><small>If you are the maintainer of this site, please check your database settings in the <code>settings.php</code> file, and whether your hosting provider\'s database server is running. '. $db_error_message .'For more help, see the <a href="http://drupal.org/node/258">handbook</a>, or contact your hosting provider.</small></p>');
     exit;
   }
   else if (mysqli_connect_errno() > 0) {
     drupal_maintenance_theme();
-    drupal_set_title('Unable to select database');
-    print theme('maintenance_page', '<p>We were able to connect to the MySQL database server (which means your username and password are okay) but not able to select the database.</p>
-<p>The MySQL error was: '. theme('placeholder', mysqli_connect_error()) .'.</p>
-<p>Currently, the database is '. theme('placeholder', substr($url['path'], 1)) .'. The username is '. theme('placeholder', $url['user']) .' and the database server is '. theme('placeholder', $url['host']) .'.</p>
-<ul>
-  <li>Are you sure you have the correct database name?</li>
-  <li>Are you sure the database exists?</li>
-  <li>Are you sure the username has permission to access the database?</li>
-</ul>
-<p>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.</p>');
+    drupal_set_header('HTTP/1.1 503 Service Unavailable');
+    drupal_set_title('Site off-line');
+    $db_error_message = ini_get('display_errors') ? 'The MySQLi error was: '. theme('placeholder', mysqli_connect_error()) .'. ': '';
+    print theme('maintenance_page', '<p>The site is currently not available due to technical problems. Please try again later. Thank you for your understanding.</p>
+<hr />
+<p><small>If you are the maintainer of this site, please check your database settings in the <code>settings.php</code> file. '. $db_error_message .'For more help, see the <a href="http://drupal.org/node/258">handbook</a>, or contact your hosting provider.</small></p>');
     exit;
   }
 
Index: includes/database.pgsql.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database.pgsql.inc,v
retrieving revision 1.63
diff -u -p -r1.63 database.pgsql.inc
--- includes/database.pgsql.inc	17 Oct 2007 12:47:28 -0000	1.63
+++ includes/database.pgsql.inc	25 Nov 2007 13:29:05 -0000
@@ -84,18 +84,11 @@ function db_connect($url) {
   if (!$connection) {
     drupal_maintenance_theme();
     drupal_set_header('HTTP/1.1 503 Service Unavailable');
-    drupal_set_title('Unable to connect to database');
-    print theme('maintenance_page', '<p>If you still have to install Drupal, proceed to the <a href="'. base_path() .'install.php">installation page</a>.</p>
-<p>If you have already finished installing Drupal, this either means that the username and password information in your <code>settings.php</code> file is incorrect or that we can\'t connect to the PostgreSQL database server. This could mean your hosting provider\'s database server is down.</p>
-<p>The PostgreSQL error was: '. theme('placeholder', decode_entities($php_errormsg)) .'</p>
-<p>Currently, the database is '. theme('placeholder', substr($url['path'], 1)) .', the username is '. theme('placeholder', $url['user']) .', and the database server is '. theme('placeholder', $url['host']) .'.</p>
-<ul>
-  <li>Are you sure you have the correct username and password?</li>
-  <li>Are you sure that you have typed the correct hostname?</li>
-  <li>Are you sure you have the correct database name?</li>
-  <li>Are you sure that the database server is running?</li>
-</ul>
-<p>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.</p>');
+    drupal_set_title('Site off-line');    
+    $db_error_message = ini_get('display_errors') ? 'The PostgreSQL error was: '. theme('placeholder', decode_entities($php_errormsg)) .'. ': '';
+    print theme('maintenance_page', '<p>The site is currently not available due to technical problems. Please try again later. Thank you for your understanding.</p>
+<hr />
+<p><small>If you are the maintainer of this site, please check your database settings in the <code>settings.php</code> file, and whether your hosting provider\'s database server is running. '. $db_error_message .'For more help, see the <a href="http://drupal.org/node/258">handbook</a>, or contact your hosting provider.</small></p>');
     exit;
   }
 
