You are here

function fb_user_user_load in Drupal for Facebook 7.3

Same name and namespace in other branches
  1. 7.4 fb_user.module \fb_user_user_load()

Implements hook_user_load.

Use no standard email, use proxy email if available

File

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

Code

function fb_user_user_load($users) {
  global $_fb_app;
  foreach ($users as $account) {
    if ($account->uid && $_fb_app) {
      if (!$account->mail && ($fbu = _fb_user_get_fbu($account->uid))) {

        // Use proxied email, if facebook app is active and user uses it.
        // TODO: confirm drupal never saves proxied address to users.mail.
        $account->mail = fb_user_get_proxied_email($fbu, $_fb_app);
        $account->fb_user_proxied_mail = $account->mail;

        // Remember where we got address.
      }
    }
  }
}