function hook_gauth_login_find_existing_user in Google Auth 7.2
Same name and namespace in other branches
- 7 gauth_login/gauth_login.api.php \hook_gauth_login_find_existing_user()
Find an existing user based on info from Google.
Parameters
array $info: The 'userinfo' array from OAuth.
Return value
object|NULL An existing Drupal user object if found; otherwise NULL.
1 invocation of hook_gauth_login_find_existing_user()
- gauth_login_find_existing_user in gauth_login/
gauth_login.module - Finds an existing user based on info from Google.
File
- gauth_login/
gauth_login.api.php, line 22 - Hooks provided by the GAuth Login module.
Code
function hook_gauth_login_find_existing_user($info) {
// Check to see if the user exists in a 3rd party system, ex. LDAP.
if ($remote_user_object = remote_find_user($info['email'])) {
// If so, we jumpstart creation of the local Drupal user and return it.
return remote_create_drupal_user($remote_user_object);
}
}