diff --git a/phpBB/admin/admin_permissions.php b/phpBB/admin/admin_permissions.php index 99c42e2e09..235c282121 100644 --- a/phpBB/admin/admin_permissions.php +++ b/phpBB/admin/admin_permissions.php @@ -105,19 +105,41 @@ if ( isset($HTTP_POST_VARS['update']) ) { switch ( $HTTP_POST_VARS['type'] ) { - case 'group': - foreach ( $HTTP_POST_VARS['entries'] as $group_id ) - { - $acl->set_acl($forum_id, false, $group_id, $HTTP_POST_VARS['option']); - } - break; case 'user': - foreach ( $HTTP_POST_VARS['entries'] as $user_id ) - { - $acl->set_acl($forum_id, $user_id, false, $HTTP_POST_VARS['option']); - } + $set = 'set_acl_user'; + break; + + case 'group': + $set = 'set_acl_group'; break; } + + foreach ( $HTTP_POST_VARS['entries'] as $id ) + { + $acl->$set($forum_id, $id, $HTTP_POST_VARS['option']); + } + + message_die(MESSAGE, 'Permissions updated successfully'); +} +else if ( isset($HTTP_POST_VARS['delete']) ) +{ + switch ( $HTTP_POST_VARS['type'] ) + { + case 'user': + $set = 'delete_acl_user'; + break; + + case 'group': + $set = 'delete_acl_group'; + break; + } + + foreach ( $HTTP_POST_VARS['entries'] as $id ) + { + $acl->$set($forum_id, $id, $HTTP_POST_VARS['option']); + } + + message_die(MESSAGE, 'Permissions updated successfully'); } // diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 32df71b48b..d6ba64cd57 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -530,13 +530,11 @@ class acl { foreach ( $user_auth as $user => $user_auth_ary ) { - $user_auth[$user][$auth_type][$auth_option] = $allow; $sql_ary[] = ( !isset($user_auth_ary[$auth_type][$auth_option]) ) ? "INSERT INTO " . ACL_USERS_TABLE . " (user_id, forum_id, auth_option_id, auth_allow_deny) VALUES ($user_id, $forum_id, $auth_option, $allow)" : ( ( $user_auth_ary[$auth_type][$auth_option] != $allow ) ? "UPDATE " . ACL_USERS_TABLE . " SET auth_allow_deny = $allow WHERE user_id = $user_id AND forum_id = $forum_id and auth_option_id = $auth_option" : '' ); } } else { - $user_auth[$user_id][$auth_type][$auth_option] = $allow; $sql_ary[] = "INSERT INTO " . ACL_USERS_TABLE . " (user_id, forum_id, auth_option_id, auth_allow_deny) VALUES ($user_id, $forum_id, $auth_option, $allow)"; } }