diff options
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); } |