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';