Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-11-06 18:07:31 +0300
committerGitHub <noreply@github.com>2017-11-06 18:07:31 +0300
commit5411d60b249cc12b429ed8083e7f34d1415d278e (patch)
treef50b1b15040a14a663427b6868c111c7176a5eb2 /apps/user_ldap/appinfo/app.php
parent0256f68c4909ecacc1b2b515253523809a870868 (diff)
parentfa565750d1f94f9d3f7e2229e7ec7aadd0d06063 (diff)
Merge pull request #5321 from coletivoEITA/user_ldap_plugins_structure
Implement plugins infrastructure in User_LDAP
Diffstat (limited to 'apps/user_ldap/appinfo/app.php')
-rw-r--r--apps/user_ldap/appinfo/app.php20
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);
}