You are here

function hook_fboauth_user_presave in Facebook OAuth (FBOAuth) 7

Same name and namespace in other branches
  1. 6 fboauth.api.php \hook_fboauth_user_presave()
  2. 7.2 fboauth.api.php \hook_fboauth_user_presave()

Hook to manually map Facebook data to a Drupal user account upon connecting.

This hook is fired before a Drupal user account is created by the Facebook OAuth module.

Parameters

$edit: A user account array, not yet including the UID. Make modifications to this array if other modules will then save this information for you in hook_user_presave() or hook_user_insert().

$fbuser: The Facebook user account. Note that the contents of this object may change depending on what access the user has granted.

Return value

None. Modify the $edit array by reference.

See also

hook_fboauth_user_save()

1 invocation of hook_fboauth_user_presave()
fboauth_create_user in includes/fboauth.fboauth.inc
Given a Facebook user object, associate or save a Drupal user account.

File

./fboauth.api.php, line 89
This file contains API documentation for the Facebook OAuth module. Note that all of this code is merely for example purposes, it is never executed when using the Facebook OAuth module.

Code

function hook_fboauth_user_presave(&$edit, $fbuser) {

  // Save the user's first name into a field provided by Profile module.
  if (isset($fbuser->first_name)) {
    $edit['profile_first_name'] = $fbuser->first_name;
  }
}