You are here

function simple_fb_connect_get_email in Simple FB Connect 7.2

Returns user's email address from Facebook profile.

Parameters

Facebook\GraphObject $fb_profile: User's Facebook profile.

Return value

string|false User's email address if found. False otherwise.

1 call to simple_fb_connect_get_email()
simple_fb_connect_return_from_fb in ./simple_fb_connect.module
Page callback for /user/simple-fb-connect/return.

File

./simple_fb_connect.module, line 627
Simple Facebook Login Module for Drupal Sites.

Code

function simple_fb_connect_get_email(GraphObject $fb_profile) {
  if ($email = $fb_profile
    ->getProperty('email')) {
    return $email;
  }

  // Email address was not found. Log error and return FALSE.
  watchdog('simple_fb_connect', 'No email address in FB user profile', array(), WATCHDOG_ERROR);
  return FALSE;
}