Commit 0a2fff5d authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Added hooks for user creation

parent 7b6c3498
...@@ -175,6 +175,8 @@ function uploadcsv_submit($values) { ...@@ -175,6 +175,8 @@ function uploadcsv_submit($values) {
foreach (ArtefactTypeProfile::get_mandatory_fields() as $field => $type) { foreach (ArtefactTypeProfile::get_mandatory_fields() as $field => $type) {
set_profile_field($id, $field, $record[$i++]); set_profile_field($id, $field, $record[$i++]);
} }
handle_event('createuser', $user);
} }
log_info('Inserted ' . count($CSVDATA) . ' records'); log_info('Inserted ' . count($CSVDATA) . ' records');
......
...@@ -536,6 +536,7 @@ function login_submit($values) { ...@@ -536,6 +536,7 @@ function login_submit($values) {
$userdata = call_static_method($authclass, 'get_user_info', $username); $userdata = call_static_method($authclass, 'get_user_info', $username);
$userdata->lastlogin = db_format_timestamp(time()); $userdata->lastlogin = db_format_timestamp(time());
insert_record('usr', $userdata); insert_record('usr', $userdata);
handle_event('createuser', $userdata);
} }
// @todo config form option for this for each external plugin. NOT for internal // @todo config form option for this for each external plugin. NOT for internal
else if (get_config_plugin('auth', $authtype, 'updateuserinfoonlogin')) { else if (get_config_plugin('auth', $authtype, 'updateuserinfoonlogin')) {
......
...@@ -96,6 +96,7 @@ if (isset($_REQUEST['key'])) { ...@@ -96,6 +96,7 @@ if (isset($_REQUEST['key'])) {
} }
db_commit(); db_commit();
handle_event('createuser', $registration);
// Log the user in and send them to the homepage // Log the user in and send them to the homepage
$USER->login($registration); $USER->login($registration);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment