LSsession / logout : fixed bug
authorBenjamin Renard <brenard@easter-eggs.com>
Wed, 10 Mar 2010 18:36:23 +0000 (19:36 +0100)
committerBenjamin Renard <brenard@easter-eggs.com>
Wed, 10 Mar 2010 18:36:23 +0000 (19:36 +0100)
public_html/includes/class/class.LSsession.php

index 3a64b4b..ab09efa 100644 (file)
@@ -499,23 +499,6 @@ class LSsession {
       self :: $tmp_file     = $_SESSION['LSsession']['tmp_file'];
       self :: $authParams   = $_SESSION['LSsession']['authParams'];
       
-      if (isset($_GET['LSsession_logout'])) {
-        $authObj = self :: getLSauthObject();
-        if ($authObj) {
-          $authObj -> logout();
-        }
-        session_destroy();
-        
-        if (is_array($_SESSION['LSsession']['tmp_file'])) {
-          self :: $tmp_file = $_SESSION['LSsession']['tmp_file'];
-        }
-        self :: deleteTmpFile();
-        unset($_SESSION['LSsession']);
-        
-        self :: redirect('index.php');
-        return;
-      }
-      
       if ( self :: cacheLSprofiles() && !isset($_REQUEST['LSsession_refresh']) ) {
         self :: setLdapServer(self :: $ldapServerId);
         self :: $LSprofiles   = $_SESSION['LSsession']['LSprofiles'];
@@ -538,6 +521,23 @@ class LSsession {
         return;
       }
       
+      if (isset($_GET['LSsession_logout'])) {
+        $authObj = self :: getLSauthObject();
+        if ($authObj) {
+          $authObj -> logout();
+        }
+        session_destroy();
+        
+        if (is_array($_SESSION['LSsession']['tmp_file'])) {
+          self :: $tmp_file = $_SESSION['LSsession']['tmp_file'];
+        }
+        self :: deleteTmpFile();
+        unset($_SESSION['LSsession']);
+        
+        self :: redirect('index.php');
+        return;
+      }
+      
       self :: getLSuserObject();
       
       if ( !self :: cacheLSprofiles() || isset($_REQUEST['LSsession_refresh']) ) {