From c3e5e4c697ccc688e3a435ce50ed13b78b3afc81 Mon Sep 17 00:00:00 2001 From: Olimpia Magliulo <olimpiam@intern-ikts-MacBook-Air.local> Date: Tue, 7 Nov 2017 14:02:50 +0100 Subject: [PATCH] Use queryparams to change language after a login error Query parameters are passed to the template in order to change language also after an error is shown. --- modules/core/www/loginuserpass.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/core/www/loginuserpass.php b/modules/core/www/loginuserpass.php index 78ba32a0a..38cdcc9b4 100644 --- a/modules/core/www/loginuserpass.php +++ b/modules/core/www/loginuserpass.php @@ -40,6 +40,13 @@ if (array_key_exists('password', $_REQUEST)) { $errorCode = NULL; $errorParams = NULL; +$queryParams = array(); + +if (isset($state['error'])) { + $errorCode = $state['error']['code']; + $errorParams = $state['error']['params']; + $queryParams = array('AuthState' => $authStateId); +} if (!empty($_REQUEST['username']) || !empty($password)) { // Either username or password set - attempt to log in @@ -95,6 +102,9 @@ $t->data['links'] = $source->getLoginLinks(); $t->data['errorcode'] = $errorCode; $t->data['errorcodes'] = SimpleSAML\Error\ErrorCodes::getAllErrorCodeMessages(); $t->data['errorparams'] = $errorParams; +if (!empty($queryParams)) { + $t->data['queryParams'] = $queryParams; +} if (isset($state['SPMetadata'])) { $t->data['SPMetadata'] = $state['SPMetadata']; -- GitLab