aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan <exreaction@phpbb.com>2012-07-03 23:34:07 -0500
committerNathan <exreaction@phpbb.com>2012-07-10 12:34:38 -0500
commitc38bb4254abec403add35378da67092c8513a3c4 (patch)
treedbddad24b29ab978ece29f2fd45cc64afadbcfb0
parentc53d7f0b62abf222b159623ccc2c6ef6262f3137 (diff)
downloadforums-c38bb4254abec403add35378da67092c8513a3c4.tar
forums-c38bb4254abec403add35378da67092c8513a3c4.tar.gz
forums-c38bb4254abec403add35378da67092c8513a3c4.tar.bz2
forums-c38bb4254abec403add35378da67092c8513a3c4.tar.xz
forums-c38bb4254abec403add35378da67092c8513a3c4.zip
[ticket/8323] Do not allow sending of Private Messages to users who are banned
PHPBB3-8323
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php17
-rw-r--r--phpBB/language/en/ucp.php1
2 files changed, 18 insertions, 0 deletions
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index fe5b3b7a74..2ab6090533 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -1265,6 +1265,23 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove
$error[] = $user->lang['PM_USERS_REMOVED_NO_PERMISSION'];
}
}
+
+ // 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_'))
+ {
+ $banned_user_list = phpbb_get_banned_user_ids(array_keys($address_list['u']));
+
+ if (!empty($banned_user_list))
+ {
+ foreach ($banned_user_list as $banned_user)
+ {
+ unset($address_list['u'][$banned_user]);
+ }
+
+ $error[] = $user->lang['PM_USERS_REMOVED_BANNED'];
+ }
+ }
}
}
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index 8af828935b..bc21b6b437 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -367,6 +367,7 @@ $lang = array_merge($lang, array(
'PM_SENTBOX' => 'Sent messages',
'PM_SUBJECT' => 'Message subject',
'PM_TO' => 'Send to',
+ 'PM_USERS_REMOVED_BANNED' => 'Some users couldn’t be added as they are banned.',
'PM_USERS_REMOVED_NO_PERMISSION' => 'Some users couldn’t be added as they do not have permission to read private messages.',
'PM_USERS_REMOVED_NO_PM' => 'Some users couldn’t be added as they have disabled private message receipt.',
'POPUP_ON_PM' => 'Pop up window on new private message',