diff options
| author | Nathan <exreaction@phpbb.com> | 2012-07-10 16:07:12 -0500 |
|---|---|---|
| committer | Nathan <exreaction@phpbb.com> | 2012-07-10 16:07:12 -0500 |
| commit | 33852e6251cf9eea29efde4aebdd64500b7e7c2b (patch) | |
| tree | 4bfdb0c0d10425637353eb9f82623a8b8a8d2168 /phpBB/viewtopic.php | |
| parent | 07b9c1e2fdeeab5d394c0b166fb0a6488b049cd1 (diff) | |
| download | forums-33852e6251cf9eea29efde4aebdd64500b7e7c2b.tar forums-33852e6251cf9eea29efde4aebdd64500b7e7c2b.tar.gz forums-33852e6251cf9eea29efde4aebdd64500b7e7c2b.tar.bz2 forums-33852e6251cf9eea29efde4aebdd64500b7e7c2b.tar.xz forums-33852e6251cf9eea29efde4aebdd64500b7e7c2b.zip | |
[ticket/8323] Correct PM notification settings (only notify those who can receive them)
Also correcting the way it was setup for users to be able to receive PMs (do not allow administrators/moderators to send to banned, inactive, or non-standard users, that just doesn't make sense)
PHPBB3-8323
Diffstat (limited to 'phpBB/viewtopic.php')
| -rw-r--r-- | phpBB/viewtopic.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 779e6a8fa7..e892689a1e 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1322,7 +1322,7 @@ $can_receive_pm_list = $auth->acl_get_list(array_keys($user_cache), 'u_readpm'); $can_receive_pm_list = (empty($can_receive_pm_list) || !isset($can_receive_pm_list[0]['u_readpm'])) ? array() : $can_receive_pm_list[0]['u_readpm']; // Get the list of permanently banned users -$banned_users = phpbb_get_banned_user_ids(array_keys($user_cache), false); +$permanently_banned_users = phpbb_get_banned_user_ids(array_keys($user_cache), false); $i_total = sizeof($rowset) - 1; $prev_post_id = ''; @@ -1497,7 +1497,13 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) ))); // Can this user receive a Private Message? - $can_receive_pm = ($user_cache[$poster_id]['user_type'] <> USER_INACTIVE && (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || ($user_cache[$poster_id]['allow_pm'] && in_array($poster_id, $can_receive_pm_list) && !in_array($poster_id, $banned_users)))) ? true : false; + $can_receive_pm = ( + $user_cache[$poster_id]['user_type'] != USER_IGNORE && // They must be a "normal" user + $user_cache[$poster_id]['user_type'] != USER_INACTIVE && // They must not be deactivated by the administrator + in_array($poster_id, $can_receive_pm_list) && // They must be able to read PMs + !in_array($poster_id, $permanently_banned_users) && // They must not be permanently banned + (($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) || $data['user_allow_pm']) // They must allow users to contact via PM + ) ? true : false; // $postrow = array( |
