Fixed PHP Fatal error when config-user.php missing

This commit is contained in:
Maurice Meyer 2017-07-21 17:21:17 +02:00
parent f238b7edaa
commit 921b30e47d
2 changed files with 6 additions and 2 deletions

View file

@ -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");
}

View file

@ -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.");
}