fixes previous session id handling for activesync and webdav
authorPhilipp Schüle <p.schuele@metaways.de>
Thu, 7 Jan 2016 11:36:32 +0000 (12:36 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 7 Jan 2016 13:06:30 +0000 (14:06 +0100)
see https://forge.tine20.org/view.php?id=11468

Change-Id: I5846060a7118ba834274e0ea4c40f4765c4e8e8f
Reviewed-on: http://gerrit.tine20.com/customers/2559
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/AccessLog.php

index bc5a733..2e939a4 100644 (file)
@@ -264,7 +264,7 @@ class Tinebase_AccessLog extends Tinebase_Controller_Record_Abstract
     }
 
     /**
-     * set session for current request
+     * set session id for current request in accesslog
      *
      * @param Tinebase_Model_AccessLog $accessLog
      */
@@ -272,8 +272,8 @@ class Tinebase_AccessLog extends Tinebase_Controller_Record_Abstract
     {
         if (in_array($accessLog->clienttype, array(Tinebase_Server_WebDAV::REQUEST_TYPE, ActiveSync_Server_Http::REQUEST_TYPE))) {
             try {
-                $accessLog = Tinebase_AccessLog::getInstance()->getPreviousAccessLog($accessLog);
-                // $accessLog->sessionid is set now
+                $previousAccessLog = Tinebase_AccessLog::getInstance()->getPreviousAccessLog($accessLog);
+                $accessLog->sessionid = $previousAccessLog->sessionid;
             } catch (Tinebase_Exception_NotFound $tenf) {
                 // ignore
             }
@@ -281,8 +281,8 @@ class Tinebase_AccessLog extends Tinebase_Controller_Record_Abstract
 
         if (empty($accessLog->sessionid)) {
             $accessLog->sessionid = Tinebase_Core::getSessionId();
+        } else {
+            Tinebase_Core::set(Tinebase_Core::SESSIONID, $accessLog->sessionid);
         }
-
-        Tinebase_Core::set(Tinebase_Core::SESSIONID, $accessLog->sessionid);
     }
 }