Skip to content

Commit

Permalink
correctly convert allowed_mysqlserver json-string to array
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Kaufmann <[email protected]>
  • Loading branch information
d00p committed Mar 3, 2024
1 parent b14eaf4 commit c0fdc62
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Froxlor/Api/Commands/Customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,8 @@ public function update()
]);

// enable/disable global mysql-user (loginname)
foreach ($result['allowed_mysqlserver'] as $dbserver) {
$current_allowed_mysqlserver = isset($result['allowed_mysqlserver']) && !empty($result['allowed_mysqlserver']) ? json_decode($result['allowed_mysqlserver'], true) : [];
foreach ($current_allowed_mysqlserver as $dbserver) {
// require privileged access for target db-server
Database::needRoot(true, $dbserver, false);
// get DbManager
Expand Down Expand Up @@ -1674,7 +1675,8 @@ public function delete()
$id = $result['customerid'];

// remove global mysql-user (loginname)
foreach ($result['allowed_mysqlserver'] as $dbserver) {
$current_allowed_mysqlserver = isset($result['allowed_mysqlserver']) && !empty($result['allowed_mysqlserver']) ? json_decode($result['allowed_mysqlserver'], true) : [];
foreach ($current_allowed_mysqlserver as $dbserver) {
// require privileged access for target db-server
Database::needRoot(true, $dbserver, false);
// get DbManager
Expand Down

0 comments on commit c0fdc62

Please sign in to comment.