LDAP: implementation of displayNamesInGroup
This commit is contained in:
parent
5da9223d1c
commit
72c293e834
|
@ -209,6 +209,19 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
|
|||
return $groupUsers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -135,6 +135,22 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface {
|
|||
return $users;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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
|
||||
|
|
Loading…
Reference in New Issue