lib/client

Torsten Grote grote at kolabsys.com
Mon Dec 3 17:46:35 CET 2012


 lib/client/kolab_client_task_signup.php |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 91bd0911172f2fb549db8b9430a02c9e5ed89def
Author: Torsten Grote <grote at kolabsys.com>
Date:   Mon Dec 3 17:46:10 2012 +0100

    check for uid as well when checking for existing users

diff --git a/lib/client/kolab_client_task_signup.php b/lib/client/kolab_client_task_signup.php
index 6bb0c11..7b8ec0c 100644
--- a/lib/client/kolab_client_task_signup.php
+++ b/lib/client/kolab_client_task_signup.php
@@ -110,10 +110,16 @@ class kolab_client_task_signup extends kolab_client_task
 
         $this->login($data['domain']);
 
-        // Assemble mail attribute
-        $mail = $data['uid'].'@'.$data['domain'];
+        $post = array(
+            'attributes' =>  array('uid', 'mail'),
+            'search' => array('params' => array(
+                        'uid' => array('type' => 'exact', 'value' => $data['uid']),
+                        'mail' => array('type' => 'exact', 'value' => $data['uid'].'@'.$data['domain']),
+                    ),
+                'operator' => "OR"
+             )
+        );
 
-        $post = array('search' => array('mail' => array('value' => $mail) ) );
         $result = $this->api->post('users.list', null, $post);
 
         if($result->get('count') > 0) {





More information about the commits mailing list