diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-11-06 16:07:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-06 16:07:31 +0100 |
commit | 5411d60b249cc12b429ed8083e7f34d1415d278e (patch) | |
tree | f50b1b15040a14a663427b6868c111c7176a5eb2 /apps/user_ldap/appinfo | |
parent | 0256f68c4909ecacc1b2b515253523809a870868 (diff) | |
parent | fa565750d1f94f9d3f7e2229e7ec7aadd0d06063 (diff) | |
download | nextcloud-server-5411d60b249cc12b429ed8083e7f34d1415d278e.tar.gz nextcloud-server-5411d60b249cc12b429ed8083e7f34d1415d278e.zip |
Merge pull request #5321 from coletivoEITA/user_ldap_plugins_structure
Implement plugins infrastructure in User_LDAP
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 |