mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
Merge pull request #2586 from lucifer4o/ticket/12701
[Ticket/12701] Add events to user_add function * lucifer4o/ticket/12701: [ticket/12701] Add change [ticket/12701] Rmove before event and expand modify_data [ticket/12701] Add events to user_add function
This commit is contained in:
commit
1e97502d90
1 changed files with 16 additions and 1 deletions
17
phpBB/includes/functions_user.php
Normal file → Executable file
17
phpBB/includes/functions_user.php
Normal file → Executable file
|
@ -261,10 +261,13 @@ function user_add($user_row, $cp_data = false)
|
||||||
* Use this event to modify the values to be inserted when a user is added
|
* Use this event to modify the values to be inserted when a user is added
|
||||||
*
|
*
|
||||||
* @event core.user_add_modify_data
|
* @event core.user_add_modify_data
|
||||||
|
* @var array user_row Array of user details submited to user_add
|
||||||
|
* @var array cp_data Array of Custom profile fields submited to user_add
|
||||||
* @var array sql_ary Array of data to be inserted when a user is added
|
* @var array sql_ary Array of data to be inserted when a user is added
|
||||||
* @since 3.1.0-a1
|
* @since 3.1.0-a1
|
||||||
|
* @change 3.1.0-b5
|
||||||
*/
|
*/
|
||||||
$vars = array('sql_ary');
|
$vars = array('user_row', 'cp_data', 'sql_ary');
|
||||||
extract($phpbb_dispatcher->trigger_event('core.user_add_modify_data', compact($vars)));
|
extract($phpbb_dispatcher->trigger_event('core.user_add_modify_data', compact($vars)));
|
||||||
|
|
||||||
$sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
|
$sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
|
||||||
|
@ -344,6 +347,18 @@ function user_add($user_row, $cp_data = false)
|
||||||
set_config('newest_user_colour', $row['group_colour'], true);
|
set_config('newest_user_colour', $row['group_colour'], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Event that returns user id, user detals and user CPF of newly registared user
|
||||||
|
*
|
||||||
|
* @event core.user_add_after
|
||||||
|
* @var int user_id User id of newly registared user
|
||||||
|
* @var array user_row Array of user details submited to user_add
|
||||||
|
* @var array cp_data Array of Custom profile fields submited to user_add
|
||||||
|
* @since 3.1.0-b5
|
||||||
|
*/
|
||||||
|
$vars = array('user_id', 'user_row', 'cp_data');
|
||||||
|
extract($phpbb_dispatcher->trigger_event('core.user_add_after', compact($vars)));
|
||||||
|
|
||||||
return $user_id;
|
return $user_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue