From ed15ec5bb5536e33fa3c708625a462db5f97f60a Mon Sep 17 00:00:00 2001 From: Krombel Date: Sat, 3 Mar 2018 14:21:41 +0100 Subject: [PATCH] add register_bot as user on database creation --- database.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/database.php b/database.php index 3181328..ac034fd 100644 --- a/database.php +++ b/database.php @@ -61,6 +61,13 @@ class mxDatabase create_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, last_modified TIMESTAMP DEFAULT CURRENT_TIMESTAMP )"); + // make sure the bot is allowed to login + require_once("config.php"); + $password = $this->addUser("Register", "Bot", "register_bot", $register_email); + $config["register_password"] = $password; + $myfile = fopen("config.json", "w"); + fwrite($myfile, json_encode($config, JSON_PRETTY_PRINT)); + fclose($myfile); } else { // establish connection