aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/acp_email.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-02-06 19:09:43 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-02-06 19:09:43 +0000
commit333b3515ed1e94dba1593b2eb3f9fb9d5a1f1440 (patch)
tree08a84c7c140f482b7e7917acc6bc6480e5b0ff43 /phpBB/includes/acp/acp_email.php
parent10f775cb1cc44b083373543a6c08214d1dd291f0 (diff)
downloadforums-333b3515ed1e94dba1593b2eb3f9fb9d5a1f1440.tar
forums-333b3515ed1e94dba1593b2eb3f9fb9d5a1f1440.tar.gz
forums-333b3515ed1e94dba1593b2eb3f9fb9d5a1f1440.tar.bz2
forums-333b3515ed1e94dba1593b2eb3f9fb9d5a1f1440.tar.xz
forums-333b3515ed1e94dba1593b2eb3f9fb9d5a1f1440.zip
Some... fixes... laying around here.
git-svn-id: file:///svn/phpbb/trunk@6970 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acp/acp_email.php')
-rw-r--r--phpBB/includes/acp/acp_email.php29
1 files changed, 20 insertions, 9 deletions
diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php
index 6b2904b245..57d03ff67e 100644
--- a/phpBB/includes/acp/acp_email.php
+++ b/phpBB/includes/acp/acp_email.php
@@ -55,6 +55,7 @@ class acp_email
{
if ($usernames)
{
+ // If giving usernames the admin is able to email inactive users too...
$sql = 'SELECT username, user_email, user_jabber, user_notify_type, user_lang
FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('username_clean', array_map('utf8_clean_string', explode("\n", $usernames))) . '
@@ -66,18 +67,20 @@ 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
- WHERE ug.group_id = $group_id
+ FROM ' . 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
- ORDER BY u.user_lang, u.user_notify_type";
+ AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
+ 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';
}
}
@@ -172,17 +175,25 @@ class acp_email
$messenger->save_queue();
- if ($group_id)
+ if ($usernames)
{
- $group_name = get_group_name($group_id);
+ $usernames = explode("\n", $usernames);
+ add_log('admin', 'LOG_MASS_EMAIL', implode(', ', $usernames));
}
else
{
- // Not great but the logging routine doesn't cope well with localising on the fly
- $group_name = $user->lang['ALL_USERS'];
- }
+ if ($group_id)
+ {
+ $group_name = get_group_name($group_id);
+ }
+ else
+ {
+ // Not great but the logging routine doesn't cope well with localising on the fly
+ $group_name = $user->lang['ALL_USERS'];
+ }
- add_log('admin', 'LOG_MASS_EMAIL', $group_name);
+ add_log('admin', 'LOG_MASS_EMAIL', $group_name);
+ }
if (!$errored)
{