mirror of
https://github.com/Froxlor/Froxlor.git
synced 2024-09-21 02:17:34 +00:00
check for global customer mysql user existence when updating password
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
parent
7934684982
commit
9f44b21a04
@ -228,7 +228,12 @@ if ($page == 'overview') {
|
||||
$dbm = new DbManager($log);
|
||||
// give permission to the user on every access-host we have
|
||||
foreach (array_map('trim', explode(',', Settings::Get('system.mysql_access_host'))) as $mysql_access_host) {
|
||||
if ($dbm->getManager()->userExistsOnHost($userinfo['loginname'], $mysql_access_host)) {
|
||||
$dbm->getManager()->grantPrivilegesTo($userinfo['loginname'], $new_password, $mysql_access_host, false, true);
|
||||
} else {
|
||||
// create global mysql user if not exists
|
||||
$dbm->getManager()->grantPrivilegesTo($userinfo['loginname'], $new_password, $mysql_access_host, false, false, true);
|
||||
}
|
||||
}
|
||||
$dbm->getManager()->flushPrivileges();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user