Commit 59338764 authored by Vinciane Bizet's avatar Vinciane Bizet

FEAT #9422 Insensitive case login at connexion

parent 036a0b4b
......@@ -178,6 +178,7 @@ if (!empty($_SESSION['error'])) {
} catch (Exception $conFailure) {
if (!empty($standardConnect) && $standardConnect == 'true') {
$res = $sec->login($login, $password, 'ldap', $standardConnect);
$login = $res['user']['UserId'];
$_SESSION['user'] = $res['user'];
if (empty($res['error'])) {
\SrcCore\models\AuthenticationModel::setCookieAuth(['userId' => $login]);
......@@ -283,6 +284,7 @@ if (!empty($_SESSION['error'])) {
$_SESSION['error'] = '';
$res = $sec->login($login, $password);
$_SESSION['user'] = $res['user'];
$login = $res['user']['UserId'];
if (empty($res['error'])) {
\SrcCore\models\AuthenticationModel::setCookieAuth(['userId' => $login]);
\SrcCore\models\AuthenticationModel::resetFailedAuthentication(['userId' => $login]);
......
......@@ -29,7 +29,7 @@ class AuthenticationModel
$aReturn = DatabaseModel::select([
'select' => ['password'],
'table' => ['users'],
'where' => ['user_id = ?', 'status != ?', '(locked_until is null OR locked_until < CURRENT_TIMESTAMP)'],
'where' => ['lower(user_id) = lower(?)', 'status != ?', '(locked_until is null OR locked_until < CURRENT_TIMESTAMP)'],
'data' => [$args['userId'], 'DEL']
]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment