mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-07-09 23:37:32 +00:00
Add unconfigured.php
This commit is contained in:
parent
f77a5944d0
commit
676931a4a9
28
error/unconfigured.php
Normal file
28
error/unconfigured.php
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta name="description" content="">
|
||||||
|
<title>litebans-php - Unconfigured</title>
|
||||||
|
<link href="../inc/css/bootstrap.min.css" rel="stylesheet">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<div class="jumbotron">
|
||||||
|
<h2>Unconfigured</h2><br>
|
||||||
|
|
||||||
|
<div class="text-success">
|
||||||
|
Welcome to the LiteBans web interface!
|
||||||
|
<br>
|
||||||
|
To get started, edit <a class="text-warning">inc/settings.php</a> and fill in your database information.
|
||||||
|
<br>
|
||||||
|
After configuration has been completed, click <a class="text-warning">"Try Again"</a>.
|
||||||
|
<br>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
<a href="../" class="btn btn-default">Try Again</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -16,8 +16,8 @@ final class Settings {
|
|||||||
|
|
||||||
$database = 'litebans';
|
$database = 'litebans';
|
||||||
|
|
||||||
$username = 'root';
|
$username = '';
|
||||||
$password = 'password';
|
$password = '';
|
||||||
|
|
||||||
// If you set a table prefix in config.yml, set it here as well
|
// If you set a table prefix in config.yml, set it here as well
|
||||||
$table_prefix = "litebans_";
|
$table_prefix = "litebans_";
|
||||||
@ -96,6 +96,10 @@ final class Settings {
|
|||||||
|
|
||||||
$this->driver = $driver;
|
$this->driver = $driver;
|
||||||
if ($connect) {
|
if ($connect) {
|
||||||
|
if ($username === "" && $password === "") {
|
||||||
|
$this->redirect("error/unconfigured.php");
|
||||||
|
}
|
||||||
|
|
||||||
$dsn = "$driver:dbname=$database;host=$host;port=$port";
|
$dsn = "$driver:dbname=$database;host=$host;port=$port";
|
||||||
if ($driver === 'mysql') {
|
if ($driver === 'mysql') {
|
||||||
$dsn .= ';charset=utf8';
|
$dsn .= ';charset=utf8';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user