diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-11-14 15:26:23 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2016-11-14 15:26:23 +0100 |
commit | 0d89c1491164a3ee33bd85839eae963d51b45a36 (patch) | |
tree | 824899d8bff49b63bdabbdb2b61646dfb0543181 /lib/private/OCS | |
parent | ff96fffe39c09efa60233988637d2fd68828a2ea (diff) | |
download | nextcloud-server-0d89c1491164a3ee33bd85839eae963d51b45a36.tar.gz nextcloud-server-0d89c1491164a3ee33bd85839eae963d51b45a36.zip |
Add bruteforce checker to Person.php
Also check for attempts on this endpoint
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'lib/private/OCS')
-rw-r--r-- | lib/private/OCS/Person.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/OCS/Person.php b/lib/private/OCS/Person.php index bbb4a39e1e8..d14465c5ce9 100644 --- a/lib/private/OCS/Person.php +++ b/lib/private/OCS/Person.php @@ -31,10 +31,13 @@ class Person { $login = isset($_POST['login']) ? $_POST['login'] : false; $password = isset($_POST['password']) ? $_POST['password'] : false; if($login && $password) { + $remoteIp = \OC::$server->getRequest()->getRemoteAddress(); + \OC::$server->getBruteForceThrottler()->sleepDelay($remoteIp); if(\OC_User::checkPassword($login, $password)) { $xml['person']['personid'] = $login; return new Result($xml); } else { + \OC::$server->getBruteForceThrottler()->registerAttempt('login', $remoteIp); return new Result(null, 102); } } else { |