diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2006-07-31 19:24:16 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2006-07-31 19:24:16 +0000 |
commit | 90acf993417f3109536f4d95f3acdb12065e1631 (patch) | |
tree | 917d2e41bb8797583e2994df0b529333a75eb02e /includes/database.mysql.inc | |
parent | 2cc410304d21aec3cd26c0573c3952c36260a188 (diff) | |
download | brdo-90acf993417f3109536f4d95f3acdb12065e1631.tar.gz brdo-90acf993417f3109536f4d95f3acdb12065e1631.tar.bz2 |
#75264: Redirect uninstalled default Drupal site to install.php
Diffstat (limited to 'includes/database.mysql.inc')
-rw-r--r-- | includes/database.mysql.inc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/includes/database.mysql.inc b/includes/database.mysql.inc index 731107be8..db4610884 100644 --- a/includes/database.mysql.inc +++ b/includes/database.mysql.inc @@ -51,6 +51,13 @@ function db_connect($url) { // (matched) rows, not the number of affected rows. $connection = @mysql_connect($url['host'], $url['user'], $url['pass'], TRUE, 2); if (!$connection) { + // Redirect to installer if using default DB credentials + if ($url['user'] == 'username' && $url['pass'] == 'password') { + include_once 'includes/install.inc'; + install_goto('install.php'); + } + + // Show error screen otherwise drupal_maintenance_theme(); 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> |