From e33b64775e83dc5fd0b08d407ce723665ef4cbd3 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 16 Aug 2023 15:59:57 +0200 Subject: [PATCH] fixup! feat(security): Add a bruteforce protection backend base on memcache --- lib/private/Server.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/Server.php b/lib/private/Server.php index 37a030e5cb150..49156fdaf6041 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -949,8 +949,8 @@ public function __construct($webRoot, \OC\Config $config) { $this->registerAlias(IThrottler::class, Throttler::class); $this->registerService(\OC\Security\Bruteforce\Backend\IBackend::class, function ($c) { - $cacheFactory = $c->get(ICacheFactory::class); - if ($cacheFactory->isAvailable()) { + $config = $c->get(\OCP\IConfig::class); + if (ltrim($config->getSystemValueString('memcache.distributed', ''), '\\') === \OC\Memcache\Redis::class) { $backend = $c->get(\OC\Security\Bruteforce\Backend\MemoryCacheBackend::class); } else { $backend = $c->get(\OC\Security\Bruteforce\Backend\DatabaseBackend::class);