You are here

function fb_user_get_local_user_by_email in Drupal for Facebook 7.3

Same name and namespace in other branches
  1. 6.3 fb_user.module \fb_user_get_local_user_by_email()

Try to determine the local user account by the email address.

1 call to fb_user_get_local_user_by_email()
_fb_user_create_map_by_email in ./fb_user.module

File

./fb_user.module, line 1132
This module manages relations between local Drupal user accounts and their accounts on facebook.com.

Code

function fb_user_get_local_user_by_email($fbu) {
  global $_fb;
  if (isset($_fb) && $fbu) {
    try {
      $info = $_fb
        ->api($fbu);
      if (isset($info['email']) && ($email = $info['email'])) {
        return user_load_by_mail($email);
      }
    } catch (Exception $e) {

      // This can occur when user logs out of facebook in another window, then returns to our site.
      if (fb_verbose()) {
        fb_log_exception($e, t('Failed to get facebook user email.'));
      }
    }
  }
}