mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
fix for bug #5586
git-svn-id: file:///svn/phpbb/trunk@6662 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
9fa4f1f012
commit
4d6f84c320
3 changed files with 30 additions and 34 deletions
|
@ -943,31 +943,6 @@ function handle_message_list_actions(&$address_list, $remove_u, $remove_g, $add_
|
|||
$friend_list = (is_array($_REQUEST['add_' . $type])) ? array_map('intval', array_keys($_REQUEST['add_' . $type])) : array();
|
||||
$user_id_ary = array_merge($user_id_ary, $friend_list);
|
||||
|
||||
if (sizeof($user_id_ary))
|
||||
{
|
||||
// We need to check their PM status (do they want to receive PM's?)
|
||||
// Only check if not a moderator or admin, since they are allowed to override this user setting
|
||||
if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
|
||||
{
|
||||
$sql = 'SELECT user_id
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('user_id', $user_id_ary) . '
|
||||
AND user_allow_pm = 1';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if ($row['user_id'] == ANONYMOUS)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$address_list['u'][$row['user_id']] = $type;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($user_id_ary as $user_id)
|
||||
{
|
||||
if ($user_id == ANONYMOUS)
|
||||
|
@ -978,6 +953,25 @@ function handle_message_list_actions(&$address_list, $remove_u, $remove_g, $add_
|
|||
$address_list['u'][$user_id] = $type;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for disallowed recipients
|
||||
if (sizeof($address_list['u']))
|
||||
{
|
||||
// We need to check their PM status (do they want to receive PM's?)
|
||||
// Only check if not a moderator or admin, since they are allowed to override this user setting
|
||||
if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
|
||||
{
|
||||
$sql = 'SELECT user_id
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('user_id', array_keys($address_list['u'])) . '
|
||||
AND user_allow_pm = 0';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
unset($address_list['u'][$row['user_id']]);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -122,7 +122,7 @@ switch ($mode)
|
|||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = $db->sql_build_query('SELECT', array(
|
||||
'SELECT' => 'u.user_id, u.group_id as default_group, u.username, u.user_colour, u.user_rank, u.user_posts, g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id as ug_user_id',
|
||||
'SELECT' => 'u.user_id, u.group_id as default_group, u.username, u.user_colour, u.user_rank, u.user_posts, u.user_allow_pm, g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id as ug_user_id',
|
||||
|
||||
'FROM' => array(
|
||||
USERS_TABLE => 'u',
|
||||
|
@ -223,7 +223,7 @@ switch ($mode)
|
|||
'RANK_IMG_SRC' => $rank_img_src,
|
||||
|
||||
'U_GROUP' => $u_group,
|
||||
'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $row['user_id']) : '',
|
||||
'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $row['user_id']) : '',
|
||||
|
||||
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
|
||||
'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
|
||||
|
@ -1463,7 +1463,7 @@ function show_profile($data)
|
|||
'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$user_id&sr=posts") : '',
|
||||
'U_NOTES' => $auth->acl_getf_global('m_') ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $user_id, true, $user->session_id) : '',
|
||||
'U_WARN' => $auth->acl_getf_global('m_warn') ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $user_id, true, $user->session_id) : '',
|
||||
'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $user_id) : '',
|
||||
'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($data['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $user_id) : '',
|
||||
'U_EMAIL' => $email,
|
||||
'U_WWW' => (!empty($data['user_website'])) ? $data['user_website'] : '',
|
||||
'U_ICQ' => ($data['user_icq']) ? 'http://www.icq.com/people/webmsg.php?to=' . $data['user_icq'] : '',
|
||||
|
|
|
@ -984,6 +984,7 @@ while ($row = $db->sql_fetchrow($result))
|
|||
'user_colour' => $row['user_colour'],
|
||||
|
||||
'warnings' => 0,
|
||||
'allow_pm' => 0,
|
||||
);
|
||||
}
|
||||
else
|
||||
|
@ -1008,6 +1009,7 @@ while ($row = $db->sql_fetchrow($result))
|
|||
'sig_bbcode_bitfield' => (!empty($row['user_sig_bbcode_bitfield'])) ? $row['user_sig_bbcode_bitfield'] : '',
|
||||
|
||||
'viewonline' => $row['user_allow_viewonline'],
|
||||
'allow_pm' => $row['user_allow_pm'],
|
||||
|
||||
'avatar' => '',
|
||||
'age' => '',
|
||||
|
@ -1419,7 +1421,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
|
|||
|
||||
'U_PROFILE' => $user_cache[$poster_id]['profile'],
|
||||
'U_SEARCH' => $user_cache[$poster_id]['search'],
|
||||
'U_PM' => ($poster_id != ANONYMOUS && $config['allow_privmsg'] && $auth->acl_get('u_sendpm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&action=quotepost&p=' . $row['post_id']) : '',
|
||||
'U_PM' => ($poster_id != ANONYMOUS && $config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($user_cache[$poster_id]['allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&action=quotepost&p=' . $row['post_id']) : '',
|
||||
'U_EMAIL' => $user_cache[$poster_id]['email'],
|
||||
'U_WWW' => $user_cache[$poster_id]['www'],
|
||||
'U_ICQ' => $user_cache[$poster_id]['icq'],
|
||||
|
|
Loading…
Add table
Reference in a new issue