mirror of
https://github.com/netzbegruenung/user_saml.git
synced 2024-04-30 16:24:52 +02:00
Merge pull request #331 from nextcloud/bugfix/283
Catch exception during parameter fetching
This commit is contained in:
commit
ea7e93ec0f
|
@ -54,6 +54,8 @@ $userBackend = new \OCA\User_SAML\UserBackend(
|
||||||
$userBackend->registerBackends(\OC::$server->getUserManager()->getBackends());
|
$userBackend->registerBackends(\OC::$server->getUserManager()->getBackends());
|
||||||
OC_User::useBackend($userBackend);
|
OC_User::useBackend($userBackend);
|
||||||
|
|
||||||
|
$params = [];
|
||||||
|
|
||||||
// Setting up the one login config may fail, if so, do not catch the requests later.
|
// Setting up the one login config may fail, if so, do not catch the requests later.
|
||||||
$returnScript = false;
|
$returnScript = false;
|
||||||
$type = '';
|
$type = '';
|
||||||
|
@ -107,7 +109,11 @@ if(!$cli &&
|
||||||
!$userSession->isLoggedIn() &&
|
!$userSession->isLoggedIn() &&
|
||||||
\OC::$server->getRequest()->getPathInfo() === '/login' &&
|
\OC::$server->getRequest()->getPathInfo() === '/login' &&
|
||||||
$type !== '') {
|
$type !== '') {
|
||||||
$params = $request->getParams();
|
try {
|
||||||
|
$params = $request->getParams();
|
||||||
|
} catch (\LogicException $e) {
|
||||||
|
// ignore exception when PUT is called since getParams cannot parse parameters in that case
|
||||||
|
}
|
||||||
if (isset($params['direct'])) {
|
if (isset($params['direct'])) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -136,7 +142,11 @@ $configuredIdps = $samlSettings->getListOfIdps();
|
||||||
$showLoginOptions = $multipleUserBackEnds || count($configuredIdps) > 1;
|
$showLoginOptions = $multipleUserBackEnds || count($configuredIdps) > 1;
|
||||||
|
|
||||||
if ($redirectSituation === true && $showLoginOptions) {
|
if ($redirectSituation === true && $showLoginOptions) {
|
||||||
$params = $request->getParams();
|
try {
|
||||||
|
$params = $request->getParams();
|
||||||
|
} catch (\LogicException $e) {
|
||||||
|
// ignore exception when PUT is called since getParams cannot parse parameters in that case
|
||||||
|
}
|
||||||
$redirectUrl = '';
|
$redirectUrl = '';
|
||||||
if(isset($params['redirect_url'])) {
|
if(isset($params['redirect_url'])) {
|
||||||
$redirectUrl = $params['redirect_url'];
|
$redirectUrl = $params['redirect_url'];
|
||||||
|
@ -154,7 +164,11 @@ if ($redirectSituation === true && $showLoginOptions) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if($redirectSituation === true) {
|
if($redirectSituation === true) {
|
||||||
$params = $request->getParams();
|
try {
|
||||||
|
$params = $request->getParams();
|
||||||
|
} catch (\LogicException $e) {
|
||||||
|
// ignore exception when PUT is called since getParams cannot parse parameters in that case
|
||||||
|
}
|
||||||
$originalUrl = '';
|
$originalUrl = '';
|
||||||
if(isset($params['redirect_url'])) {
|
if(isset($params['redirect_url'])) {
|
||||||
$originalUrl = $urlGenerator->getAbsoluteURL($params['redirect_url']);
|
$originalUrl = $urlGenerator->getAbsoluteURL($params['redirect_url']);
|
||||||
|
|
Loading…
Reference in a new issue