diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2013-03-05 21:23:58 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2013-03-05 21:23:58 +0100 |
commit | 72c293e834a41f7c0368ead099513deb8388cbc9 (patch) | |
tree | 7017dfd45d93109d342cb3875108f69811812625 | |
parent | 5da9223d1c61257cbccbc762e6a7c28bc06f110b (diff) | |
download | nextcloud-server-72c293e834a41f7c0368ead099513deb8388cbc9.tar.gz nextcloud-server-72c293e834a41f7c0368ead099513deb8388cbc9.zip |
LDAP: implementation of displayNamesInGroup
-rw-r--r-- | apps/user_ldap/group_ldap.php | 17 | ||||
-rw-r--r-- | apps/user_ldap/group_proxy.php | 16 |
2 files changed, 30 insertions, 3 deletions
diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php index 4fd4c636913..efa5f8b4fe3 100644 --- a/apps/user_ldap/group_ldap.php +++ b/apps/user_ldap/group_ldap.php @@ -210,6 +210,19 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface { } /** + * @brief get a list of all display names in a group + * @returns array with display names (value) and user ids(key) + */ + public function displayNamesInGroup($gid, $search, $limit, $offset) { + $users = $this->usersInGroup($gid, $search, $limit, $offset); + $displayNames = array(); + foreach($users as $user) { + $displayNames[$user] = \OC_User::getDisplayName($user); + } + return $displayNames; + } + + /** * @brief get a list of all groups * @returns array with group names * @@ -287,8 +300,6 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface { * compared with OC_USER_BACKEND_CREATE_USER etc. */ public function implementsActions($actions) { - //always returns false, because possible actions are modifying - // actions. We do not write to LDAP, at least for now. - return false; + return (bool)(OC_GROUP_BACKEND_GET_DISPLAYNAME & $actions); } } diff --git a/apps/user_ldap/group_proxy.php b/apps/user_ldap/group_proxy.php index 5aa1aef0e0e..8f2e34e9b7a 100644 --- a/apps/user_ldap/group_proxy.php +++ b/apps/user_ldap/group_proxy.php @@ -136,6 +136,22 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { } /** + * @brief get a list of all display names in a group + * @returns array with display names (value) and user ids(key) + */ + public function displayNamesInGroup($gid, $search, $limit, $offset) { + $displayNames = array(); + + foreach($this->backends as $backend) { + $backendUsers = $backend->displayNamesInGroup($gid, $search, $limit, $offset); + if (is_array($backendUsers)) { + $displayNames = array_merge($displayNames, $backendUsers); + } + } + return $displayNames; + } + + /** * @brief get a list of all groups * @returns array with group names * |