From a1dc24c9daef6f976adf2101fe104e8c5d7dc4b2 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Thu, 31 Jan 2013 21:19:24 +0100 Subject: [PATCH 1/2] LDAP: implement getDisplayName and getDisplayNames also for UserProxy (multiple server support) --- apps/user_ldap/user_proxy.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/apps/user_ldap/user_proxy.php b/apps/user_ldap/user_proxy.php index 47f901ddb51..5609f72ee6e 100644 --- a/apps/user_ldap/user_proxy.php +++ b/apps/user_ldap/user_proxy.php @@ -146,6 +146,33 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { return $this->handleRequest($uid, 'getHome', array($uid)); } + /** + * @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 correspondig 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 From fc585623a5f0f65bc14a3228ff7e305414e61332 Mon Sep 17 00:00:00 2001 From: Thomas Mueller Date: Thu, 31 Jan 2013 22:49:07 +0100 Subject: [PATCH 2/2] spell check :+1: --- apps/user_ldap/user_proxy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/user_ldap/user_proxy.php b/apps/user_ldap/user_proxy.php index 5609f72ee6e..a94be3354fc 100644 --- a/apps/user_ldap/user_proxy.php +++ b/apps/user_ldap/user_proxy.php @@ -157,7 +157,7 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface { /** * @brief Get a list of all display names - * @returns array with all displayNames (value) and the correspondig uids (key) + * @returns array with all displayNames (value) and the corresponding uids (key) * * Get a list of all display names and user ids. */