summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2014-05-11 13:09:46 +0200
committerLukas Reschke <lukas@statuscode.ch>2014-05-11 13:09:46 +0200
commite1e1009ccc304f6e527c3cc392b510f6d8868533 (patch)
tree6e1d1b8174817505363ac8dece42717c517df74b /lib
parent73b914ddbc4389a25e45e28b5fe23592d0b09a94 (diff)
downloadnextcloud-server-e1e1009ccc304f6e527c3cc392b510f6d8868533.tar.gz
nextcloud-server-e1e1009ccc304f6e527c3cc392b510f6d8868533.zip
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
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/base.php b/lib/base.php
index 3ef9ce4beb2..1e1e5f6b113 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -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();