mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-04 21:44:57 +02:00
minor update to check for mods/admins
git-svn-id: file:///svn/phpbb/trunk@4525 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
c41938fd8a
commit
29ad97ebf7
@ -17,7 +17,7 @@ class ucp_zebra extends module
|
||||
{
|
||||
global $censors, $config, $db, $user, $auth, $SID, $template, $phpbb_root_path, $phpEx;
|
||||
|
||||
$submit = (!empty($_POST['submit'])) ? true : false;
|
||||
$submit = (!empty($_POST['submit']) || !empty($_GET['add'])) ? true : false;
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
@ -73,6 +73,8 @@ class ucp_zebra extends module
|
||||
|
||||
$add = implode(', ', preg_replace('#^[\s]*?(.*?)[\s]*?$#e', "\"'\" . \$db->sql_escape('\\1') . \"'\"", $add));
|
||||
|
||||
if ($add)
|
||||
{
|
||||
$sql = 'SELECT user_id, user_permissions, user_founder
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE username IN (' . $add . ')';
|
||||
@ -90,8 +92,22 @@ class ucp_zebra extends module
|
||||
// Remove users from foe list if they are admins or moderators
|
||||
if ($mode == 'foes')
|
||||
{
|
||||
// This isn't right ...
|
||||
$user_id_ary = array_diff($user_id_ary, array_keys(discover_auth($user_id_ary, array('a_', 'm_'))));
|
||||
$perms = array();
|
||||
foreach (discover_auth($user_id_ary, array('a_', 'm_')) as $user_id => $forum_ary)
|
||||
{
|
||||
foreach ($forum_ary as $forum_id => $option_ary)
|
||||
{
|
||||
if (array_sum(array_values($forum_ary)))
|
||||
{
|
||||
$perms[] = $user_id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This may not be right ... it may yield true when perms equate to deny
|
||||
$user_id_ary = array_diff($user_id_ary, $perms);
|
||||
unset($perms);
|
||||
}
|
||||
|
||||
if (sizeof($user_id_ary))
|
||||
@ -129,6 +145,7 @@ class ucp_zebra extends module
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
}
|
||||
else if ($usernames)
|
||||
{
|
||||
// Force integer values
|
||||
@ -171,8 +188,6 @@ class ucp_zebra extends module
|
||||
);
|
||||
|
||||
$this->display($user->lang['UCP_ZEBRA'], 'ucp_zebra_' . $mode . '.html');
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user