mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-26 03:48:53 +00: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:
parent
1c169ed089
commit
72bb508210
2 changed files with 8 additions and 5 deletions
|
@ -334,12 +334,12 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage
|
||||||
$filedata['thumbnail'] = ($cat_id == ATTACHMENT_CATEGORY_IMAGE && $config['img_create_thumbnail']) ? 1 : 0;
|
$filedata['thumbnail'] = ($cat_id == ATTACHMENT_CATEGORY_IMAGE && $config['img_create_thumbnail']) ? 1 : 0;
|
||||||
|
|
||||||
// Check Image Size, if it is an image
|
// Check Image Size, if it is an image
|
||||||
if (!$auth->acl_gets('m_', 'a_') && $cat_id == ATTACHMENT_CATEGORY_IMAGE)
|
if (!$auth->acl_get('a_') && !$auth->acl_get('m_', $forum_id) && $cat_id == ATTACHMENT_CATEGORY_IMAGE)
|
||||||
{
|
{
|
||||||
$file->upload->set_allowed_dimensions(0, 0, $config['img_max_width'], $config['img_max_height']);
|
$file->upload->set_allowed_dimensions(0, 0, $config['img_max_width'], $config['img_max_height']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$auth->acl_gets('a_', 'm_'))
|
if (!$auth->acl_get('a_') && !$auth->acl_get('m_', $forum_id))
|
||||||
{
|
{
|
||||||
$allowed_filesize = ($extensions[$file->get('extension')]['max_filesize'] != 0) ? $extensions[$file->get('extension')]['max_filesize'] : (($is_message) ? $config['max_filesize_pm'] : $config['max_filesize']);
|
$allowed_filesize = ($extensions[$file->get('extension')]['max_filesize'] != 0) ? $extensions[$file->get('extension')]['max_filesize'] : (($is_message) ? $config['max_filesize_pm'] : $config['max_filesize']);
|
||||||
$file->upload->set_max_filesize($allowed_filesize);
|
$file->upload->set_max_filesize($allowed_filesize);
|
||||||
|
|
|
@ -738,7 +738,7 @@ switch ($mode)
|
||||||
$count_select = request_var('count_select', 'eq');
|
$count_select = request_var('count_select', 'eq');
|
||||||
$joined = explode('-', request_var('joined', ''));
|
$joined = explode('-', request_var('joined', ''));
|
||||||
$active = explode('-', request_var('active', ''));
|
$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', '');
|
$ipdomain = request_var('ip', '');
|
||||||
|
|
||||||
$find_key_match = array('lt' => '<', 'gt' => '>', 'eq' => '=');
|
$find_key_match = array('lt' => '<', 'gt' => '>', 'eq' => '=');
|
||||||
|
@ -783,13 +783,15 @@ switch ($mode)
|
||||||
$sql_from = ', ' . USER_GROUP_TABLE . ' ug ';
|
$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) . "'";
|
$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
|
$sql = 'SELECT DISTINCT poster_id
|
||||||
FROM ' . POSTS_TABLE . '
|
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);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
if ($row = $db->sql_fetchrow($result))
|
if ($row = $db->sql_fetchrow($result))
|
||||||
|
@ -808,6 +810,7 @@ switch ($mode)
|
||||||
// A minor fudge but it does the job :D
|
// A minor fudge but it does the job :D
|
||||||
$sql_where .= " AND u.user_id IN ('-1')";
|
$sql_where .= " AND u.user_id IN ('-1')";
|
||||||
}
|
}
|
||||||
|
unset($ip_forums);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue