diff options
| author | Joas Schilling <nickvergessen@gmx.de> | 2014-11-22 12:21:30 +0100 |
|---|---|---|
| committer | Joas Schilling <nickvergessen@gmx.de> | 2014-11-22 12:21:30 +0100 |
| commit | 45aafe0b09a06650846949fe24cdecb877db5da5 (patch) | |
| tree | 56ac14acb2c14c90adbe4b624e79683fcfe7cf27 | |
| parent | 8ce736ad8a328c25dddf514221e6106c9c902e27 (diff) | |
| parent | 8b711038368bc0a52d1b532a2f1b7c8c45ac2d0a (diff) | |
| download | forums-45aafe0b09a06650846949fe24cdecb877db5da5.tar forums-45aafe0b09a06650846949fe24cdecb877db5da5.tar.gz forums-45aafe0b09a06650846949fe24cdecb877db5da5.tar.bz2 forums-45aafe0b09a06650846949fe24cdecb877db5da5.tar.xz forums-45aafe0b09a06650846949fe24cdecb877db5da5.zip | |
Merge branch 'develop-ascraeus' into develop
| -rw-r--r-- | phpBB/includes/acp/acp_email.php | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php index fe55b36e67..4fefd6bec3 100644 --- a/phpBB/includes/acp/acp_email.php +++ b/phpBB/includes/acp/acp_email.php @@ -26,7 +26,7 @@ class acp_email function main($id, $mode) { global $config, $db, $user, $auth, $template, $cache; - global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $phpbb_dispatcher; $user->add_lang('acp/email'); $this->tpl_name = 'acp_email'; @@ -72,11 +72,15 @@ 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))) . ' - AND user_allow_massemail = 1 - ORDER BY user_lang, user_notify_type'; // , SUBSTRING(user_email FROM INSTR(user_email, '@')) + $sql_ary = array( + 'SELECT' => 'username, user_email, user_jabber, user_notify_type, user_lang', + 'FROM' => array( + USERS_TABLE => '', + ), + 'WHERE' => $db->sql_in_set('username_clean', array_map('utf8_clean_string', explode("\n", $usernames))) . ' + AND user_allow_massemail = 1', + 'ORDER_BY' => 'user_lang, user_notify_type', + ); } else { @@ -123,8 +127,18 @@ class acp_email ), ); } - $sql = $db->sql_build_query('SELECT', $sql_ary); } + /** + * Modify sql query to change the list of users the email is sent to + * + * @event core.acp_email_modify_sql + * @var array sql_ary Array which is used to build the sql query + * @since 3.1.2-RC1 + */ + $vars = array('sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.acp_email_modify_sql', compact($vars))); + + $sql = $db->sql_build_query('SELECT', $sql_ary); $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); |
