aboutsummaryrefslogtreecommitdiffstats
path: root/mod/setup.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/setup.php')
-rwxr-xr-xmod/setup.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/mod/setup.php b/mod/setup.php
index 751f8bdf8..b76fa7be1 100755
--- a/mod/setup.php
+++ b/mod/setup.php
@@ -38,6 +38,10 @@ function setup_post(&$a) {
require_once('include/dba/dba_driver.php');
unset($db);
$db = dba_factory($dbhost, $dbport, $dbuser, $dbpass, $dbdata, true);
+ if(! $db->connected) {
+ echo "Database Connect failed: " . $db->error;
+ killme();
+ }
/*if(get_db_errno()) {
unset($db);
$db = dba_factory($dbhost, $dbport, $dbuser, $dbpass, '', true);
@@ -80,6 +84,11 @@ function setup_post(&$a) {
// connect to db
$db = dba_factory($dbhost, $dbport, $dbuser, $dbpass, $dbdata, true);
+ if(! $db->connected) {
+ echo 'CRITICAL: DB not connected.';
+ killme();
+ }
+
$tpl = get_intltext_template('htconfig.tpl');
$txt = replace_macros($tpl,array(
'$dbhost' => $dbhost,