diff options
author | Vinicius Cubas Brand <viniciuscb@gmail.com> | 2017-11-02 10:40:38 -0200 |
---|---|---|
committer | Vinicius Cubas Brand <viniciuscb@gmail.com> | 2017-11-03 11:41:40 -0200 |
commit | 10ca793452e75ecd276589f8ad916f3090ecb441 (patch) | |
tree | 2d902024afb03a4f88356b68b97369f86cec8372 /apps/user_ldap/appinfo/app.php | |
parent | 576d31d48d1e368c0ca54a95f28dc3bc0e553d83 (diff) | |
download | nextcloud-server-10ca793452e75ecd276589f8ad916f3090ecb441.tar.gz nextcloud-server-10ca793452e75ecd276589f8ad916f3090ecb441.zip |
Plugins infrastructure in User_LDAP
Signed-off-by: Vinicius Cubas Brand <viniciuscb@gmail.com>
Diffstat (limited to 'apps/user_ldap/appinfo/app.php')
-rw-r--r-- | apps/user_ldap/appinfo/app.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/apps/user_ldap/appinfo/app.php b/apps/user_ldap/appinfo/app.php index 5239e52234a..7ea578ab9ca 100644 --- a/apps/user_ldap/appinfo/app.php +++ b/apps/user_ldap/appinfo/app.php @@ -10,6 +10,8 @@ * @author Morris Jobke <hey@morrisjobke.de> * @author Robin Appelman <robin@icewind.nl> * @author Thomas Müller <thomas.mueller@tmit.eu> + * @author Vinicius Brand <vinicius@eita.org.br> + * @author Daniel Tygel <dtygel@eita.org.br> * * @license AGPL-3.0 * @@ -27,6 +29,13 @@ * */ +\OC::$server->registerService('LDAPUserPluginManager', function() { + return new OCA\User_LDAP\UserPluginManager(); +}); +\OC::$server->registerService('LDAPGroupPluginManager', function() { + return new OCA\User_LDAP\GroupPluginManager(); +}); + $helper = new \OCA\User_LDAP\Helper(\OC::$server->getConfig()); $configPrefixes = $helper->getServerConfigurationPrefixes(true); if(count($configPrefixes) > 0) { @@ -46,12 +55,19 @@ if(count($configPrefixes) > 0) { }); $userSession = \OC::$server->getUserSession(); + $userPluginManager = \OC::$server->query('LDAPUserPluginManager'); + $groupPluginManager = \OC::$server->query('LDAPGroupPluginManager'); + $userBackend = new OCA\User_LDAP\User_Proxy( - $configPrefixes, $ldapWrapper, $ocConfig, $notificationManager, $userSession + $configPrefixes, $ldapWrapper, $ocConfig, $notificationManager, $userSession, $userPluginManager ); - $groupBackend = new OCA\User_LDAP\Group_Proxy($configPrefixes, $ldapWrapper); + $groupBackend = new OCA\User_LDAP\Group_Proxy($configPrefixes, $ldapWrapper, $groupPluginManager); // register user backend OC_User::useBackend($userBackend); + + // Hook to allow plugins to work on registered backends + OC::$server->getEventDispatcher()->dispatch('OCA\\User_LDAP\\User\\User::postLDAPBackendAdded'); + \OC::$server->getGroupManager()->addBackend($groupBackend); } |