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:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2018-03-19 16:01:07 +0300
committerGitHub <noreply@github.com>2018-03-19 16:01:07 +0300
commit82102c6f18d003fc2752014152b79f78d77869c3 (patch)
treeda8101a74623e22918b2d3075fd63e4d42b2eb4a /appinfo
parent1df4ef8f2beac00e75e76bce495efc8f409c312c (diff)
parent02cde8030b9381c586fd42613fd170eab2b0ab37 (diff)
Merge pull request #196 from nextcloud/multiple-user-back-ends
Multiple user back ends
Diffstat (limited to 'appinfo')
-rw-r--r--appinfo/app.php24
-rw-r--r--appinfo/routes.php5
2 files changed, 29 insertions, 0 deletions
diff --git a/appinfo/app.php b/appinfo/app.php
index a55c333a..841bb548 100644
--- a/appinfo/app.php
+++ b/appinfo/app.php
@@ -94,6 +94,10 @@ if(!$cli &&
!$userSession->isLoggedIn() &&
\OC::$server->getRequest()->getPathInfo() === '/login' &&
$type !== '') {
+ $params = $request->getParams();
+ if (isset($params['direct'])) {
+ return;
+ }
$redirectSituation = true;
}
@@ -114,6 +118,26 @@ if($useSamlForDesktopClients === '1') {
}
}
+$multipleUserBackEnds = $config->getAppValue('user_saml', 'general-allow_multiple_user_back_ends', '0');
+
+if ($redirectSituation === true && $multipleUserBackEnds === '1') {
+ $params = $request->getParams();
+ $redirectUrl = '';
+ if(isset($params['redirect_url'])) {
+ $redirectUrl = $params['redirect_url'];
+ }
+
+ $targetUrl = $urlGenerator->linkToRouteAbsolute(
+ 'user_saml.SAML.selectUserBackEnd',
+ [
+ 'redirectUrl' => $redirectUrl
+ ]
+ );
+ header('Location: '.$targetUrl);
+ exit();
+
+}
+
if($redirectSituation === true) {
$params = $request->getParams();
$originalUrl = '';
diff --git a/appinfo/routes.php b/appinfo/routes.php
index 5701783e..f1d3bfca 100644
--- a/appinfo/routes.php
+++ b/appinfo/routes.php
@@ -53,5 +53,10 @@ return [
'url' => '/saml/error',
'verb' => 'GET',
],
+ [
+ 'name' => 'SAML#selectUserBackEnd',
+ 'url' => '/saml/selectUserBackEnd',
+ 'verb' => 'GET',
+ ],
],
];