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
path: root/apps
diff options
context:
space:
mode:
authorBjörn Schießle <bjoern@schiessle.org>2013-03-06 12:38:06 +0400
committerBjörn Schießle <bjoern@schiessle.org>2013-03-06 12:38:06 +0400
commit82990b82a6f4d90730e6af4eddead6e4103dd0e8 (patch)
treed939064c4910c49596c2e46205f35c5da09328da /apps
parentc1a32b50735b0a8558823d111e546865ddcba790 (diff)
parentb5dc8b9ca364adc301bf8be62061a160d94c22ca (diff)
Merge pull request #2118 from owncloud/fix_1689
properly implement displayNamesInGroup in Core and LDAP, fixes #1689
Diffstat (limited to 'apps')
-rw-r--r--apps/user_ldap/group_ldap.php17
-rw-r--r--apps/user_ldap/group_proxy.php16
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..68d2efe3871 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
*