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 | |
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
-rw-r--r-- | phpBB/docs/CHANGELOG.html | 1 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_warn.php | 42 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/mcp_warn_post.html | 2 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/mcp_warn_user.html | 2 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/mcp_warn_post.html | 2 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/mcp_warn_user.html | 2 |
6 files changed, 51 insertions, 0 deletions
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 @@ <li>[Fix] Mark/unmark all links in UCP now select/unselect both subscribed topics and forums.</li> <li>[Fix] Increase board topic counter when splitting topics. (Bug #32125)</li> <li>[Fix] Display profile icons when viewing a topic, or PM when only the jabber icon is to be visible. (Bug #34755)</li> + <li>[Fix] Do not send PMs with warnings if the user cannot read PMs or they are disabled. (Bug #30815)</li> <li>[Change] No longer allow the direct use of MULTI_INSERT in sql_build_array. sql_multi_insert() must be used.</li> <li>[Change] Display warning in ACP if config.php file is left writable.</li> 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 @@ <fieldset> <textarea name="warning" id="warning" class="inputbox" cols="40" rows="3">{L_WARNING_POST_DEFAULT}</textarea> + <!-- IF S_CAN_NOTIFY --> <br /><br /> <dl class="panel"> <dt> </dt> <dd><label><input type="checkbox" name="notify_user" checked="checked" /> {L_NOTIFY_USER_WARN}</label></dd> </dl> + <!-- ENDIF --> </fieldset> <span class="corners-bottom"><span></span></span></div> 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 @@ <fieldset> <textarea name="warning" id="warning" class="inputbox" cols="40" rows="3"></textarea> + <!-- IF S_CAN_NOTIFY --> <br /><br /> <dl class="panel"> <dt> </dt> <dd><label><input type="checkbox" name="notify_user" checked="checked" /> {L_NOTIFY_USER_WARN}</label></dd> </dl> + <!-- ENDIF --> </fieldset> <span class="corners-bottom"><span></span></span></div> 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 @@ <tr> <td class="row1" align="center"><textarea name="warning" rows="10" cols="76">{L_WARNING_POST_DEFAULT}</textarea></td> </tr> +<!-- IF S_CAN_NOTIFY --> <tr> <td class="row1" align="center"><input type="checkbox" class="radio" name="notify_user" checked="checked" /><span class="genmed">{L_NOTIFY_USER_WARN}</span></td> </tr> +<!-- ENDIF --> <tr> <td class="cat" align="center"><input class="btnmain" type="submit" name="action[add_warning]" value="{L_SUBMIT}" /> <input class="btnlite" type="reset" value="{L_RESET}" /></td> </tr> 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 @@ <tr> <td class="row1" align="center"><textarea name="warning" rows="10" cols="76"></textarea></td> </tr> +<!-- IF S_CAN_NOTIFY --> <tr> <td class="row1" align="center"><input type="checkbox" class="radio" name="notify_user" checked="checked" /><span class="genmed">{L_NOTIFY_USER_WARN}</span></td> </tr> +<!-- ENDIF --> <tr> <td class="cat" align="center"><input class="btnmain" type="submit" name="action[add_warning]" value="{L_SUBMIT}" /> <input class="btnlite" type="reset" value="{L_RESET}" /></td> </tr> |