You are here

function fb_infinite_fb in Drupal for Facebook 5

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

hook_fb.

File

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

Code

function fb_infinite_fb($fb, $fb_app, $op, &$return) {
  if ($op == FB_OP_GET_INFINITE_SESSION) {

    // The fb module is asking for infinite session login information.
    // This module knows it, so we provide it.
    $fb_app_data = fb_app_get_data($fb_app);
    $fb_infinite_data = $fb_app_data['fb_infinite'];
    if ($fb_infinite_data['fbu'] && $fb_infinite_data['key']) {

      // Return array with FB id and apikey.
      $return = array(
        $fb_infinite_data['fbu'],
        $fb_infinite_data['key'],
      );
    }
  }
}