summaryrefslogtreecommitdiffstats
path: root/lib/api/kolab_api_service_user.php
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-02-27 14:17:01 +0100
committerAleksander Machniak <machniak@kolabsys.com>2014-02-27 14:17:01 +0100
commit4a55f2c1d856a3e7d44ab03d31ceca7bee86afda (patch)
treea88b0279c6283d17a831036b604a986b4d6f657d /lib/api/kolab_api_service_user.php
parent52e47e63d2c46206dff28a3d1cec782f0d5b1f23 (diff)
downloadwebadmin-4a55f2c1d856a3e7d44ab03d31ceca7bee86afda.tar.gz
Return ID (unique attribute) after adding an object (Request #2829)
Diffstat (limited to 'lib/api/kolab_api_service_user.php')
-rw-r--r--lib/api/kolab_api_service_user.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/api/kolab_api_service_user.php b/lib/api/kolab_api_service_user.php
index 4d985bb..6cf4483 100644
--- a/lib/api/kolab_api_service_user.php
+++ b/lib/api/kolab_api_service_user.php
@@ -81,15 +81,19 @@ class kolab_api_service_user extends kolab_api_service
{
Log::trace("user_add()", $postdata);
- $user_attributes = $this->parse_input_attributes('user', $postdata);
+ $attributes = $this->parse_input_attributes('user', $postdata);
- Log::trace("user_add()", $user_attributes);
+ Log::trace("user_add()", $attributes);
- $auth = Auth::get_instance();
- $result = $auth->user_add($user_attributes, $postdata['type_id']);
+ $auth = Auth::get_instance();
+ $result = $auth->user_add($attributes, $postdata['type_id']);
if ($result) {
- return $user_attributes;
+ if ($id = $this->unique_attribute_value($result)) {
+ $attributes['id'] = $id;
+ }
+
+ return $attributes;
}
return false;
@@ -146,6 +150,7 @@ class kolab_api_service_user extends kolab_api_service
{
$auth = Auth::get_instance();
$effective_rights = $auth->list_rights(empty($getdata['id']) ? 'user' : $getdata['id']);
+
return $effective_rights;
}