1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/11103] Move banned user checking to email method

This will make sure banned users are never sent notification emails

PHPBB3-11103
This commit is contained in:
Nathaniel Guse
2012-09-08 21:05:49 -05:00
parent 6983f380c5
commit 98a03090a0
2 changed files with 14 additions and 14 deletions

View File

@@ -52,6 +52,13 @@ class phpbb_notifications_method_email extends phpbb_notifications_method_base
$user_ids[] = $notification->user_id;
}
// We do not send emails to banned users
if (!function_exists('phpbb_get_banned_user_ids'))
{
include($phpbb_container->getParameter('core.root_path') . 'includes/functions_user.' . $phpbb_container->getParameter('core.php_ext'));
}
$banned_users = phpbb_get_banned_user_ids($user_ids);
$sql = 'SELECT * FROM ' . USERS_TABLE . '
WHERE ' . $this->db->sql_in_set('user_id', $user_ids);
$result = $this->db->sql_query($sql);
@@ -72,6 +79,11 @@ class phpbb_notifications_method_email extends phpbb_notifications_method_base
// Time to go through the queue and send emails
foreach ($this->queue as $notification)
{
if (in_array($notification->user_id, $banned_users))
{
continue;
}
$notification->users($users);
$user = $notification->get_user($notification->user_id);