From d2b0c4651093e558b2f015dfe4715732c79b8073 Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Thu, 2 Sep 2021 17:01:28 +0200 Subject: [PATCH] un-hard-coded db name and server --- admin.php | 2 +- config/README.md | 4 ++++ config/instance.conf | 2 ++ macros/README.md | 26 ++++++++++++++------------ macros/pass3_install-config.json | 2 ++ threadr/board/board.php | 2 +- threadr/board/index.php | 2 +- threadr/boards/index.php | 2 +- threadr/login/redirect.php | 2 +- threadr/profile/index.php | 2 +- threadr/signup/verify-email/index.php | 2 +- threadr/userhome/index.php | 2 +- 12 files changed, 30 insertions(+), 20 deletions(-) diff --git a/admin.php b/admin.php index adc1f72..6c925c6 100644 --- a/admin.php +++ b/admin.php @@ -15,7 +15,7 @@ $random_salt = generate_salt($permitted_chars); $password_hash_method = "sha256"; - $pdo = new PDO('mysql:host=localhost;dbname=web', '%DB_USERNAME%', '%DB_PASSWORD%'); + $pdo = new PDO('mysql:host=%DB_SERVER%;dbname=%DB_NAME%', '%DB_USERNAME%', '%DB_PASSWORD%'); $query = "SELECT id, name, authentication_algorithm FROM users;"; if (isset($_GET['action'])) { diff --git a/config/README.md b/config/README.md index cbab430..cb5906a 100644 --- a/config/README.md +++ b/config/README.md @@ -7,6 +7,10 @@ configuration for a specific instance - threadr_dir= - db_username= - db_password= +- db_database= +- db_svr_host= + +I know some of these option names are silly but they all have the same length. -BodgeMaster The format is strictly `