function hook_fboauth_user_save in Facebook OAuth (FBOAuth) 7.2
Same name and namespace in other branches
- 6 fboauth.api.php \hook_fboauth_user_save()
- 7 fboauth.api.php \hook_fboauth_user_save()
Hook to manually save Facebook data after a user has connected.
This hook is fired after a Drupal user account is created by the Facebook OAuth module.
Parameters
$account: A full Drupal user account object.
$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.
See also
1 invocation of hook_fboauth_user_save()
- 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 112 - 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_save($account, $fbuser) {
// Save the Facebook user ID into a custom module table.
$mydata = array(
'uid' => $account->uid,
'fbid' => $fbuser->id,
'real_name' => $fbuser->name,
);
drupal_write_record('mytable', $mydata);
}