Use IRequest

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

View File

@ -45,7 +45,7 @@ OC_User::useBackend($userBackend);
OC_User::handleApacheAuth();
// Redirect all requests to the login page to the SAML login
$currentUrl = substr(explode('?', $_SERVER['REQUEST_URI'], 2)[0], strlen(\OC::$WEBROOT));
$currentUrl = substr(explode('?', \OC::$server->getRequest()->getRequestUri(), 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()));