diff options
author | Joas Schilling <coding@schilljs.com> | 2016-12-21 09:51:21 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-01-05 12:17:30 +0100 |
commit | 2f21eaaf47192fb6381eed183cbefb7e0d6ce01b (patch) | |
tree | 1127c3de68b10eb30c198ae5cb5cf4a4fbf3a887 | |
parent | 6a0f0403d01dc6a889157b446edef73f9af58540 (diff) | |
download | nextcloud-server-2f21eaaf47192fb6381eed183cbefb7e0d6ce01b.tar.gz nextcloud-server-2f21eaaf47192fb6381eed183cbefb7e0d6ce01b.zip |
Use login name to fix password confirm with ldap users
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | core/Controller/LoginController.php | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php index b6add48ef61..3c81ed5242a 100644 --- a/core/Controller/LoginController.php +++ b/core/Controller/LoginController.php @@ -298,14 +298,10 @@ class LoginController extends Controller { $currentDelay = $this->throttler->getDelay($this->request->getRemoteAddress()); $this->throttler->sleepDelay($this->request->getRemoteAddress()); - $user = $this->userSession->getUser(); - if (!$user instanceof IUser) { - return new DataResponse([], Http::STATUS_UNAUTHORIZED); - } - - $loginResult = $this->userManager->checkPassword($user->getUID(), $password); + $loginName = $this->userSession->getLoginName(); + $loginResult = $this->userManager->checkPassword($loginName, $password); 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) { $this->throttler->sleepDelay($this->request->getRemoteAddress()); } |