diff options
author | Nathan Guse <nathaniel.guse@gmail.com> | 2013-07-26 10:26:52 -0500 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2013-07-26 10:26:52 -0500 |
commit | e0ef10128b68cfae9774f6c87cc1a841cacecd8d (patch) | |
tree | d520415262df9d64ae115789ce221d37a1d4050a /phpBB/includes/ucp | |
parent | 26dac64d45944dce14b33a9c82e531f01f9a623f (diff) | |
download | forums-e0ef10128b68cfae9774f6c87cc1a841cacecd8d.tar forums-e0ef10128b68cfae9774f6c87cc1a841cacecd8d.tar.gz forums-e0ef10128b68cfae9774f6c87cc1a841cacecd8d.tar.bz2 forums-e0ef10128b68cfae9774f6c87cc1a841cacecd8d.tar.xz forums-e0ef10128b68cfae9774f6c87cc1a841cacecd8d.zip |
[ticket/11744] Group join request notification
PHPBB3-11744
Diffstat (limited to 'phpBB/includes/ucp')
-rw-r--r-- | phpBB/includes/ucp/ucp_groups.php | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index 8620e33e47..fbb0f41e21 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -198,36 +198,12 @@ class ucp_groups { group_user_add($group_id, $user->data['user_id'], false, false, false, 0, 1); - include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); - $messenger = new messenger(); + $phpbb_notifications = $phpbb_container->get('notification_manager'); - $sql = 'SELECT u.username, u.username_clean, u.user_email, u.user_notify_type, u.user_jabber, u.user_lang - FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . " u - WHERE ug.user_id = u.user_id - AND ug.group_leader = 1 - AND ug.group_id = $group_id"; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - $messenger->template('group_request', $row['user_lang']); - - $messenger->set_addresses($row); - - $messenger->assign_vars(array( - 'USERNAME' => htmlspecialchars_decode($row['username']), - 'GROUP_NAME' => htmlspecialchars_decode($group_row[$group_id]['group_name']), - 'REQUEST_USERNAME' => $user->data['username'], - - 'U_PENDING' => generate_board_url() . "/ucp.$phpEx?i=groups&mode=manage&action=list&g=$group_id", - 'U_GROUP' => generate_board_url() . "/memberlist.$phpEx?mode=group&g=$group_id") - ); - - $messenger->send($row['user_notify_type']); - } - $db->sql_freeresult($result); - - $messenger->save_queue(); + $phpbb_notifications->add_notifications('group_request', array_merge( + $group_row[$group_id], + array('user_id' => $user->data['user_id']) + )); } add_log('user', $user->data['user_id'], 'LOG_USER_GROUP_JOIN' . (($group_row[$group_id]['group_type'] == GROUP_FREE) ? '' : '_PENDING'), $group_row[$group_id]['group_name']); |