diff options
author | Joas Schilling <coding@schilljs.com> | 2023-08-17 08:45:46 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-08-21 16:40:24 +0200 |
commit | bed3ffb3124ac9d4ab83ce21460356b00eeca82e (patch) | |
tree | 6f27f4f533e63892575f7297588b35196b306e17 /apps/settings/lib/Controller/CheckSetupController.php | |
parent | 124588d4a64f518aef9270002e72c3604ddb3077 (diff) | |
download | nextcloud-server-bed3ffb3124ac9d4ab83ce21460356b00eeca82e.tar.gz nextcloud-server-bed3ffb3124ac9d4ab83ce21460356b00eeca82e.zip |
feat(admin): Show an error when the admin is throttled
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/settings/lib/Controller/CheckSetupController.php')
-rw-r--r-- | apps/settings/lib/Controller/CheckSetupController.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php index 0353862bab0..80be57268b0 100644 --- a/apps/settings/lib/Controller/CheckSetupController.php +++ b/apps/settings/lib/Controller/CheckSetupController.php @@ -90,6 +90,7 @@ use OCP\ITempManager; use OCP\IURLGenerator; use OCP\Lock\ILockingProvider; use OCP\Notification\IManager; +use OCP\Security\Bruteforce\IThrottler; use OCP\Security\ISecureRandom; use Psr\Log\LoggerInterface; @@ -123,6 +124,8 @@ class CheckSetupController extends Controller { private $iniGetWrapper; /** @var IDBConnection */ private $connection; + /** @var IThrottler */ + private $throttler; /** @var ITempManager */ private $tempManager; /** @var IManager */ @@ -148,6 +151,7 @@ class CheckSetupController extends Controller { ISecureRandom $secureRandom, IniGetWrapper $iniGetWrapper, IDBConnection $connection, + IThrottler $throttler, ITempManager $tempManager, IManager $manager, IAppManager $appManager, @@ -162,6 +166,7 @@ class CheckSetupController extends Controller { $this->logger = $logger; $this->dispatcher = $dispatcher; $this->db = $db; + $this->throttler = $throttler; $this->lockingProvider = $lockingProvider; $this->dateTimeFormatter = $dateTimeFormatter; $this->memoryInfo = $memoryInfo; @@ -920,6 +925,8 @@ Raw output 'cronInfo' => $this->getLastCronInfo(), 'cronErrors' => $this->getCronErrors(), 'isFairUseOfFreePushService' => $this->isFairUseOfFreePushService(), + 'isBruteforceThrottled' => $this->throttler->getAttempts($this->request->getRemoteAddress()) !== 0, + 'bruteforceRemoteAddress' => $this->request->getRemoteAddress(), 'serverHasInternetConnectionProblems' => $this->hasInternetConnectivityProblems(), 'isMemcacheConfigured' => $this->isMemcacheConfigured(), 'memcacheDocs' => $this->urlGenerator->linkToDocs('admin-performance'), |