Skip to content
Snippets Groups Projects
Commit 4c49bf4a authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #319840 by Aron Novak, darren.ferguson: added hook to the OpenID...

- Patch #319840 by Aron Novak, darren.ferguson: added hook to the OpenID module for returning data when a user has logged in.
parent f8c8827b
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -31,6 +31,21 @@ function hook_openid($op, $request) {
return $request;
}
/**
* Allow modules to act upon a successful OpenID login.
*
* @param $response
* Response values from the OpenID Provider.
* @param $account
* The Drupal user account that logged in
*
*/
function hook_openid_response($response, $account) {
if (isset($response['openid.ns.ax'])) {
_mymodule_store_ax_fields($response, $account);
}
}
/**
* @} End of "addtogroup hooks".
*/
......@@ -418,6 +418,8 @@ function openid_authentication($response) {
// Load global $user and perform final login tasks.
$form_state['uid'] = $account->uid;
user_login_submit(array(), $form_state);
// Let other modules act on OpenID login
module_invoke_all('openid_response', $response, $account);
}
}
else {
......@@ -458,6 +460,8 @@ function openid_authentication($response) {
// Load global $user and perform final login tasks.
$form_state['uid'] = $account->uid;
user_login_submit(array(), $form_state);
// Let other modules act on OpenID login
module_invoke_all('openid_response', $response, $account);
}
drupal_redirect_form($form, $form_state['redirect']);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment