Skip to content
Snippets Groups Projects
Commit 5da9223d authored by Arthur Schiwon's avatar Arthur Schiwon
Browse files

make getDisplayNames optional feature for Group Backends, fall back to internal names

parent b08894ba
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
......@@ -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',
);
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment