summaryrefslogtreecommitdiffstats
path: root/lib/api/kolab_api_service_user.php
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-02-10 10:38:18 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-02-10 12:10:57 +0100
commita1b72a428231c67d5c2fdedc202c323e145630b0 (patch)
treef3fef86684a1fc9c4fa893a20a49c6c4611d6726 /lib/api/kolab_api_service_user.php
parent32df8a7519ea7736b84b627f9c7cc2574a0d216c (diff)
downloadwebadmin-a1b72a428231c67d5c2fdedc202c323e145630b0.tar.gz
Zero results is OK, one result is OK, multiple results is not OK
Diffstat (limited to 'lib/api/kolab_api_service_user.php')
-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