diff options
author | Chris Smith <toonarmy@phpbb.com> | 2008-10-11 17:01:43 +0000 |
---|---|---|
committer | Chris Smith <toonarmy@phpbb.com> | 2008-10-11 17:01:43 +0000 |
commit | 853a12cf00ef5d8b1bc1f2590d7b069ce04ac690 (patch) | |
tree | f72e7148f51ab5c7fef4c199406b57a2f97b7f32 /phpBB/includes/mcp | |
parent | a203d52e4feeb295e4d222310383c0bb4a3c5652 (diff) | |
download | forums-853a12cf00ef5d8b1bc1f2590d7b069ce04ac690.tar forums-853a12cf00ef5d8b1bc1f2590d7b069ce04ac690.tar.gz forums-853a12cf00ef5d8b1bc1f2590d7b069ce04ac690.tar.bz2 forums-853a12cf00ef5d8b1bc1f2590d7b069ce04ac690.tar.xz forums-853a12cf00ef5d8b1bc1f2590d7b069ce04ac690.zip |
Do not send PMs with warnings if the user cannot read PMs or they are disabled. #30815
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9002 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/mcp')
-rw-r--r-- | phpBB/includes/mcp/mcp_warn.php | 42 |
1 files changed, 42 insertions, 0 deletions
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; |