mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/13207] Move default user notifications settings to user_add()
PHPBB3-13207
This commit is contained in:
parent
18f24a2270
commit
81ad381263
2 changed files with 18 additions and 14 deletions
|
@ -164,7 +164,7 @@ function user_update_name($old_name, $new_name)
|
||||||
* @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.
|
* @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 $db, $user, $auth, $config, $phpbb_root_path, $phpEx;
|
||||||
global $phpbb_dispatcher, $phpbb_container;
|
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);
|
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
|
// Subscribe user to notifications if necessary
|
||||||
if (!empty($notifications_data))
|
if (!empty($notifications_data))
|
||||||
{
|
{
|
||||||
|
|
|
@ -314,24 +314,13 @@ class ucp_register
|
||||||
'user_inactive_time' => $user_inactive_time,
|
'user_inactive_time' => $user_inactive_time,
|
||||||
);
|
);
|
||||||
|
|
||||||
$user_notifications_data = array(
|
|
||||||
array(
|
|
||||||
'item_type' => 'notification.type.post',
|
|
||||||
'method' => 'notification.method.email',
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'item_type' => 'notification.type.topic',
|
|
||||||
'method' => 'notification.method.email',
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($config['new_member_post_limit'])
|
if ($config['new_member_post_limit'])
|
||||||
{
|
{
|
||||||
$user_row['user_new'] = 1;
|
$user_row['user_new'] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register user...
|
// Register user...
|
||||||
$user_id = user_add($user_row, $cp_data, $user_notifications_data);
|
$user_id = user_add($user_row, $cp_data);
|
||||||
|
|
||||||
// This should not happen, because the required variables are listed above...
|
// This should not happen, because the required variables are listed above...
|
||||||
if ($user_id === false)
|
if ($user_id === false)
|
||||||
|
|
Loading…
Add table
Reference in a new issue