Use login name to fix password confirm with ldap users

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2016-12-21 09:51:21 +01:00
parent 2c2c4cc6c7
commit 15d6a13cfb
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
1 changed files with 3 additions and 7 deletions

View File

@ -298,14 +298,10 @@ class LoginController extends Controller {
$currentDelay = $this->throttler->getDelay($this->request->getRemoteAddress()); $currentDelay = $this->throttler->getDelay($this->request->getRemoteAddress());
$this->throttler->sleepDelay($this->request->getRemoteAddress()); $this->throttler->sleepDelay($this->request->getRemoteAddress());
$user = $this->userSession->getUser(); $loginName = $this->userSession->getLoginName();
if (!$user instanceof IUser) { $loginResult = $this->userManager->checkPassword($loginName, $password);
return new DataResponse([], Http::STATUS_UNAUTHORIZED);
}
$loginResult = $this->userManager->checkPassword($user->getUID(), $password);
if ($loginResult === false) { if ($loginResult === false) {
$this->throttler->registerAttempt('sudo', $this->request->getRemoteAddress(), ['user' => $user->getUID()]); $this->throttler->registerAttempt('sudo', $this->request->getRemoteAddress(), ['user' => $loginName]);
if ($currentDelay === 0) { if ($currentDelay === 0) {
$this->throttler->sleepDelay($this->request->getRemoteAddress()); $this->throttler->sleepDelay($this->request->getRemoteAddress());
} }