diff --git a/contrib/fb_user_app.module b/contrib/fb_user_app.module index ac1fce3..1f72c68 100644 --- a/contrib/fb_user_app.module +++ b/contrib/fb_user_app.module @@ -141,8 +141,8 @@ function fb_user_app_track($fb, $fb_app) { // test if we are tracking only those apps that have been granted offline - // access. - $fb_session = $fb->getSession(); + // access. Not sure what to do here yet ?? - NB + $fb_session = $fb->getAccessToken(); // when 'expires' == 0 app has been granted offline access if ($fb_user_type == 'user' && diff --git a/fb.module b/fb.module index b437bbf..4e1d3a8 100644 --- a/fb.module +++ b/fb.module @@ -190,18 +190,18 @@ function fb_init() { if ($_fb) { // Look for session info from several sources. - if ($session = $_fb->getSession()) { + if ($session = $_fb->getUser()) { // Learned session from cookie or signed request. // Below, we store in our $_SESSION, just in case third-party cookies are not enabled. } elseif (isset($_REQUEST['fb_js_session'])) { // Ajax callback via fb.js. - $_fb->setSession(json_decode($_REQUEST['fb_js_session'], TRUE)); - $session = $_fb->getSession(); + $session = json_decode($_REQUEST['fb_js_session'], TRUE); + $_fb->setAccessToken($session['access_token']); } elseif (isset($_SESSION['fb'][$_fb_app->apikey]['session']) && arg(0) != 'logout') { // Use the session previously stored. - $_fb->setSession($_SESSION['fb'][$_fb_app->apikey]['session']); + $session = $_SESSION['fb'][$_fb_app->apikey]['session']; } // Store session for future use. We'll need it if third-party cookies @@ -211,7 +211,7 @@ function fb_init() { } // Make javascript work even when third-party cookies disabled. - $fb_init_settings['session'] = $_fb->getSession(); + $fb_init_settings['session'] = $session; // Sometimes when canvas page is open in one tab, and user logs out of // facebook in another, the canvas page has bogus session info when @@ -234,7 +234,7 @@ function fb_init() { )); // See if the facebook user id is known - if ($fbs = $_fb->getSession()) { + if ($fbs = $session) { fb_invoke(FB_OP_APP_IS_AUTHORIZED, array( 'fb_app' => $_fb_app, 'fb' => $_fb, @@ -501,8 +501,7 @@ function fb_get_token($fb = NULL, $fbu = NULL) { $cache_key .= '_' . $fbu; // Get the user access token. if ($fbu == 'me' || $fbu == fb_facebook_user($fb)) { - $session = $fb->getSession(); - $cache[$cache_key] = $session['access_token']; + $cache[$cache_key] = $fb->getAccessToken(); } else { $session_data = fb_invoke(FB_OP_GET_USER_SESSION, array( diff --git a/fb_connect.module b/fb_connect.module index 27dbabb..48c56b3 100644 --- a/fb_connect.module +++ b/fb_connect.module @@ -144,7 +144,7 @@ function _fb_connect_add_js($fb_app, $fb) { // @TODO fb.module should have a helper to make this cleaner. $settings['fb_init_settings']['apiKey'] = $fb_app->apikey; - $settings['fb_init_settings']['session'] = $fb->getSession(); + $settings['fb_init_settings']['access_token'] = $fb->getAccessToken(); fb_js_settings('apikey', $fb_app->apikey); fb_js_settings('fbu', fb_facebook_user($fb)); fb_js_settings('fb_init_settings', $settings['fb_init_settings']); diff --git a/fb_devel.module b/fb_devel.module index e1a536e..1653c66 100644 --- a/fb_devel.module +++ b/fb_devel.module @@ -75,7 +75,7 @@ function fb_devel_init() { // fb_settings.inc sanity check. if (isset($GLOBALS['fb_init_no_settings'])) { - if (user_access('access administration pages') && (module_exists('fb_canvas') || modules_exists('fb_tab'))) { + if (user_access('access administration pages') && (module_exists('fb_canvas') || module_exists('fb_tab'))) { // fb_settings.php must be included for canvas or tab support. drupal_set_message(t('!drupal_for_facebook (fb_canvas.module) has been enabled, but fb_settings.inc is not included in settings.php. Please read the !readme.', array('!drupal_for_facebook' => l(t('Drupal for Facebook'), 'http://drupal.org/project/fb'), @@ -641,12 +641,11 @@ function fb_devel_info() { catch (FacebookApiException $e) { fb_log_exception($e, "failed to get app properties"); } - $info["fb->getSession()"] = $_fb->getSession(); $info["fb->getSignedRequest()"] = $_fb->getSignedRequest(); if ($fbu) { try { $info["fb->api($fbu)"] = $_fb->api($fbu, array( - 'access_token' => fb_get_token($_fb), + 'access_token' => $_fb->getAccessToken(), )); } catch (FacebookApiException $e) {