summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/api/kolab_api_service_resource.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/api/kolab_api_service_resource.php b/lib/api/kolab_api_service_resource.php
index e3d6de1..8c65e20 100644
--- a/lib/api/kolab_api_service_resource.php
+++ b/lib/api/kolab_api_service_resource.php
@@ -210,6 +210,14 @@ class kolab_api_service_resource extends kolab_api_service
// normalize result
$result = $this->parse_result_attributes('resource', $result);
+ if (empty($result['ou'])) {
+ $dn = ldap_explode_dn($result['entrydn'], 0);
+ // pop the count and rdn
+ unset($dn['count']);
+ unset($dn[0]);
+ $result['ou'] = implode(',', $dn);
+ }
+
if ($result) {
return $result;
}