summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-01-05 15:15:04 +0100
committerGitHub <noreply@github.com>2017-01-05 15:15:04 +0100
commitba7f5105f014de8dfa80bdd178e325ffbfc7c0b5 (patch)
treea7ba4bcfe3e91d66b5459bea84a985236b2192aa /core
parentcb32d21682624f2752823bccb90247d46a9eecfb (diff)
parent7ba665b11d226482754d4414ec032f005136aa05 (diff)
downloadnextcloud-server-ba7f5105f014de8dfa80bdd178e325ffbfc7c0b5.tar.gz
nextcloud-server-ba7f5105f014de8dfa80bdd178e325ffbfc7c0b5.zip
Merge pull request #2797 from nextcloud/issue-2734-sudo-password-with-ldap
Use login name to fix password confirm with ldap users
Diffstat (limited to 'core')
-rw-r--r--core/Controller/LoginController.php10
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());
}