mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
git-svn-id: file:///svn/phpbb/trunk@6807 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
fb4e1920fc
commit
c428ca8f23
1 changed files with 40 additions and 20 deletions
|
@ -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,7 +1059,26 @@ 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']))
|
||||
{
|
||||
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 . ']',
|
||||
|
||||
'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&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'])
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$template->assign_block_vars($tpl_cat . '.' . $tpl_mask, array(
|
||||
'S_YES' => ($allowed == ACL_YES) ? true : false,
|
||||
|
@ -1079,6 +1098,7 @@ class auth_admin extends auth
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Building content array from permission rows with explicit key ordering
|
||||
|
@ -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]))
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue