aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorErik Frèrejean <erikfrerejean@phpbb.com>2011-02-03 14:36:37 +0100
committerErik Frèrejean <erikfrerejean@phpbb.com>2011-03-04 11:10:08 +0100
commit1b606133198eb1c37402bafea2e3c2c36b25d197 (patch)
tree6e1fe0a0fbefaa672ecf1d334485244f7f691795 /phpBB/includes
parentafae883619eb7d193b413b5599078a6f47ead408 (diff)
downloadforums-1b606133198eb1c37402bafea2e3c2c36b25d197.tar
forums-1b606133198eb1c37402bafea2e3c2c36b25d197.tar.gz
forums-1b606133198eb1c37402bafea2e3c2c36b25d197.tar.bz2
forums-1b606133198eb1c37402bafea2e3c2c36b25d197.tar.xz
forums-1b606133198eb1c37402bafea2e3c2c36b25d197.zip
[ticket/9581] Mass e-mail to banned users
Implement the suggestion made by Adam in the ticket, this will add an additional checkbox to the mass e-mail page. By checking this the mass e-mail shall also be send to banned users. By default banned users however are excluded from the mass e-mail. PHPBB3-9581
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_email.php20
1 files changed, 12 insertions, 8 deletions
diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php
index 350693a630..d65cce7899 100644
--- a/phpBB/includes/acp/acp_email.php
+++ b/phpBB/includes/acp/acp_email.php
@@ -69,6 +69,8 @@ class acp_email
if (!sizeof($error))
{
+ $sql_ban_where = (!isset($_REQUEST['mail_banned_flag'])) ? 'AND b.ban_userid != u.user_id' : '';
+
if ($usernames)
{
// If giving usernames the admin is able to email inactive users too...
@@ -83,21 +85,23 @@ class acp_email
if ($group_id)
{
$sql = 'SELECT u.user_email, u.username, u.username_clean, u.user_lang, u.user_jabber, u.user_notify_type
- FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . ' ug
+ FROM ' . BANLIST_TABLE . ' b, ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . ' ug
WHERE ug.group_id = ' . $group_id . '
AND ug.user_pending = 0
AND u.user_id = ug.user_id
AND u.user_allow_massemail = 1
- AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
- ORDER BY u.user_lang, u.user_notify_type';
+ AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ")
+ {$sql_ban_where}
+ ORDER BY u.user_lang, u.user_notify_type";
}
else
{
- $sql = 'SELECT username, username_clean, user_email, user_jabber, user_notify_type, user_lang
- FROM ' . USERS_TABLE . '
- WHERE user_allow_massemail = 1
- AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
- ORDER BY user_lang, user_notify_type';
+ $sql = 'SELECT u.username, u.username_clean, u.user_email, u.user_jabber, u.user_notify_type, u.user_lang
+ FROM (' . BANLIST_TABLE . ' b, ' . USERS_TABLE . ' u)
+ WHERE u.user_allow_massemail = 1
+ AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ")
+ {$sql_ban_where}
+ ORDER BY u.user_lang, u.user_notify_type";
}
}
$result = $db->sql_query($sql);