diff options
Diffstat (limited to 'includes/pages/admin_groups.php')
-rw-r--r-- | includes/pages/admin_groups.php | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/includes/pages/admin_groups.php b/includes/pages/admin_groups.php index c483a79d..ea0d4dbc 100644 --- a/includes/pages/admin_groups.php +++ b/includes/pages/admin_groups.php @@ -107,23 +107,21 @@ function admin_groups() return error('Incomplete call, missing Groups ID.', true); } - $group = DB::select('SELECT * FROM `Groups` WHERE `UID`=? LIMIT 1', [$group_id]); + $group = DB::selectOne('SELECT * FROM `Groups` WHERE `UID`=? LIMIT 1', [$group_id]); $privileges = $request->get('privileges'); if (!is_array($privileges)) { $privileges = []; } if (!empty($group)) { - $group = array_shift($group); DB::delete('DELETE FROM `GroupPrivileges` WHERE `group_id`=?', [$group_id]); $privilege_names = []; foreach ($privileges as $privilege) { if (preg_match('/^\d{1,}$/', $privilege)) { - $group_privileges_source = DB::select( + $group_privileges_source = DB::selectOne( 'SELECT `name` FROM `Privileges` WHERE `id`=? LIMIT 1', [$privilege] ); if (!empty($group_privileges_source)) { - $group_privileges_source = array_shift($group_privileges_source); DB::insert( 'INSERT INTO `GroupPrivileges` (`group_id`, `privilege_id`) VALUES (?, ?)', [$group_id, $privilege] |