diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 97d9968f7c..9894de351a 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -139,6 +139,7 @@
[Fix] Mark/unmark all links in UCP now select/unselect both subscribed topics and forums.
[Fix] Increase board topic counter when splitting topics. (Bug #32125)
[Fix] Display profile icons when viewing a topic, or PM when only the jabber icon is to be visible. (Bug #34755)
+ [Fix] Do not send PMs with warnings if the user cannot read PMs or they are disabled. (Bug #30815)
[Change] No longer allow the direct use of MULTI_INSERT in sql_build_array. sql_multi_insert() must be used.
[Change] Display warning in ACP if config.php file is left writable.
diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php
index 7c17de9f43..bf0e66dc67 100644
--- a/phpBB/includes/mcp/mcp_warn.php
+++ b/phpBB/includes/mcp/mcp_warn.php
@@ -249,6 +249,25 @@ class mcp_warn
$this->u_action .= "&f=$forum_id&p=$post_id";
}
+ // Check if can send a notification
+ if ($config['allow_privmsg'])
+ {
+ $auth2 = new auth();
+ $auth2->acl($user_row);
+ $s_can_notify = ($auth2->acl_get('u_readpm')) ? true : false;
+ unset($auth2);
+ }
+ else
+ {
+ $s_can_notify = false;
+ }
+
+ // Prevent against clever people
+ if ($notify && !$s_can_notify)
+ {
+ $notify = false;
+ }
+
if ($warning && $action == 'add_warning')
{
if (check_form_key('mcp_warn'))
@@ -307,6 +326,8 @@ class mcp_warn
'RANK_IMG' => $rank_img,
'L_WARNING_POST_DEFAULT' => sprintf($user->lang['WARNING_POST_DEFAULT'], generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&p=$post_id#p$post_id"),
+
+ 'S_CAN_NOTIFY' => $s_can_notify,
));
}
@@ -351,6 +372,25 @@ class mcp_warn
$this->u_action .= "&u=$user_id";
}
+ // Check if can send a notification
+ if ($config['allow_privmsg'])
+ {
+ $auth2 = new auth();
+ $auth2->acl($user_row);
+ $s_can_notify = ($auth2->acl_get('u_readpm')) ? true : false;
+ unset($auth2);
+ }
+ else
+ {
+ $s_can_notify = false;
+ }
+
+ // Prevent against clever people
+ if ($notify && !$s_can_notify)
+ {
+ $notify = false;
+ }
+
if ($warning && $action == 'add_warning')
{
if (check_form_key('mcp_warn'))
@@ -389,6 +429,8 @@ class mcp_warn
'AVATAR_IMG' => $avatar_img,
'RANK_IMG' => $rank_img,
+
+ 'S_CAN_NOTIFY' => $s_can_notify,
));
return $user_id;
diff --git a/phpBB/styles/prosilver/template/mcp_warn_post.html b/phpBB/styles/prosilver/template/mcp_warn_post.html
index 5937598a52..d09209f5a4 100644
--- a/phpBB/styles/prosilver/template/mcp_warn_post.html
+++ b/phpBB/styles/prosilver/template/mcp_warn_post.html
@@ -52,11 +52,13 @@
diff --git a/phpBB/styles/prosilver/template/mcp_warn_user.html b/phpBB/styles/prosilver/template/mcp_warn_user.html
index c807a6b640..5b5156f3a1 100644
--- a/phpBB/styles/prosilver/template/mcp_warn_user.html
+++ b/phpBB/styles/prosilver/template/mcp_warn_user.html
@@ -36,11 +36,13 @@
diff --git a/phpBB/styles/subsilver2/template/mcp_warn_post.html b/phpBB/styles/subsilver2/template/mcp_warn_post.html
index 1ad5757f15..ef0595e48e 100644
--- a/phpBB/styles/subsilver2/template/mcp_warn_post.html
+++ b/phpBB/styles/subsilver2/template/mcp_warn_post.html
@@ -45,9 +45,11 @@
|
+
{L_NOTIFY_USER_WARN} |
+
|
diff --git a/phpBB/styles/subsilver2/template/mcp_warn_user.html b/phpBB/styles/subsilver2/template/mcp_warn_user.html
index 5e8c350935..bb77c91654 100644
--- a/phpBB/styles/subsilver2/template/mcp_warn_user.html
+++ b/phpBB/styles/subsilver2/template/mcp_warn_user.html
@@ -58,9 +58,11 @@
|
+
{L_NOTIFY_USER_WARN} |
+
|