You are here

function hook_janrain_capture_user_authenticated in Janrain Registration 7

Same name and namespace in other branches
  1. 8 janrain_capture.api.php \hook_janrain_capture_user_authenticated()
  2. 7.4 janrain_capture.api.php \hook_janrain_capture_user_authenticated()
  3. 7.2 janrain_capture.api.php \hook_janrain_capture_user_authenticated()
  4. 7.3 janrain_capture.api.php \hook_janrain_capture_user_authenticated()

Act on users when authenticated

This hook is executed immediately after the user authentication method is processed but before the page is rendered. Modules may use this to act on user data received during authentication.

Parameters

array $capture_profile: The profile data returned from the user's Capture record

array $account: The local Drupal user account being authenticated

boolean $new_user: TRUE if this is the users first time to this site

1 invocation of hook_janrain_capture_user_authenticated()
janrain_capture_oauth in ./janrain_capture.pages.inc
Callback for the janrain_capture/oauth menu item. This serves as the redirect_uri Capture redirects the user to and performs the authentication.

File

./janrain_capture.api.php, line 21
Hooks provided by Janrain Capture

Code

function hook_janrain_capture_user_authenticated($capture_profile, $account, $new_user) {
  if ($new_user) {
    $params['account'] = $account;

    // EXAMPLE:
    // Execute the welcome_message_mail function with key being either 'male',
    // 'female', or null.
    drupal_mail('welcome_message', $capture_profile['gender'], $account->mail, user_preferred_language($account), $params);
  }
}