]> source.dussan.org Git - nextcloud-server.git/commitdiff
Redirect to index if the logout link is accessed without valid session
authorLukas Reschke <lukas@statuscode.ch>
Sun, 11 May 2014 11:09:46 +0000 (13:09 +0200)
committerLukas Reschke <lukas@statuscode.ch>
Sun, 11 May 2014 11:09:46 +0000 (13:09 +0200)
This is needed to prevent "Token expired" messages while login if a session is expired
@see https://github.com/owncloud/core/pull/8443#issuecomment-42425583

lib/base.php

index 3ef9ce4beb2875efe34660655124cb9387ae3c05..1e1e5f6b11331e8cca03acc76ae5a1dd27459a56 100644 (file)
@@ -768,6 +768,14 @@ class OC {
                        return;
                }
 
+               // Redirect to index if the logout link is accessed without valid session
+               // this is needed to prevent "Token expired" messages while login if a session is expired
+               // @see https://github.com/owncloud/core/pull/8443#issuecomment-42425583
+               if(isset($_GET['logout']) && !OC_User::isLoggedIn()) {
+                       header("Location: " . OC::$WEBROOT.(empty(OC::$WEBROOT) ? '/' : ''));
+                       return;
+               }
+
                // Someone is logged in :
                if (OC_User::isLoggedIn()) {
                        OC_App::loadApps();