From 676931a4a9ba69ad15bf05557e05491fcb390d26 Mon Sep 17 00:00:00 2001 From: ruan Date: Mon, 11 Jan 2016 08:10:11 +0200 Subject: [PATCH] Add unconfigured.php --- error/unconfigured.php | 28 ++++++++++++++++++++++++++++ inc/settings.php | 8 ++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 error/unconfigured.php diff --git a/error/unconfigured.php b/error/unconfigured.php new file mode 100644 index 0000000..a2d941e --- /dev/null +++ b/error/unconfigured.php @@ -0,0 +1,28 @@ + + + + + + + litebans-php - Unconfigured + + + +
+
+

Unconfigured


+ +
+ Welcome to the LiteBans web interface! +
+ To get started, edit inc/settings.php and fill in your database information. +
+ After configuration has been completed, click "Try Again". +
+
+
+ Try Again +
+
+ + diff --git a/inc/settings.php b/inc/settings.php index 2a122a2..5685f9f 100644 --- a/inc/settings.php +++ b/inc/settings.php @@ -16,8 +16,8 @@ final class Settings { $database = 'litebans'; - $username = 'root'; - $password = 'password'; + $username = ''; + $password = ''; // If you set a table prefix in config.yml, set it here as well $table_prefix = "litebans_"; @@ -96,6 +96,10 @@ final class Settings { $this->driver = $driver; if ($connect) { + if ($username === "" && $password === "") { + $this->redirect("error/unconfigured.php"); + } + $dsn = "$driver:dbname=$database;host=$host;port=$port"; if ($driver === 'mysql') { $dsn .= ';charset=utf8';