diff --git a/phpBB/adm/style/acp_users.html b/phpBB/adm/style/acp_users.html index 7bc81434d0..c615dadb44 100644 --- a/phpBB/adm/style/acp_users.html +++ b/phpBB/adm/style/acp_users.html @@ -731,10 +731,21 @@ var help_line = { -
+
» {L_SET_USERS_PERMISSIONS}
» {L_SET_USERS_FORUM_PERMISSIONS} -
+ + +
+ +
+ {L_SELECT_FORUM}: + +
+ +
+ +
diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 8b611ffef1..61017a059d 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -305,7 +305,7 @@ class acp_permissions $s_forum_options = ''; foreach ($forum_list as $f_id => $f_row) { - $s_forum_options .= ''; + $s_forum_options .= ''; } // Build subforum options @@ -488,7 +488,7 @@ class acp_permissions foreach ($forum_list as $key => $row) { - $s_options .= ''; - while ($row = $db->sql_fetchrow($result)) + $forum_list = make_forum_select($forum_id, false, true, false, false, false, true); + + // Build forum options + foreach ($forum_list as $f_id => $f_row) { - $hold_ary = $auth_admin->get_mask('view', $user_id, false, false, $row['auth_option'], 'global', ACL_NEVER); - $auth_admin->display_mask('view', $row['auth_option'], $hold_ary, 'user', false, false); + $s_forum_options .= ''; } - $db->sql_freeresult($result); - - $sql = 'SELECT auth_option, is_local, is_global - FROM ' . ACL_OPTIONS_TABLE . " - WHERE auth_option LIKE '%\_'"; - - if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') - { - $sql .= " ESCAPE '\\' "; - } - - $sql .= 'AND is_local = 1 - ORDER BY is_global DESC, auth_option'; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - $hold_ary = $auth_admin->get_mask('view', $user_id, false, false, $row['auth_option'], 'local', ACL_NEVER); - $auth_admin->display_mask('view', $row['auth_option'], $hold_ary, 'user', true, false); - } - $db->sql_freeresult($result); $template->assign_vars(array( 'S_PERMISSIONS' => true, + + 'S_GLOBAL' => (!$forum_id) ? true : false, + 'S_FORUM_OPTIONS' => $s_forum_options, + + 'U_ACTION' => $this->u_action . '&u=' . $user_id, 'U_USER_PERMISSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx" ,'i=permissions&mode=setting_user_global&user_id[]=' . $user_id), 'U_USER_FORUM_PERMISSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions&mode=setting_user_local&user_id[]=' . $user_id)) ); diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index 95dffb9e72..26977a6ceb 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -380,6 +380,7 @@ class auth_admin extends auth } $template->assign_var('S_ROLE_JS_ARRAY', $s_role_js_array); + unset($s_role_js_array); // Now obtain memberships $user_groups_default = $user_groups_custom = array(); @@ -481,7 +482,11 @@ class auth_admin extends auth ); $this->assign_cat_array($ug_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace, ($mode == 'view')); + + unset($content_array[$ug_id]); } + + unset($hold_ary[$forum_id]); } } else @@ -569,6 +574,8 @@ class auth_admin extends auth $this->assign_cat_array($forum_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace, ($mode == 'view')); } + + unset($hold_ary[$ug_id], $ug_names_ary[$ug_id]); } } } diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index a553d8e4ed..cf1b053f8c 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -113,7 +113,7 @@ class auth { if (isset($this->acl[0])) { - $this->cache[$f][$opt] = $this->acl[0]{$this->acl_options['global'][$opt]}; + $this->cache[$f][$opt] = $this->acl[0][$this->acl_options['global'][$opt]]; } } @@ -123,7 +123,7 @@ class auth { if (isset($this->acl[$f])) { - $this->cache[$f][$opt] |= $this->acl[$f]{$this->acl_options['local'][$opt]}; + $this->cache[$f][$opt] |= $this->acl[$f][$this->acl_options['local'][$opt]]; } } } diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php index e17b31b8ef..94ff82148b 100644 --- a/phpBB/language/en/acp/permissions.php +++ b/phpBB/language/en/acp/permissions.php @@ -242,6 +242,8 @@ $lang = array_merge($lang, array( 'USER_IS_MEMBER_OF_CUSTOM' => 'is a member of the following custom groups', 'VIEW_ASSIGNED_ITEMS' => 'View assigned items', + 'VIEW_LOCAL_PERMS' => 'Local permissions', + 'VIEW_GLOBAL_PERMS' => 'Global permissions', 'VIEW_PERMISSIONS' => 'View permissions', 'WRONG_PERMISSION_TYPE' => 'Wrong permission type selected.',