diff --git a/config/config-default.php b/config/config-default.php index fa8ad51..38bae70 100644 --- a/config/config-default.php +++ b/config/config-default.php @@ -25,4 +25,8 @@ $config['db_name'] = "pdnsmanager"; $config['nonce_lifetime'] = 15; //Number of rows in domain overview $config['domain_rows'] = 15; -require 'config-user.php'; + +// If config-user.php does not exist, redirect to the setup page +if(!(include 'config-user.php')) { + Header("Location: install.php"); +} diff --git a/lib/database.php b/lib/database.php index 3ca4790..b871cce 100644 --- a/lib/database.php +++ b/lib/database.php @@ -18,5 +18,5 @@ try { $db = new PDO($config['db_type'].":dbname=".$config['db_name'].";host=".$config['db_host'].";port=".strval($config['db_port']), $config['db_user'], $config['db_password']); } catch (PDOException $e) { - die("Connection to database failed"); + die("Connection to the database failed. There is an error in the database configuration."); }