You are here

gauth_login.api.php in Google Auth 7.2

Same filename and directory in other branches
  1. 7 gauth_login/gauth_login.api.php

Hooks provided by the GAuth Login module.

File

gauth_login/gauth_login.api.php
View source
<?php

/**
 * @file
 * Hooks provided by the GAuth Login module.
 */

/**
 * @addtogroup hooks
 * @{
 */

/**
 * Find an existing user based on info from Google.
 *
 * @param array $info
 *   The 'userinfo' array from OAuth.
 *
 * @return object|NULL
 *   An existing Drupal user object if found; otherwise NULL.
 */
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);
  }
}

/**
 * @} End of "addtogroup hooks".
 */

Functions

Namesort descending Description
hook_gauth_login_find_existing_user Find an existing user based on info from Google.