diff options
author | root <root@localhost.localdomain> | 2016-07-22 16:46:29 +0800 |
---|---|---|
committer | root <root@localhost.localdomain> | 2016-07-22 16:46:29 +0800 |
commit | 02ec8b1726eb867e88dd2c31a74a080e451a31d1 (patch) | |
tree | 2ca1a1c490003ed8524cd71363b5e2f9c38a70f7 /lib/private/Server.php | |
parent | 4b4990c48fd4c6841bde260b2b2e1bc665b46e1c (diff) | |
download | nextcloud-server-02ec8b1726eb867e88dd2c31a74a080e451a31d1.tar.gz nextcloud-server-02ec8b1726eb867e88dd2c31a74a080e451a31d1.zip |
New LDAPProvider for user_ldap
Diffstat (limited to 'lib/private/Server.php')
-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 de2970d9bfa..d7352613f27 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 * @@ -583,6 +584,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(); @@ -1398,4 +1409,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'); + } } |