diff options
-rw-r--r-- | modules/openid/openid.api.php | 15 | ||||
-rw-r--r-- | modules/openid/openid.module | 4 |
2 files changed, 19 insertions, 0 deletions
diff --git a/modules/openid/openid.api.php b/modules/openid/openid.api.php index 41f099148..2144945ee 100644 --- a/modules/openid/openid.api.php +++ b/modules/openid/openid.api.php @@ -32,5 +32,20 @@ function hook_openid($op, $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". */ diff --git a/modules/openid/openid.module b/modules/openid/openid.module index c1a026672..df8395497 100644 --- a/modules/openid/openid.module +++ b/modules/openid/openid.module @@ -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']); } |