You are here

function fb_infinite_display_page in Drupal for Facebook 5

Same name and namespace in other branches
  1. 5.2 fb_infinite.module \fb_infinite_display_page()

Menu callback. Ensures the user is logged in and displays user id and session key.

1 string reference to 'fb_infinite_display_page'
fb_infinite_menu in ./fb_infinite.module
hook_menu

File

./fb_infinite.module, line 142
This module manages an infinite session for each Facebook App. http://wiki.developers.facebook.com/index.php/Infinite_session_keys

Code

function fb_infinite_display_page() {
  global $fb, $fb_app;
  if (!$fb_app) {
    drupal_set_message(t('This page must be viewed as a Facebook canvas page.'), 'error');
    drupal_not_found();
    exit;
  }
  $fbu = $fb
    ->require_login();
  $output .= '<p>' . t('Facebook user id: %fbu', array(
    '%fbu' => $fb->api_client
      ->users_getLoggedInUser(),
  )) . '</p>';
  $output .= '<p>' . t('Facebook session key: %session', array(
    '%session' => $fb->api_client->session_key,
  )) . '</p>';
  $output .= '<p>' . t('Use the values above when configuring the infinite session of your Facebook App.') . '</p>';
  return $output;
}