diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-01-31 13:50:20 -0800 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-01-31 13:50:20 -0800 |
commit | df3fc65e6fe616bcd9da7db32d1c377bf7084c93 (patch) | |
tree | e9b01301c1cb0a93f617b31480bb90d82fec5433 | |
parent | 17f94de19b5a22c791d4d099ab3a7ad11b254445 (diff) | |
parent | fc585623a5f0f65bc14a3228ff7e305414e61332 (diff) | |
download | nextcloud-server-df3fc65e6fe616bcd9da7db32d1c377bf7084c93.tar.gz nextcloud-server-df3fc65e6fe616bcd9da7db32d1c377bf7084c93.zip |
Merge pull request #1399 from owncloud/fix_ldap_proxy_display_names
LDAP: implement getDisplayName and getDisplayNames also for UserProxy (m...
-rw-r--r-- | apps/user_ldap/user_proxy.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/apps/user_ldap/user_proxy.php b/apps/user_ldap/user_proxy.php index 47f901ddb51..a94be3354fc 100644 --- a/apps/user_ldap/user_proxy.php +++ b/apps/user_ldap/user_proxy.php @@ -147,6 +147,33 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { } /** + * @brief get display name of the user + * @param $uid user ID of the user + * @return display name + */ + public function getDisplayName($uid) { + return $this->handleRequest($uid, 'getDisplayName', array($uid)); + } + + /** + * @brief Get a list of all display names + * @returns array with all displayNames (value) and the corresponding uids (key) + * + * Get a list of all display names and user ids. + */ + public function getDisplayNames($search = '', $limit = null, $offset = null) { + //we do it just as the /OC_User implementation: do not play around with limit and offset but ask all backends + $users = array(); + foreach($this->backends as $backend) { + $backendUsers = $backend->getDisplayNames($search, $limit, $offset); + if (is_array($backendUsers)) { + $users = array_merge($users, $backendUsers); + } + } + return $users; + } + + /** * @brief delete a user * @param $uid The username of the user to delete * @returns true/false |