Commit 7fb6b1ac authored by drumm's avatar drumm
Browse files

#97686 by chx. Replace a loop with a standard PHP function.

parent 5278747d
......@@ -1851,11 +1851,7 @@ function user_admin_perm_submit($form_id, $form_values) {
// Delete, so if we clear every checkbox we reset that role;
// otherwise permissions are active and denied everywhere.
db_query('DELETE FROM {permission} WHERE rid = %d', $role->rid);
foreach ($form_values[$role->rid] as $key => $value) {
if (!$value) {
$form_values[$role->rid] = array_filter($form_values[$role->rid]);
if (count($form_values[$role->rid])) {
db_query("INSERT INTO {permission} (rid, perm) VALUES (%d, '%s')", $role->rid, implode(', ', array_keys($form_values[$role->rid])));
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment