diff options
Diffstat (limited to 'apps/user_ldap/appinfo')
-rw-r--r-- | apps/user_ldap/appinfo/app.php | 20 | ||||
-rw-r--r-- | apps/user_ldap/appinfo/register_command.php | 3 |
2 files changed, 20 insertions, 3 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); } diff --git a/apps/user_ldap/appinfo/register_command.php b/apps/user_ldap/appinfo/register_command.php index bd706e61f22..495445b3fa4 100644 --- a/apps/user_ldap/appinfo/register_command.php +++ b/apps/user_ldap/appinfo/register_command.php @@ -37,7 +37,8 @@ $uBackend = new User_Proxy( new LDAP(), $ocConfig, \OC::$server->getNotificationManager(), - \OC::$server->getUserSession() + \OC::$server->getUserSession(), + \OC::$server->query('LDAPUserPluginManager') ); $deletedUsersIndex = new DeletedUsersIndex( $ocConfig, $dbConnection, $userMapping |