diff options
author | Marc Alexander <admin@m-a-styles.de> | 2014-10-25 14:50:01 -0700 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2014-10-25 14:50:01 -0700 |
commit | 18f24a2270610d18b06a1ba2b6012beffe676603 (patch) | |
tree | c63c6e2913ac06619e71a9c8bd590df7be7bef82 /phpBB/includes/functions_user.php | |
parent | f22cd2d7348dc3a103e53aa773b6f91abe998ddd (diff) | |
download | forums-18f24a2270610d18b06a1ba2b6012beffe676603.tar forums-18f24a2270610d18b06a1ba2b6012beffe676603.tar.gz forums-18f24a2270610d18b06a1ba2b6012beffe676603.tar.bz2 forums-18f24a2270610d18b06a1ba2b6012beffe676603.tar.xz forums-18f24a2270610d18b06a1ba2b6012beffe676603.zip |
[ticket/13207] Add default subscription options for newly registered users
PHPBB3-13207
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r-- | phpBB/includes/functions_user.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index e4479f07b0..82a02eeb4b 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -161,9 +161,10 @@ function user_update_name($old_name, $new_name) * * @param mixed $user_row An array containing the following keys (and the appropriate values): username, group_id (the group to place the user in), user_email and the user_type(usually 0). Additional entries not overridden by defaults will be forwarded. * @param string $cp_data custom profile fields, see custom_profile::build_insert_sql_array + * @param array $notifications_data The notifications settings for the new user * @return the new user's ID. */ -function user_add($user_row, $cp_data = false) +function user_add($user_row, $cp_data = false, $notifications_data = array()) { global $db, $user, $auth, $config, $phpbb_root_path, $phpEx; global $phpbb_dispatcher, $phpbb_container; @@ -347,6 +348,16 @@ function user_add($user_row, $cp_data = false) set_config('newest_user_colour', $row['group_colour'], true); } + // Subscribe user to notifications if necessary + if (!empty($notifications_data)) + { + $phpbb_notifications = $phpbb_container->get('notification_manager'); + foreach ($notifications_data as $subscription) + { + $phpbb_notifications->add_subscription($subscription['item_type'], 0, $subscription['method'], $user_id); + } + } + /** * Event that returns user id, user detals and user CPF of newly registared user * |