aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/memberlist.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2006-06-10 23:53:20 +0000
committerNils Adermann <naderman@naderman.de>2006-06-10 23:53:20 +0000
commit72bb5082101318c820a34be9ee09a092bd81b4bc (patch)
tree803d2757493ca72cab7d6fb85c7c49b34925bbca /phpBB/memberlist.php
parent1c169ed0899e469db53dbdff11f3d0ca040f269d (diff)
downloadforums-72bb5082101318c820a34be9ee09a092bd81b4bc.tar
forums-72bb5082101318c820a34be9ee09a092bd81b4bc.tar.gz
forums-72bb5082101318c820a34be9ee09a092bd81b4bc.tar.bz2
forums-72bb5082101318c820a34be9ee09a092bd81b4bc.tar.xz
forums-72bb5082101318c820a34be9ee09a092bd81b4bc.zip
- 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
Diffstat (limited to 'phpBB/memberlist.php')
-rw-r--r--phpBB/memberlist.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index 251c4c3153..d9c1192868 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -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);
}
}