add register_bot as user on database creation

This commit is contained in:
2018-03-03 14:21:41 +01:00
parent 01f124f744
commit ed15ec5bb5

View File

@@ -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