You are here

function fb_connect_user in Drupal for Facebook 5.2

Same name and namespace in other branches
  1. 6.2 fb_connect.module \fb_connect_user()

Implementation of hook_user

On logout, redirect the user so facebook can expire their session. Should be a facebook API to do this, but there's none I know of.

File

./fb_connect.module, line 102
Support for Facebook Connect features

Code

function fb_connect_user($op, &$edit, &$account, $category = NULL) {
  if ($op == 'logout') {
    if (isset($GLOBALS['fb_connect_apikey'])) {
      global $fb, $fb_app;
      try {
        if ($fb && $fb->api_client->session_key) {

          // We will log out of facebook in hook_exit.
          $GLOBALS['fb_connect_logging_out'] = TRUE;
        }
      } catch (Exception $e) {
        fb_log_exception($e, t('Failed to log out of fbConnect session'));
      }
    }
  }
}