aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp/ucp_pm_compose.php
diff options
context:
space:
mode:
authorNathan <exreaction@phpbb.com>2012-07-10 16:07:12 -0500
committerNathan <exreaction@phpbb.com>2012-07-10 16:07:12 -0500
commit33852e6251cf9eea29efde4aebdd64500b7e7c2b (patch)
tree4bfdb0c0d10425637353eb9f82623a8b8a8d2168 /phpBB/includes/ucp/ucp_pm_compose.php
parent07b9c1e2fdeeab5d394c0b166fb0a6488b049cd1 (diff)
downloadforums-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/includes/ucp/ucp_pm_compose.php')
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php39
1 files changed, 14 insertions, 25 deletions
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index e65b523cfb..8fc99818f4 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -1247,40 +1247,29 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove
}
// Check if users have permission to read PMs
- // 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_'))
+ $can_read = $auth->acl_get_list(array_keys($address_list['u']), 'u_readpm');
+ $can_read = (empty($can_read) || !isset($can_read[0]['u_readpm'])) ? array() : $can_read[0]['u_readpm'];
+ $cannot_read_list = array_diff(array_keys($address_list['u']), $can_read);
+ if (!empty($cannot_read_list))
{
- $can_read = $auth->acl_get_list(false, 'u_readpm');
- $can_read = (empty($can_read) || !isset($can_read[0]['u_readpm'])) ? array() : $can_read[0]['u_readpm'];
-
- $cannot_read_list = array_diff(array_keys($address_list['u']), $can_read);
-
- if (!empty($cannot_read_list))
+ foreach ($cannot_read_list as $cannot_read)
{
- foreach ($cannot_read_list as $cannot_read)
- {
- unset($address_list['u'][$cannot_read]);
- }
-
- $error[] = $user->lang['PM_USERS_REMOVED_NO_PERMISSION'];
+ unset($address_list['u'][$cannot_read]);
}
+
+ $error[] = $user->lang['PM_USERS_REMOVED_NO_PERMISSION'];
}
// Check if users are banned
- // 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_'))
+ $banned_user_list = phpbb_get_banned_user_ids(array_keys($address_list['u']), false);
+ if (!empty($banned_user_list))
{
- $banned_user_list = phpbb_get_banned_user_ids(array_keys($address_list['u']), false);
-
- if (!empty($banned_user_list))
+ foreach ($banned_user_list as $banned_user)
{
- foreach ($banned_user_list as $banned_user)
- {
- unset($address_list['u'][$banned_user]);
- }
-
- $error[] = $user->lang['PM_USERS_REMOVED_BANNED'];
+ unset($address_list['u'][$banned_user]);
}
+
+ $error[] = $user->lang['PM_USERS_REMOVED_BANNED'];
}
}
}