From 487bf7616575aafc5057af1acf14a39da2545f26 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Wed, 29 Jun 2016 20:01:15 +0200 Subject: Heuristic for stable9 Nextcloud 10 will have a way better logic... --- appinfo/app.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/appinfo/app.php b/appinfo/app.php index a940ca0f..05ba9f80 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -50,8 +50,10 @@ try { } // Redirect all requests to the login page to the SAML login +// Since with Nextcloud 9 we don't have an unique entry point this is a little +// bit hacky and won't necessarily detect all situations. $currentUrl = substr(explode('?',$request->getRequestUri(), 2)[0], strlen(\OC::$WEBROOT)); -if($currentUrl === '/index.php/login' && !OC_User::isLoggedIn()) { +if(($currentUrl === '/' || $currentUrl === '/index.php/' || $currentUrl === '/index.php') && !OC_User::isLoggedIn()) { $csrfToken = \OC::$server->getCsrfTokenManager()->getToken(); header('Location: '.$urlGenerator->linkToRouteAbsolute('user_saml.SAML.login') .'?requesttoken='. urlencode($csrfToken->getEncryptedValue())); exit(); -- cgit v1.2.3