mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-13 03:54:57 +01:00
show dropdown box for choosing the forum in user management screen -> permissions
git-svn-id: file:///svn/phpbb/trunk@6808 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
c428ca8f23
commit
fcc22ef2b0
@ -731,10 +731,21 @@ var help_line = {
|
||||
|
||||
<!-- ELSEIF S_PERMISSIONS -->
|
||||
|
||||
<fieldset class="quick">
|
||||
<div style="float: right;">
|
||||
<a href="{U_USER_PERMISSIONS}">» {L_SET_USERS_PERMISSIONS}</a><br />
|
||||
<a href="{U_USER_FORUM_PERMISSIONS}">» {L_SET_USERS_FORUM_PERMISSIONS}</a>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<form id="select_forum" method="post" action="{U_ACTION}">
|
||||
|
||||
<fieldset class="quick" style="text-align: left;">
|
||||
{L_SELECT_FORUM}: <select name="f">{S_FORUM_OPTIONS}</select>
|
||||
<input class="button2" type="submit" value="{L_GO}" name="select" />
|
||||
</fieldset>
|
||||
|
||||
</form>
|
||||
|
||||
<br clear="all" />
|
||||
|
||||
<!-- INCLUDE permission_mask.html -->
|
||||
|
||||
|
@ -305,7 +305,7 @@ class acp_permissions
|
||||
$s_forum_options = '';
|
||||
foreach ($forum_list as $f_id => $f_row)
|
||||
{
|
||||
$s_forum_options .= '<option value="' . $f_id . '"' . $f_row['selected'] . '>' . $f_row['padding'] . $f_row['forum_name'] . '</option>';
|
||||
$s_forum_options .= '<option value="' . $f_id . '"' . (($f_row['selected']) ? ' selected="selected"' : '') . '>' . $f_row['padding'] . $f_row['forum_name'] . '</option>';
|
||||
}
|
||||
|
||||
// Build subforum options
|
||||
@ -488,7 +488,7 @@ class acp_permissions
|
||||
|
||||
foreach ($forum_list as $key => $row)
|
||||
{
|
||||
$s_options .= '<option value="' . $row['forum_id'] . '"' . $row['selected'] . '>' . $row['padding'] . $row['forum_name'];
|
||||
$s_options .= '<option value="' . $row['forum_id'] . '"' . (($row['selected']) ? ' selected="selected"' : '') . '>' . $row['padding'] . $row['forum_name'];
|
||||
|
||||
// We check if a branch is there...
|
||||
$branch_there = false;
|
||||
|
@ -1960,49 +1960,75 @@ class acp_users
|
||||
$user->add_lang('acp/permissions');
|
||||
add_permission_language();
|
||||
|
||||
// Select auth options
|
||||
$sql = 'SELECT auth_option, is_local, is_global
|
||||
FROM ' . ACL_OPTIONS_TABLE . "
|
||||
WHERE auth_option LIKE '%\_'";
|
||||
$forum_id = request_var('f', 0);
|
||||
|
||||
if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc')
|
||||
// Global Permissions
|
||||
if (!$forum_id)
|
||||
{
|
||||
$sql .= " ESCAPE '\\' ";
|
||||
// Select auth options
|
||||
$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_global = 1
|
||||
ORDER BY auth_option';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$hold_ary = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$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);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
unset($hold_ary);
|
||||
}
|
||||
else
|
||||
{
|
||||
$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, $forum_id, $row['auth_option'], 'local', ACL_NEVER);
|
||||
$auth_admin->display_mask('view', $row['auth_option'], $hold_ary, 'user', true, false);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
$sql .= 'AND is_global = 1
|
||||
ORDER BY auth_option';
|
||||
$result = $db->sql_query($sql);
|
||||
$s_forum_options = '<option value="0"' . ((!$forum_id) ? ' selected="selected"' : '') . '>' . $user->lang['VIEW_GLOBAL_PERMS'] . '</option>';
|
||||
|
||||
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 .= '<option value="' . $f_id . '"' . (($f_row['selected']) ? ' selected="selected"' : '') . '>' . $f_row['padding'] . $f_row['forum_name'] . '</option>';
|
||||
}
|
||||
$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))
|
||||
);
|
||||
|
@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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.',
|
||||
|
Loading…
x
Reference in New Issue
Block a user