summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/api/kolab_api_service_user.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/api/kolab_api_service_user.php b/lib/api/kolab_api_service_user.php
index 7b6bd0e..1d46a75 100644
--- a/lib/api/kolab_api_service_user.php
+++ b/lib/api/kolab_api_service_user.php
@@ -79,11 +79,11 @@ class kolab_api_service_user extends kolab_api_service
*/
public function user_add($getdata, $postdata)
{
- //console("user_add()", $postdata);
+ Log::trace("user_add()", $postdata);
$user_attributes = $this->parse_input_attributes('user', $postdata);
- //console("user_add()", $user_attributes);
+ Log::trace("user_add()", $user_attributes);
$auth = Auth::get_instance();
$result = $auth->user_add($user_attributes, $postdata['type_id']);
@@ -123,12 +123,12 @@ class kolab_api_service_user extends kolab_api_service
public function user_edit($getdata, $postdata)
{
- //console("\$postdata to user_edit()", $postdata);
+ Log::trace("\$postdata to user_edit()", $postdata);
$user_attributes = $this->parse_input_attributes('user', $postdata);
$user = $postdata['id'];
- //console("\$user_attributes as result from parse_input_attributes", $user_attributes);
+ Log::trace("\$user_attributes as result from parse_input_attributes", $user_attributes);
$auth = Auth::get_instance();
$result = $auth->user_edit($user, $user_attributes, $postdata['type_id']);
@@ -166,10 +166,20 @@ class kolab_api_service_user extends kolab_api_service
$auth = Auth::get_instance();
$result = $auth->user_info($getdata['id']);
+ $result_dn = key($result);
+
Log::trace("user.info on " . $getdata['id'] . " result: " . var_export($result, TRUE));
// normalize result
$result = $this->parse_result_attributes('user', $result);
+ if (empty($result['ou'])) {
+ $_dn = ldap_explode_dn($result_dn, 0);
+ // pop the count and rdn
+ unset($_dn['count']);
+ unset($_dn[0]);
+ $result['ou'] = implode(',', $_dn);
+ }
+
Log::trace("user.info on " . $getdata['id'] . " parsed result: " . var_export($result, TRUE));
if ($result) {