mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-26 09:44:26 +02:00
- allow searching for post_count = 0 [Bug #2154]
- better permission check for user search by ip - permissions for max attachments adjusted git-svn-id: file:///svn/phpbb/trunk@6046 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -738,7 +738,7 @@ switch ($mode)
|
||||
$count_select = request_var('count_select', 'eq');
|
||||
$joined = explode('-', request_var('joined', ''));
|
||||
$active = explode('-', request_var('active', ''));
|
||||
$count = (request_var('count', '')) ? request_var('count', 0) : '';
|
||||
$count = (request_var('count', '') !== '') ? request_var('count', 0) : '';
|
||||
$ipdomain = request_var('ip', '');
|
||||
|
||||
$find_key_match = array('lt' => '<', 'gt' => '>', 'eq' => '=');
|
||||
@@ -783,13 +783,15 @@ switch ($mode)
|
||||
$sql_from = ', ' . USER_GROUP_TABLE . ' ug ';
|
||||
}
|
||||
|
||||
if ($ipdomain && $auth->acl_get('m_info'))
|
||||
if ($ipdomain && $auth->acl_getf_global('m_info'))
|
||||
{
|
||||
$ips = (preg_match('#[a-z]#', $ipdomain)) ? implode(', ', preg_replace('#([0-9]{1,3}\.[0-9]{1,3}[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})#', "'\\1'", gethostbynamel($ipdomain))) : "'" . str_replace('*', '%', $ipdomain) . "'";
|
||||
|
||||
$ip_forums = array_keys($auth->acl_getf('m_info', true));
|
||||
$sql = 'SELECT DISTINCT poster_id
|
||||
FROM ' . POSTS_TABLE . '
|
||||
WHERE poster_ip ' . ((preg_match('#%#', $ips)) ? 'LIKE' : 'IN') . " ($ips)";
|
||||
WHERE poster_ip ' . ((preg_match('#%#', $ips)) ? 'LIKE' : 'IN') . " ($ips)
|
||||
AND forum_id IN (0, " . implode(',', $ip_forums) . ')';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
@@ -808,6 +810,7 @@ switch ($mode)
|
||||
// A minor fudge but it does the job :D
|
||||
$sql_where .= " AND u.user_id IN ('-1')";
|
||||
}
|
||||
unset($ip_forums);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user