lib/api
Jeroen van Meeuwen
vanmeeuwen at kolabsys.com
Mon Feb 10 12:11:01 CET 2014
lib/api/kolab_api_service_user.php | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
New commits:
commit a1b72a428231c67d5c2fdedc202c323e145630b0
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date: Mon Feb 10 10:38:18 2014 +0100
Zero results is OK, one result is OK, multiple results is not OK
diff --git a/lib/api/kolab_api_service_user.php b/lib/api/kolab_api_service_user.php
index 1d46a75..202510d 100644
--- a/lib/api/kolab_api_service_user.php
+++ b/lib/api/kolab_api_service_user.php
@@ -209,8 +209,12 @@ class kolab_api_service_user extends kolab_api_service
// find user(s)
$users = $auth->list_users(null, $attributes, $search, $params);
- if (empty($users) || empty($users['list']) || $users['count'] > 1) {
- return false;
+ if (empty($users) || empty($users['list'])) {
+ return Array();
+ }
+
+ if ($users['count'] > 1) {
+ raise Exception, "More than a single entry found.";
}
// get user data
More information about the commits
mailing list