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

FIX #8337 fix auth failed attempt with offline ldap mode on

parent 95e0914b
No related branches found
No related tags found
No related merge requests found
...@@ -228,6 +228,10 @@ if (!empty($_SESSION['error'])) { ...@@ -228,6 +228,10 @@ if (!empty($_SESSION['error'])) {
$res = $sec->login($login, $password, 'ldap'); $res = $sec->login($login, $password, 'ldap');
$_SESSION['user'] = $res['user']; $_SESSION['user'] = $res['user'];
if ($res['error'] == '') { if ($res['error'] == '') {
if (!empty($standardConnect) && $standardConnect == 'true') {
\User\models\UserModel::updatePassword(['id' => $result['id'], 'password' => $password]);
\SrcCore\models\AuthenticationModel::resetFailedAuthentication(['userId' => $login]);
}
\SrcCore\models\AuthenticationModel::setCookieAuth(['userId' => $login]); \SrcCore\models\AuthenticationModel::setCookieAuth(['userId' => $login]);
} else { } else {
$_SESSION['error'] = $res['error']; $_SESSION['error'] = $res['error'];
...@@ -247,7 +251,8 @@ if (!empty($_SESSION['error'])) { ...@@ -247,7 +251,8 @@ if (!empty($_SESSION['error'])) {
continue; continue;
} }
} else { } else {
$_SESSION['error'] = _BAD_LOGIN_OR_PSW; $error = \SrcCore\controllers\AuthenticationController::handleFailedAuthentication(['userId' => $login]);
$_SESSION['error'] = $error;
header( header(
'location: ' . $_SESSION['config']['businessappurl'] 'location: ' . $_SESSION['config']['businessappurl']
. 'index.php?display=true&page=login' . 'index.php?display=true&page=login'
......
...@@ -125,7 +125,7 @@ class security extends Database ...@@ -125,7 +125,7 @@ class security extends Database
} }
$check = \SrcCore\models\AuthenticationModel::authentication(['userId' => $s_login, 'password' => $pass]); $check = \SrcCore\models\AuthenticationModel::authentication(['userId' => $s_login, 'password' => $pass]);
if ($check || $method == 'ldap') { if ($check) {
$user = $uc->getWithComp($s_login, $comp, $params); $user = $uc->getWithComp($s_login, $comp, $params);
} }
......
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