diff options
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Server.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php index 41092ceae6e..fd6ecdc297e 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -21,6 +21,7 @@ * @author Thomas Müller <thomas.mueller@tmit.eu> * @author Thomas Tanghus <thomas@tanghus.net> * @author Vincent Petry <pvince81@owncloud.com> + * @author Roger Szabo <roger.szabo@web.de> * * @license AGPL-3.0 * @@ -584,6 +585,16 @@ class Server extends ServerContainer implements IServerContainer { $this->getLogger() ); }); + $this->registerService('LDAPProvider', function(Server $c) { + $config = $c->getConfig(); + $factoryClass = $config->getSystemValue('ldapProviderFactory', null); + if(is_null($factoryClass)) { + throw new \Exception('ldapProviderFactory not set'); + } + /** @var \OCP\LDAP\ILDAPProviderFactory $factory */ + $factory = new $factoryClass($this); + return $factory->getLDAPProvider(); + }); $this->registerService('LockingProvider', function (Server $c) { $ini = $c->getIniWrapper(); $config = $c->getConfig(); @@ -1406,4 +1417,12 @@ class Server extends ServerContainer implements IServerContainer { return $this->query('ShareManager'); } + /** + * Returns the LDAP Provider + * + * @return \OCP\LDAP\ILDAPProvider + */ + public function getLDAPProvider() { + return $this->query('LDAPProvider'); + } } |