aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/auth.php
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2006-12-24 21:05:08 +0000
committerDavid M <davidmj@users.sourceforge.net>2006-12-24 21:05:08 +0000
commitc428ca8f239e21b98b4f0ae6a4a0e58b9f6c46f1 (patch)
tree3393756aca5d3e9f1f632bfc2437c66d67858458 /phpBB/includes/acp/auth.php
parentfb4e1920fcfc596eacdfa02f4752b83ca1e95508 (diff)
downloadforums-c428ca8f239e21b98b4f0ae6a4a0e58b9f6c46f1.tar
forums-c428ca8f239e21b98b4f0ae6a4a0e58b9f6c46f1.tar.gz
forums-c428ca8f239e21b98b4f0ae6a4a0e58b9f6c46f1.tar.bz2
forums-c428ca8f239e21b98b4f0ae6a4a0e58b9f6c46f1.tar.xz
forums-c428ca8f239e21b98b4f0ae6a4a0e58b9f6c46f1.zip
#6472
git-svn-id: file:///svn/phpbb/trunk@6807 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acp/auth.php')
-rw-r--r--phpBB/includes/acp/auth.php60
1 files changed, 40 insertions, 20 deletions
diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php
index b6ec69a347..95dffb9e72 100644
--- a/phpBB/includes/acp/auth.php
+++ b/phpBB/includes/acp/auth.php
@@ -480,7 +480,7 @@ class auth_admin extends auth
'FORUM_ID' => $forum_id)
);
- $this->assign_cat_array($ug_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace);
+ $this->assign_cat_array($ug_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace, ($mode == 'view'));
}
}
}
@@ -513,13 +513,13 @@ class auth_admin extends auth
'S_GROUP_MODE' => ($user_mode == 'group') ? true : false)
);
- foreach ($content_array as $forum_id => $forum_array)
+ while (list($forum_id, $forum_array) = each($content_array))
{
// Build role dropdown options
$current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0;
$s_role_options = '';
- foreach ($roles as $role_id => $role_row)
+ while (list($role_id, $role_row) = each($roles))
{
$role_description = (!empty($user->lang[$role_row['role_description']])) ? $user->lang[$role_row['role_description']] : nl2br($role_row['role_description']);
$role_name = (!empty($user->lang[$role_row['role_name']])) ? $user->lang[$role_row['role_name']] : $role_row['role_name'];
@@ -567,7 +567,7 @@ class auth_admin extends auth
'FORUM_ID' => $forum_id)
);
- $this->assign_cat_array($forum_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace);
+ $this->assign_cat_array($forum_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace, ($mode == 'view'));
}
}
}
@@ -1045,11 +1045,11 @@ class auth_admin extends auth
* Assign category to template
* used by display_mask()
*/
- function assign_cat_array(&$category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $show_trace = false)
+ function assign_cat_array(&$category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $show_trace = false, $s_view)
{
global $template, $user, $phpbb_admin_path, $phpEx;
- foreach ($category_array as $cat => $cat_array)
+ while (list($cat, $cat_array) = each($category_array))
{
$template->assign_block_vars($tpl_cat, array(
'S_YES' => ($cat_array['S_YES'] && !$cat_array['S_NEVER'] && !$cat_array['S_NO']) ? true : false,
@@ -1059,23 +1059,43 @@ class auth_admin extends auth
'CAT_NAME' => $user->lang['permission_cat'][$cat])
);
- foreach ($cat_array['permissions'] as $permission => $allowed)
+ while (list($permission, $allowed) = each($cat_array['permissions']))
{
- $template->assign_block_vars($tpl_cat . '.' . $tpl_mask, array(
- 'S_YES' => ($allowed == ACL_YES) ? true : false,
- 'S_NEVER' => ($allowed == ACL_NEVER) ? true : false,
- 'S_NO' => ($allowed == ACL_NO) ? true : false,
+ if ($s_view)
+ {
+ $template->assign_block_vars($tpl_cat . '.' . $tpl_mask, array(
+ 'S_YES' => ($allowed == ACL_YES) ? true : false,
+ 'S_NEVER' => ($allowed == ACL_NEVER) ? true : false,
- 'UG_ID' => $ug_id,
- 'FORUM_ID' => $forum_id,
- 'FIELD_NAME' => $permission,
- 'S_FIELD_NAME' => 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']',
+ 'UG_ID' => $ug_id,
+ 'FORUM_ID' => $forum_id,
+ 'FIELD_NAME' => $permission,
+ 'S_FIELD_NAME' => 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']',
- 'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '',
- 'UA_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '',
+ 'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '',
+ 'UA_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '',
- 'PERMISSION' => $user->lang['acl_' . $permission]['lang'])
- );
+ 'PERMISSION' => $user->lang['acl_' . $permission]['lang'])
+ );
+ }
+ else
+ {
+ $template->assign_block_vars($tpl_cat . '.' . $tpl_mask, array(
+ 'S_YES' => ($allowed == ACL_YES) ? true : false,
+ 'S_NEVER' => ($allowed == ACL_NEVER) ? true : false,
+ 'S_NO' => ($allowed == ACL_NO) ? true : false,
+
+ 'UG_ID' => $ug_id,
+ 'FORUM_ID' => $forum_id,
+ 'FIELD_NAME' => $permission,
+ 'S_FIELD_NAME' => 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']',
+
+ 'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '',
+ 'UA_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '',
+
+ 'PERMISSION' => $user->lang['acl_' . $permission]['lang'])
+ );
+ }
}
}
}
@@ -1098,7 +1118,7 @@ class auth_admin extends auth
$permissions = $permission_row[$forum_id];
ksort($permissions);
- foreach ($permissions as $permission => $auth_setting)
+ while (list($permission, $auth_setting) = each($permissions))
{
if (!isset($user->lang['acl_' . $permission]))
{