You are here

function _fb_user_set_current_user in Drupal for Facebook 7.4

1 call to _fb_user_set_current_user()
_fb_user_process_new_token in ./fb_user.module

File

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

Code

function _fb_user_set_current_user($account) {
  if ($GLOBALS['user']->uid == $account->uid) {

    // Nothing to do.
    return;
  }

  // TODO: test if user is blocked.
  // user_external_login() removed in D7, no replacement.  Let's hope the following works.
  $GLOBALS['user'] = $account;
  $account_array = (array) $account;
  user_login_finalize($account_array);

  // TODO: notify third parties that user has changed.  Needed?
}