Skip to content
Snippets Groups Projects
Commit d6ae65fe authored by Alex ORLUC's avatar Alex ORLUC
Browse files

Merge branch 'develop' of labs.maarch.org:maarch/MaarchCourrier into develop

parents d5d12b74 59338764
No related branches found
No related tags found
No related merge requests found
......@@ -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']
]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment