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 /lib | |
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 'lib')
-rw-r--r-- | lib/private/Group/Manager.php | 13 | ||||
-rw-r--r-- | lib/public/IGroupManager.php | 7 | ||||
-rw-r--r-- | lib/public/LDAP/ILDAPProvider.php | 57 |
3 files changed, 74 insertions, 3 deletions
diff --git a/lib/private/Group/Manager.php b/lib/private/Group/Manager.php index 15d83380acf..20d19f106b4 100644 --- a/lib/private/Group/Manager.php +++ b/lib/private/Group/Manager.php @@ -74,7 +74,7 @@ class Manager extends PublicEmitter implements IGroupManager { private $cachedGroups = array(); /** - * @var \OC\Group\Group[][] + * @var \OC\Group\Group[] */ private $cachedUserGroups = array(); @@ -144,7 +144,16 @@ class Manager extends PublicEmitter implements IGroupManager { $this->backends = array(); $this->clearCaches(); } - + + /** + * Get the active backends + * @return \OCP\GroupInterface[] + */ + public function getBackends() { + return $this->backends; + } + + protected function clearCaches() { $this->cachedGroups = array(); $this->cachedUserGroups = array(); diff --git a/lib/public/IGroupManager.php b/lib/public/IGroupManager.php index be322b64325..778a0ef169c 100644 --- a/lib/public/IGroupManager.php +++ b/lib/public/IGroupManager.php @@ -66,6 +66,13 @@ interface IGroupManager { public function clearBackends(); /** + * Get the active backends + * @return \OCP\GroupInterface[] + * @since 13.0.0 + */ + public function getBackends(); + + /** * @param string $gid * @return \OCP\IGroup * @since 8.0.0 diff --git a/lib/public/LDAP/ILDAPProvider.php b/lib/public/LDAP/ILDAPProvider.php index 3c07dfcbe8e..a65d3e85cd6 100644 --- a/lib/public/LDAP/ILDAPProvider.php +++ b/lib/public/LDAP/ILDAPProvider.php @@ -3,6 +3,10 @@ * * @copyright Copyright (c) 2016, Roger Szabo (roger.szabo@web.de) * + * @author Roger Szabo <roger.szabo@web.de> + * @author Vinicius Brand <vinicius@eita.org.br> + * @author Daniel Tygel <dtygel@eita.org.br> + * * @license GNU AGPL version 3 or any later version * * This program is free software: you can redistribute it and/or modify @@ -36,7 +40,15 @@ interface ILDAPProvider { * @since 11.0.0 */ public function getUserDN($uid); - + + /** + * Translate a group id to LDAP DN. + * @param string $gid group id + * @return string + * @since 13.0.0 + */ + public function getGroupDN($gid); + /** * Translate a LDAP DN to an internal user name. * @param string $dn LDAP DN @@ -69,6 +81,14 @@ interface ILDAPProvider { * @since 11.0.0 */ public function getLDAPConnection($uid); + + /** + * Return a new LDAP connection resource for the specified group. + * @param string $gid group id + * @return resource of the LDAP connection + * @since 13.0.0 + */ + public function getGroupLDAPConnection($gid); /** * Get the LDAP base for users. @@ -102,4 +122,39 @@ interface ILDAPProvider { * @since 11.0.0 */ public function clearCache($uid); + + /** + * Clear the cache if a cache is used, otherwise do nothing. + * @param string $gid group id + * @since 13.0.0 + */ + public function clearGroupCache($gid); + + /** + * Get the LDAP attribute name for the user's display name + * @param string $uid user id + * @return string the display name field + * @throws \Exception if user id was not found in LDAP + * @since 12.0.0 + */ + public function getLDAPDisplayNameField($uid); + + /** + * Get the LDAP attribute name for the email + * @param string $uid user id + * @return string the email field + * @throws \Exception if user id was not found in LDAP + * @since 12.0.0 + */ + public function getLDAPEmailField($uid); + + /** + * Get the LDAP attribute name for the type of association betweeen users and groups + * @param string $gid group id + * @return string the configuration, one of: 'memberUid', 'uniqueMember', 'member', 'gidNumber' + * @throws \Exception if group id was not found in LDAP + * @since 13.0.0 + */ + public function getLDAPGroupMemberAssoc($gid); + } |