Disallow installing Rhymix with the DB root account

This commit is contained in:
Kijin Sung 2020-12-16 00:04:39 +09:00
parent 9ba8c9159e
commit 2de3bbcea7
3 changed files with 8 additions and 0 deletions

View file

@ -32,6 +32,12 @@ class installController extends install
// Get DB config variables.
$config = Context::gets('db_type', 'db_host', 'db_port', 'db_user', 'db_pass', 'db_database', 'db_prefix');
// Disallow installation using the root account.
if (trim($config->db_user) === 'root')
{
return new BaseObject(-1, 'msg_dbroot_disallowed');
}
// Create a temporary setting object.
Rhymix\Framework\Config::set('db.master', array(
'type' => $config->db_type,