summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-08-12 11:10:07 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-08-12 11:10:07 (GMT)
commit93cf56fa9e0779ccfc1fc079907d914929e9ec84 (patch)
tree8902e9b65d440a50e66ca610a76f15dcc477b555
parent45ba054788f5951d8812fea6e9e4647fd7b7d114 (diff)
downloadkolab-wap-93cf56fa9e0779ccfc1fc079907d914929e9ec84.tar.gz
Add parsing for a 'ou' attribute to groups as well
-rw-r--r--lib/Auth/LDAP.php8
-rw-r--r--lib/api/kolab_api_service_group.php8
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/Auth/LDAP.php b/lib/Auth/LDAP.php
index 1ca5764..7763205 100644
--- a/lib/Auth/LDAP.php
+++ b/lib/Auth/LDAP.php
@@ -556,7 +556,13 @@ class LDAP extends Net_LDAP3 {
public function group_add($attrs, $typeid = null)
{
- $base_dn = $this->entry_base_dn('group', $typeid);
+ if (!empty($attrs['ou'])) {
+ $base_dn = $attrs['ou'];
+ unset($attrs['ou']);
+ }
+ else {
+ $base_dn = $this->entry_base_dn('group', $typeid);
+ }
// TODO: The rdn is configurable as well.
// Use [$type_str . "_"]user_rdn_attr
diff --git a/lib/api/kolab_api_service_group.php b/lib/api/kolab_api_service_group.php
index 0e40867..b9eed47 100644
--- a/lib/api/kolab_api_service_group.php
+++ b/lib/api/kolab_api_service_group.php
@@ -163,6 +163,14 @@ class kolab_api_service_group extends kolab_api_service
Log::trace("group_info() result: " . var_export($result, TRUE));
+ 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;
}