More generic matching

This commit is contained in:
Lukas Reschke 2016-06-29 11:36:47 +02:00
parent 77499230a2
commit 5f8183276d
No known key found for this signature in database
GPG Key ID: 9AB0ADB949B6898C
1 changed files with 2 additions and 2 deletions

View File

@ -45,8 +45,8 @@ OC_User::useBackend($userBackend);
OC_User::handleApacheAuth();
// Redirect all requests to the login page to the SAML login
$currentUrl = explode('?', $_SERVER['REQUEST_URI'], 2)[0];
if($currentUrl === '/server/index.php/login' && !OC_User::isLoggedIn()) {
$currentUrl = substr(explode('?', $_SERVER['REQUEST_URI'], 2)[0], strlen(\OC::$WEBROOT));
if($currentUrl === '/index.php/login' && !OC_User::isLoggedIn()) {
$csrfToken = \OC::$server->getCsrfTokenManager()->getToken();
header('Location: '.$urlGenerator->linkToRouteAbsolute('user_saml.SAML.login') .'?requesttoken='. urlencode($csrfToken->getEncryptedValue()));
exit();