You are here

function fb_user_footer in Drupal for Facebook 6.3

File

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

Code

function fb_user_footer() {
  if (($fbu = fb_facebook_user()) && !fb_is_tab() && $fbu != fb_get_fbu($GLOBALS['user'])) {
    $uid = $GLOBALS['user']->uid;

    // Remember original uid.
    _fb_user_process_authorized_user();
    if ($uid != $GLOBALS['user']->uid) {

      // We've detected a change of user and started a new session.  Refresh page.
      if (!fb_controls(FB_USER_CONTROL_NO_REDIRECT)) {
        if (empty($REQUEST['_fb_user_fbu']) || $REQUEST['_fb_user_fbu'] != $fbu) {
          drupal_goto($_GET['q'], array(
            // Parameter avoids refresh loop when third-party cookies disabled on Safari.
            '_fb_user_fbu' => $fbu,
          ));
        }
      }
    }
  }
}