- Patch #319840 by Aron Novak, darren.ferguson: added hook to the OpenID module for returning data when a user has logged in.
parent
f8c8827b24
commit
4c49bf4a56
|
@ -31,6 +31,21 @@ function hook_openid($op, $request) {
|
||||||
return $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".
|
* @} End of "addtogroup hooks".
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -418,6 +418,8 @@ function openid_authentication($response) {
|
||||||
// Load global $user and perform final login tasks.
|
// Load global $user and perform final login tasks.
|
||||||
$form_state['uid'] = $account->uid;
|
$form_state['uid'] = $account->uid;
|
||||||
user_login_submit(array(), $form_state);
|
user_login_submit(array(), $form_state);
|
||||||
|
// Let other modules act on OpenID login
|
||||||
|
module_invoke_all('openid_response', $response, $account);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -458,6 +460,8 @@ function openid_authentication($response) {
|
||||||
// Load global $user and perform final login tasks.
|
// Load global $user and perform final login tasks.
|
||||||
$form_state['uid'] = $account->uid;
|
$form_state['uid'] = $account->uid;
|
||||||
user_login_submit(array(), $form_state);
|
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']);
|
drupal_redirect_form($form, $form_state['redirect']);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue