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@statuscode.ch>2017-08-18 14:58:03 +0300
committerLukas Reschke <lukas@statuscode.ch>2017-08-18 14:58:03 +0300
commit940bcd30a31771461e6fd14318f3cbb8f79ff362 (patch)
treec093a008a8497b5babf7ab4bafce6ff9787dbe63 /appinfo/app.php
parent6466e71c637fa3093325a1320e81750109e08207 (diff)
Redirect users to previous page
This change ensures that users will be sent to the previous page. Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'appinfo/app.php')
-rw-r--r--appinfo/app.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/appinfo/app.php b/appinfo/app.php
index d0246488..23dbe6c0 100644
--- a/appinfo/app.php
+++ b/appinfo/app.php
@@ -28,7 +28,6 @@ if(OC::$CLI) {
$cli = true;
}
-
$urlGenerator = \OC::$server->getURLGenerator();
$config = \OC::$server->getConfig();
$request = \OC::$server->getRequest();
@@ -99,7 +98,20 @@ if($useSamlForDesktopClients === '1') {
}
if($redirectSituation === true) {
+ $params = $request->getParams();
+ $originalUrl = '';
+ if(isset($params['redirect_url'])) {
+ $originalUrl = $urlGenerator->getAbsoluteURL($params['redirect_url']);
+ }
+
$csrfToken = \OC::$server->getCsrfTokenManager()->getToken();
- header('Location: '.$urlGenerator->linkToRouteAbsolute('user_saml.SAML.login') .'?requesttoken='. urlencode($csrfToken->getEncryptedValue()));
+ $targetUrl = $urlGenerator->linkToRouteAbsolute(
+ 'user_saml.SAML.login',
+ [
+ 'requesttoken' => $csrfToken->getEncryptedValue(),
+ 'originalUrl' => $originalUrl,
+ ]
+ );
+ header('Location: '.$targetUrl);
exit();
}