summaryrefslogtreecommitdiffstats
path: root/lib/api/kolab_api_service_ou.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_ou.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_ou.php')
-rw-r--r--lib/api/kolab_api_service_ou.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/api/kolab_api_service_ou.php b/lib/api/kolab_api_service_ou.php
index fdfd9ee..015d736 100644
--- a/lib/api/kolab_api_service_ou.php
+++ b/lib/api/kolab_api_service_ou.php
@@ -74,13 +74,16 @@ class kolab_api_service_ou extends kolab_api_service
*/
public function ou_add($getdata, $postdata)
{
- $unit_attributes = $this->parse_input_attributes('ou', $postdata);
-
- $auth = Auth::get_instance();
- $result = $auth->organizationalunit_add($unit_attributes, $postdata['type_id']);
+ $attributes = $this->parse_input_attributes('ou', $postdata);
+ $auth = Auth::get_instance();
+ $result = $auth->organizationalunit_add($attributes, $postdata['type_id']);
if ($result) {
- return $unit_attributes;
+ if ($id = $this->unique_attribute_value($result)) {
+ $attributes['id'] = $id;
+ }
+
+ return $attributes;
}
return FALSE;