diff options
Diffstat (limited to 'lib/private/Server.php')
-rw-r--r-- | lib/private/Server.php | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php index c0d6afbaaf6..6a1550f83e0 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -104,6 +104,8 @@ use OC\IntegrityCheck\Checker; use OC\IntegrityCheck\Helpers\AppLocator; use OC\IntegrityCheck\Helpers\EnvironmentHelper; use OC\IntegrityCheck\Helpers\FileAccessHelper; +use OC\LDAP\NullLDAPProviderFactory; +use OC\KnownUser\KnownUserService; use OC\Lock\DBLockingProvider; use OC\Lock\MemcacheLockingProvider; use OC\Lock\NoopLockingProvider; @@ -205,6 +207,8 @@ use OCP\IUser; use OCP\IUserManager; use OCP\IUserSession; use OCP\L10N\IFactory; +use OCP\LDAP\ILDAPProvider; +use OCP\LDAP\ILDAPProviderFactory; use OCP\Lock\ILockingProvider; use OCP\Log\ILogFactory; use OCP\Mail\IMailer; @@ -720,11 +724,14 @@ class Server extends ServerContainer implements IServerContainer { $this->registerService(AvatarManager::class, function (Server $c) { return new AvatarManager( + $c->get(IUserSession::class), $c->get(\OC\User\Manager::class), $c->getAppDataDir('avatar'), $c->getL10N('lib'), $c->get(ILogger::class), - $c->get(\OCP\IConfig::class) + $c->get(\OCP\IConfig::class), + $c->get(IAccountManager::class), + $c->get(KnownUserService::class) ); }); $this->registerAlias(IAvatarManager::class, AvatarManager::class); @@ -999,14 +1006,20 @@ class Server extends ServerContainer implements IServerContainer { /** @deprecated 19.0.0 */ $this->registerDeprecatedAlias('Mailer', IMailer::class); - $this->registerService('LDAPProvider', function (ContainerInterface $c) { + /** @deprecated 21.0.0 */ + $this->registerDeprecatedAlias('LDAPProvider', ILDAPProvider::class); + + $this->registerService(ILDAPProviderFactory::class, function (ContainerInterface $c) { $config = $c->get(\OCP\IConfig::class); $factoryClass = $config->getSystemValue('ldapProviderFactory', null); if (is_null($factoryClass)) { - throw new \Exception('ldapProviderFactory not set'); + return new NullLDAPProviderFactory($this); } /** @var \OCP\LDAP\ILDAPProviderFactory $factory */ - $factory = new $factoryClass($this); + return new $factoryClass($this); + }); + $this->registerService(ILDAPProvider::class, function (ContainerInterface $c) { + $factory = $c->get(ILDAPProviderFactory::class); return $factory->getLDAPProvider(); }); $this->registerService(ILockingProvider::class, function (ContainerInterface $c) { |