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
This commit is contained in:
Lukas Reschke 2014-05-11 13:09:46 +02:00
parent 73b914ddbc
commit e1e1009ccc
1 changed files with 8 additions and 0 deletions

View File

@ -768,6 +768,14 @@ class OC {
return; 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 : // Someone is logged in :
if (OC_User::isLoggedIn()) { if (OC_User::isLoggedIn()) {
OC_App::loadApps(); OC_App::loadApps();