aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Server.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Server.php')
-rw-r--r--lib/private/Server.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php
index e1de1b84e29..7a2987759a4 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -950,6 +950,18 @@ class Server extends ServerContainer implements IServerContainer {
/** @deprecated 19.0.0 */
$this->registerDeprecatedAlias('Throttler', Throttler::class);
$this->registerAlias(IThrottler::class, Throttler::class);
+
+ $this->registerService(\OC\Security\Bruteforce\Backend\IBackend::class, function ($c) {
+ $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);
+ }
+
+ return $backend;
+ });
+
$this->registerService('IntegrityCodeChecker', function (ContainerInterface $c) {
// IConfig and IAppManager requires a working database. This code
// might however be called when ownCloud is not yet setup.