aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_user.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2014-10-25 14:56:04 -0700
committerMarc Alexander <admin@m-a-styles.de>2014-10-25 14:57:01 -0700
commit81ad381263436bc2a5ef1a18388e1ed5c48eac9d (patch)
tree9ed7bdbd5adcb856d1ac4bd7149507231c72fee9 /phpBB/includes/functions_user.php
parent18f24a2270610d18b06a1ba2b6012beffe676603 (diff)
downloadforums-81ad381263436bc2a5ef1a18388e1ed5c48eac9d.tar
forums-81ad381263436bc2a5ef1a18388e1ed5c48eac9d.tar.gz
forums-81ad381263436bc2a5ef1a18388e1ed5c48eac9d.tar.bz2
forums-81ad381263436bc2a5ef1a18388e1ed5c48eac9d.tar.xz
forums-81ad381263436bc2a5ef1a18388e1ed5c48eac9d.zip
[ticket/13207] Move default user notifications settings to user_add()
PHPBB3-13207
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r--phpBB/includes/functions_user.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 82a02eeb4b..f79a8998c4 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -161,10 +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
+* @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, $notifications_data = array())
+function user_add($user_row, $cp_data = false, $notifications_data = null)
{
global $db, $user, $auth, $config, $phpbb_root_path, $phpEx;
global $phpbb_dispatcher, $phpbb_container;
@@ -348,6 +348,21 @@ function user_add($user_row, $cp_data = false, $notifications_data = array())
set_config('newest_user_colour', $row['group_colour'], true);
}
+ // Use default notifications settings if notifications_data is not set
+ if ($notifications_data === null)
+ {
+ $notifications_data = array(
+ array(
+ 'item_type' => 'notification.type.post',
+ 'method' => 'notification.method.email',
+ ),
+ array(
+ 'item_type' => 'notification.type.topic',
+ 'method' => 'notification.method.email',
+ ),
+ );
+ }
+
// Subscribe user to notifications if necessary
if (!empty($notifications_data))
{