1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02: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:
Chris Smith
2008-10-11 17:01:43 +00:00
parent a203d52e4f
commit 853a12cf00
6 changed files with 51 additions and 0 deletions

View File

@@ -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;