]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Only use FB's Javascript logout, not its PHP method too
authorZach Copley <zach@controlyourself.ca>
Tue, 30 Jun 2009 01:54:08 +0000 (01:54 +0000)
committerZach Copley <zach@controlyourself.ca>
Tue, 30 Jun 2009 01:54:08 +0000 (01:54 +0000)
plugins/FBConnect/FBConnectPlugin.php

index 3a4f0dbe3a5be715cb9964af098b57f3320b6cb0..459a802828a117173493b5c1cbe2f5a96a17fda9 100644 (file)
@@ -287,23 +287,13 @@ class FBConnectPlugin extends Plugin
 
     function onStartLogout($action)
     {
-        $user = common_current_user();
-
-        $flink = Foreign_link::getByUserId($user->id, FACEBOOK_CONNECT_SERVICE);
-
         $action->logout();
+        $fbuid = $this->loggedIn();
 
-        if ($flink) {
-
-            $facebook = getFacebook();
-
+        if (!empty($fbuid)) {
             try {
-                $fbuid = $facebook->get_loggedin_user();
-
-                if ($fbuid > 0) {
-                    $facebook->logout(common_local_url('public'));
-                }
-
+                $facebook = getFacebook();
+                $facebook->expire_session();
             } catch (Exception $e) {
                 common_log(LOG_WARNING, 'Could\'t logout of Facebook: ' .
                     $e->getMessage());