diff options
author | Björn Schießle <bjoern@schiessle.org> | 2013-03-06 00:38:06 -0800 |
---|---|---|
committer | Björn Schießle <bjoern@schiessle.org> | 2013-03-06 00:38:06 -0800 |
commit | 82990b82a6f4d90730e6af4eddead6e4103dd0e8 (patch) | |
tree | d939064c4910c49596c2e46205f35c5da09328da /lib | |
parent | c1a32b50735b0a8558823d111e546865ddcba790 (diff) | |
parent | b5dc8b9ca364adc301bf8be62061a160d94c22ca (diff) | |
download | nextcloud-server-82990b82a6f4d90730e6af4eddead6e4103dd0e8.tar.gz nextcloud-server-82990b82a6f4d90730e6af4eddead6e4103dd0e8.zip |
Merge pull request #2118 from owncloud/fix_1689
properly implement displayNamesInGroup in Core and LDAP, fixes #1689
Diffstat (limited to 'lib')
-rw-r--r-- | lib/group.php | 8 | ||||
-rw-r--r-- | lib/group/backend.php | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/group.php b/lib/group.php index 88f0a2a032c..d1a830730b7 100644 --- a/lib/group.php +++ b/lib/group.php @@ -294,7 +294,13 @@ class OC_Group { public static function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) { $displayNames=array(); foreach(self::$_usedBackends as $backend) { - $displayNames = array_merge($backend->displayNamesInGroup($gid, $search, $limit, $offset), $displayNames); + if($backend->implementsActions(OC_GROUP_BACKEND_GET_DISPLAYNAME)) { + $displayNames = array_merge($backend->displayNamesInGroup($gid, $search, $limit, $offset), $displayNames); + } else { + $users = $backend->usersInGroup($gid, $search, $limit, $offset); + $names = array_combine($users, $users); + $displayNames = array_merge($names, $displayNames); + } } return $displayNames; } diff --git a/lib/group/backend.php b/lib/group/backend.php index 26a784efb28..2e17b5d0b7f 100644 --- a/lib/group/backend.php +++ b/lib/group/backend.php @@ -33,6 +33,7 @@ define('OC_GROUP_BACKEND_CREATE_GROUP', 0x00000001); define('OC_GROUP_BACKEND_DELETE_GROUP', 0x00000010); define('OC_GROUP_BACKEND_ADD_TO_GROUP', 0x00000100); define('OC_GROUP_BACKEND_REMOVE_FROM_GOUP', 0x00001000); +define('OC_GROUP_BACKEND_GET_DISPLAYNAME', 0x00010000); /** * Abstract base class for user management @@ -43,6 +44,7 @@ abstract class OC_Group_Backend implements OC_Group_Interface { OC_GROUP_BACKEND_DELETE_GROUP => 'deleteGroup', OC_GROUP_BACKEND_ADD_TO_GROUP => 'addToGroup', OC_GROUP_BACKEND_REMOVE_FROM_GOUP => 'removeFromGroup', + OC_GROUP_BACKEND_GET_DISPLAYNAME => 'displayNamesInGroup', ); /** |