diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-09-13 14:20:00 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-09-13 14:20:00 +0000 |
commit | 4c49bf4a56fc489cf77ffeda493b4f2d13e25c8e (patch) | |
tree | 2c9d340213330e5ba1888e0349b8bd9dad4ffd75 | |
parent | f8c8827b2416ad6d8b0a1beb4a58db66032a7508 (diff) | |
download | brdo-4c49bf4a56fc489cf77ffeda493b4f2d13e25c8e.tar.gz brdo-4c49bf4a56fc489cf77ffeda493b4f2d13e25c8e.tar.bz2 |
- Patch #319840 by Aron Novak, darren.ferguson: added hook to the OpenID module for returning data when a user has logged in.
-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']); } |