summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-02-10 09:38:18 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-02-10 11:11:33 (GMT)
commit68e6c59f5f8af54c85953ef21fa2a53d6fc11fe9 (patch)
treeb11b8d2e0dd44c1612f61c419520d0a8da8f8d4e
parent96f40a7dc9964f635c54df6ff951e831aaf1ff73 (diff)
downloadkolab-wap-68e6c59f5f8af54c85953ef21fa2a53d6fc11fe9.tar.gz
Zero results is OK, one result is OK, multiple results is not OK
-rw-r--r--lib/api/kolab_api_service_user.php8
1 files changed, 6 insertions, 2 deletions
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