correctly add user-wide mysql-user when creating user with mysql-resources (accesst to all databases starting with the loginname)

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2024-03-04 10:21:46 +01:00
parent c0fdc62032
commit b675c84ae4

View File

@@ -770,7 +770,7 @@ class Customers extends ApiCommand implements ResourceEntity
$dbm = new DbManager($this->logger());
// 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) {
$dbm->getManager()->grantPrivilegesTo($loginname, $password, $mysql_access_host, false, false);
$dbm->getManager()->grantPrivilegesTo($loginname, $password, $mysql_access_host, false, false, true);
}
$dbm->getManager()->flushPrivileges();
Database::needRoot(false);