|
104 | 104 | use OC\IntegrityCheck\Helpers\AppLocator; |
105 | 105 | use OC\IntegrityCheck\Helpers\EnvironmentHelper; |
106 | 106 | use OC\IntegrityCheck\Helpers\FileAccessHelper; |
| 107 | +use OC\LDAP\NullLDAPProviderFactory; |
107 | 108 | use OC\KnownUser\KnownUserService; |
108 | 109 | use OC\Lock\DBLockingProvider; |
109 | 110 | use OC\Lock\MemcacheLockingProvider; |
|
206 | 207 | use OCP\IUserManager; |
207 | 208 | use OCP\IUserSession; |
208 | 209 | use OCP\L10N\IFactory; |
| 210 | +use OCP\LDAP\ILDAPProvider; |
| 211 | +use OCP\LDAP\ILDAPProviderFactory; |
209 | 212 | use OCP\Lock\ILockingProvider; |
210 | 213 | use OCP\Log\ILogFactory; |
211 | 214 | use OCP\Mail\IMailer; |
@@ -1003,14 +1006,20 @@ public function __construct($webRoot, \OC\Config $config) { |
1003 | 1006 | /** @deprecated 19.0.0 */ |
1004 | 1007 | $this->registerDeprecatedAlias('Mailer', IMailer::class); |
1005 | 1008 |
|
1006 | | - $this->registerService('LDAPProvider', function (ContainerInterface $c) { |
| 1009 | + /** @deprecated 21.0.0 */ |
| 1010 | + $this->registerDeprecatedAlias('LDAPProvider', ILDAPProvider::class); |
| 1011 | + |
| 1012 | + $this->registerService(ILDAPProviderFactory::class, function (ContainerInterface $c) { |
1007 | 1013 | $config = $c->get(\OCP\IConfig::class); |
1008 | 1014 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
1009 | 1015 | if (is_null($factoryClass)) { |
1010 | | - throw new \Exception('ldapProviderFactory not set'); |
| 1016 | + return new NullLDAPProviderFactory($this); |
1011 | 1017 | } |
1012 | 1018 | /** @var \OCP\LDAP\ILDAPProviderFactory $factory */ |
1013 | | - $factory = new $factoryClass($this); |
| 1019 | + return new $factoryClass($this); |
| 1020 | + }); |
| 1021 | + $this->registerService(ILDAPProvider::class, function (ContainerInterface $c) { |
| 1022 | + $factory = $c->get(ILDAPProviderFactory::class); |
1014 | 1023 | return $factory->getLDAPProvider(); |
1015 | 1024 | }); |
1016 | 1025 | $this->registerService(ILockingProvider::class, function (ContainerInterface $c) { |
|
0 commit comments