]> source.dussan.org Git - nextcloud-server.git/commitdiff
fixes #4574
authorStephane Martin <stephane.martin@vesperal.eu>
Mon, 26 Aug 2013 13:16:41 +0000 (15:16 +0200)
committerStephane Martin <stephane.martin@vesperal.eu>
Mon, 26 Aug 2013 13:16:41 +0000 (15:16 +0200)
lib/base.php

index 2613e88d0537ae66a5f80c719d9fd35457088fd6..c73eb9413d6951311346fdaf080bbe796add5932 100644 (file)
@@ -795,11 +795,16 @@ class OC {
                ) {
                        return false;
                }
-               OC_App::loadApps(array('authentication'));
-               if (OC_User::login($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"])) {
-                       //OC_Log::write('core',"Logged in with HTTP Authentication", OC_Log::DEBUG);
-                       OC_User::unsetMagicInCookie();
-                       $_SERVER['HTTP_REQUESTTOKEN'] = OC_Util::callRegister();
+               // don't redo authentication if user is already logged in
+               // otherwise session would be invalidated in OC_User::login with 
+               // session_regenerate_id at every page load
+               if (!OC_User::isLoggedIn()) {
+                       OC_App::loadApps(array('authentication'));
+                       if (OC_User::login($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"])) {
+                               //OC_Log::write('core',"Logged in with HTTP Authentication", OC_Log::DEBUG);
+                               OC_User::unsetMagicInCookie();
+                               $_SERVER['HTTP_REQUESTTOKEN'] = OC_Util::callRegister();
+                       }
                }
                return true;
        }