mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
- author search should use clean names for searching [Bug #5752]
- local moderators are moderators too! - don't show a "word is not contained in any post" message for ignored common words - bold search words in search error messages [Bug #5762] git-svn-id: file:///svn/phpbb/trunk@6708 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -37,7 +37,7 @@ class custom_profile
|
||||
|
||||
case 'profile':
|
||||
// Show hidden fields to moderators/admins
|
||||
if (!$auth->acl_gets('a_', 'm_'))
|
||||
if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
|
||||
{
|
||||
$sql_where .= ' AND f.field_hide = 0';
|
||||
}
|
||||
@@ -199,7 +199,7 @@ class custom_profile
|
||||
FROM ' . PROFILE_LANG_TABLE . ' l, ' . PROFILE_FIELDS_TABLE . ' f
|
||||
WHERE l.lang_id = ' . $user->get_iso_lang_id() . '
|
||||
AND f.field_active = 1 ' .
|
||||
((!$auth->acl_gets('a_', 'm_')) ? ' AND f.field_hide = 0 ' : '') . '
|
||||
((!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) ? ' AND f.field_hide = 0 ' : '') . '
|
||||
AND f.field_no_view = 0
|
||||
AND l.field_id = f.field_id
|
||||
ORDER BY f.field_order';
|
||||
@@ -264,7 +264,7 @@ class custom_profile
|
||||
|
||||
case 'profile':
|
||||
// Show hidden fields to moderators/admins
|
||||
if (!$auth->acl_gets('a_', 'm_'))
|
||||
if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
|
||||
{
|
||||
$sql_where .= ' AND f.field_hide = 0';
|
||||
}
|
||||
|
@@ -187,6 +187,8 @@ class fulltext_native extends search_backend
|
||||
preg_match_all('#([^\\s+\\-|*()]+)(?:$|[\\s+\\-|()])#u', $keywords, $exact_words);
|
||||
$exact_words = $exact_words[1];
|
||||
|
||||
$common_ids = array();
|
||||
|
||||
if (sizeof($exact_words))
|
||||
{
|
||||
$sql = 'SELECT word_id, word_text, word_common
|
||||
@@ -200,6 +202,7 @@ class fulltext_native extends search_backend
|
||||
if ($row['word_common'])
|
||||
{
|
||||
$this->common_words[] = $row['word_text'];
|
||||
$common_ids[$row['word_text']] = (int) $row['word_id'];
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -316,7 +319,10 @@ class fulltext_native extends search_backend
|
||||
// throw an error if we shall not ignore unexistant words
|
||||
else if (!$ignore_no_id)
|
||||
{
|
||||
trigger_error(sprintf($user->lang['WORD_IN_NO_POST'], $word));
|
||||
if (!isset($common_ids[$word]))
|
||||
{
|
||||
trigger_error(sprintf($user->lang['WORD_IN_NO_POST'], $word));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1218,7 +1218,7 @@ class user extends session
|
||||
if (!defined('DEBUG_EXTRA') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install'))
|
||||
{
|
||||
// Adjust the message slightly according to the permissions
|
||||
if ($auth->acl_gets('a_', 'm_'))
|
||||
if ($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))
|
||||
{
|
||||
$message = 'REMOVE_INSTALL';
|
||||
}
|
||||
@@ -1231,7 +1231,7 @@ class user extends session
|
||||
}
|
||||
|
||||
// Is board disabled and user not an admin or moderator?
|
||||
if ($config['board_disable'] && !defined('IN_LOGIN') && !$auth->acl_gets('a_', 'm_'))
|
||||
if ($config['board_disable'] && !defined('IN_LOGIN') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
|
||||
{
|
||||
$message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE';
|
||||
trigger_error($message);
|
||||
@@ -1240,7 +1240,7 @@ class user extends session
|
||||
// Is load exceeded?
|
||||
if ($config['limit_load'] && $this->load !== false)
|
||||
{
|
||||
if ($this->load > floatval($config['limit_load']) && !defined('IN_LOGIN') && !$auth->acl_gets('a_', 'm_'))
|
||||
if ($this->load > floatval($config['limit_load']) && !defined('IN_LOGIN') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_gets('a_', 'm_'))
|
||||
{
|
||||
trigger_error('BOARD_UNAVAILABLE');
|
||||
}
|
||||
|
Reference in New Issue
Block a user