Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/user_saml.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-06-29 21:01:15 +0300
committerLukas Reschke <lukas@owncloud.com>2016-06-29 21:01:15 +0300
commit487bf7616575aafc5057af1acf14a39da2545f26 (patch)
tree5b1b531d0923a339a1a6a2e36dc76ef7f249121e
parent107be703bf915b71aff24dd7428e97a52c21200e (diff)
Heuristic for stable9
Nextcloud 10 will have a way better logic...
-rw-r--r--appinfo/app.php4
1 files changed, 3 insertions, 1 deletions
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();