mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
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
This commit is contained in:
parent
a203d52e4f
commit
853a12cf00
6 changed files with 51 additions and 0 deletions
|
@ -139,6 +139,7 @@
|
||||||
<li>[Fix] Mark/unmark all links in UCP now select/unselect both subscribed topics and forums.</li>
|
<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] 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] 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] 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>
|
<li>[Change] Display warning in ACP if config.php file is left writable.</li>
|
||||||
|
|
|
@ -249,6 +249,25 @@ class mcp_warn
|
||||||
$this->u_action .= "&f=$forum_id&p=$post_id";
|
$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 ($warning && $action == 'add_warning')
|
||||||
{
|
{
|
||||||
if (check_form_key('mcp_warn'))
|
if (check_form_key('mcp_warn'))
|
||||||
|
@ -307,6 +326,8 @@ class mcp_warn
|
||||||
'RANK_IMG' => $rank_img,
|
'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"),
|
'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";
|
$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 ($warning && $action == 'add_warning')
|
||||||
{
|
{
|
||||||
if (check_form_key('mcp_warn'))
|
if (check_form_key('mcp_warn'))
|
||||||
|
@ -389,6 +429,8 @@ class mcp_warn
|
||||||
|
|
||||||
'AVATAR_IMG' => $avatar_img,
|
'AVATAR_IMG' => $avatar_img,
|
||||||
'RANK_IMG' => $rank_img,
|
'RANK_IMG' => $rank_img,
|
||||||
|
|
||||||
|
'S_CAN_NOTIFY' => $s_can_notify,
|
||||||
));
|
));
|
||||||
|
|
||||||
return $user_id;
|
return $user_id;
|
||||||
|
|
|
@ -52,11 +52,13 @@
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<textarea name="warning" id="warning" class="inputbox" cols="40" rows="3">{L_WARNING_POST_DEFAULT}</textarea>
|
<textarea name="warning" id="warning" class="inputbox" cols="40" rows="3">{L_WARNING_POST_DEFAULT}</textarea>
|
||||||
|
<!-- IF S_CAN_NOTIFY -->
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<dl class="panel">
|
<dl class="panel">
|
||||||
<dt> </dt>
|
<dt> </dt>
|
||||||
<dd><label><input type="checkbox" name="notify_user" checked="checked" /> {L_NOTIFY_USER_WARN}</label></dd>
|
<dd><label><input type="checkbox" name="notify_user" checked="checked" /> {L_NOTIFY_USER_WARN}</label></dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
<!-- ENDIF -->
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<span class="corners-bottom"><span></span></span></div>
|
<span class="corners-bottom"><span></span></span></div>
|
||||||
|
|
|
@ -36,11 +36,13 @@
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<textarea name="warning" id="warning" class="inputbox" cols="40" rows="3"></textarea>
|
<textarea name="warning" id="warning" class="inputbox" cols="40" rows="3"></textarea>
|
||||||
|
<!-- IF S_CAN_NOTIFY -->
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<dl class="panel">
|
<dl class="panel">
|
||||||
<dt> </dt>
|
<dt> </dt>
|
||||||
<dd><label><input type="checkbox" name="notify_user" checked="checked" /> {L_NOTIFY_USER_WARN}</label></dd>
|
<dd><label><input type="checkbox" name="notify_user" checked="checked" /> {L_NOTIFY_USER_WARN}</label></dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
<!-- ENDIF -->
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<span class="corners-bottom"><span></span></span></div>
|
<span class="corners-bottom"><span></span></span></div>
|
||||||
|
|
|
@ -45,9 +45,11 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" align="center"><textarea name="warning" rows="10" cols="76">{L_WARNING_POST_DEFAULT}</textarea></td>
|
<td class="row1" align="center"><textarea name="warning" rows="10" cols="76">{L_WARNING_POST_DEFAULT}</textarea></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<!-- IF S_CAN_NOTIFY -->
|
||||||
<tr>
|
<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>
|
<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>
|
</tr>
|
||||||
|
<!-- ENDIF -->
|
||||||
<tr>
|
<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>
|
<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>
|
</tr>
|
||||||
|
|
|
@ -58,9 +58,11 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" align="center"><textarea name="warning" rows="10" cols="76"></textarea></td>
|
<td class="row1" align="center"><textarea name="warning" rows="10" cols="76"></textarea></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<!-- IF S_CAN_NOTIFY -->
|
||||||
<tr>
|
<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>
|
<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>
|
</tr>
|
||||||
|
<!-- ENDIF -->
|
||||||
<tr>
|
<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>
|
<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>
|
</tr>
|
||||||
|
|
Loading…
Add table
Reference in a new issue