summaryrefslogtreecommitdiffstats
path: root/lib/api
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-03-21 16:05:35 +0100
committerAleksander Machniak <machniak@kolabsys.com>2014-03-21 16:06:58 +0100
commit5a62c7e3594c60b7f37c417d5a004010ffb8c767 (patch)
tree020dc86e360f66ba977983a938387b5dbbd82efb /lib/api
parent26afc433416d6fcec4ca35f48d516f7c9330e949 (diff)
downloadwebadmin-5a62c7e3594c60b7f37c417d5a004010ffb8c767.tar.gz
Add ACI form widget (Request #1782)
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/kolab_api_service_form_value.php16
-rw-r--r--lib/api/kolab_api_service_ou.php4
-rw-r--r--lib/api/kolab_api_service_resource.php2
-rw-r--r--lib/api/kolab_api_service_sharedfolder.php2
-rw-r--r--lib/api/kolab_api_service_user.php8
5 files changed, 22 insertions, 10 deletions
diff --git a/lib/api/kolab_api_service_form_value.php b/lib/api/kolab_api_service_form_value.php
index fec6372..58b30a1 100644
--- a/lib/api/kolab_api_service_form_value.php
+++ b/lib/api/kolab_api_service_form_value.php
@@ -950,6 +950,22 @@ class kolab_api_service_form_value extends kolab_api_service
private function select_options_attribute($postdata, $attribs = array())
{
+ // if objectClasses aren't specified we'll use all classes already in use
+ // not all classes in LDAP
+ if (empty($postdata['classes'])) {
+ $postdata['classes'] = array();
+
+ foreach ($this->supported_types as $type) {
+ foreach ($this->object_types($type) as $obj_type) {
+ if ($obj_type['attributes'] && $obj_type['attributes']['fields']) {
+ $postdata['classes'] = array_merge($postdata['classes'], (array) $obj_type['attributes']['fields']['objectclass']);
+ }
+ }
+ }
+ }
+
+ $postdata['classes'] = array_unique($postdata['classes']);
+
$auth = Auth::get_instance();
$list = $auth->schema_attributes($postdata['classes']);
diff --git a/lib/api/kolab_api_service_ou.php b/lib/api/kolab_api_service_ou.php
index 7e9eddc..b7c902e 100644
--- a/lib/api/kolab_api_service_ou.php
+++ b/lib/api/kolab_api_service_ou.php
@@ -167,11 +167,11 @@ class kolab_api_service_ou extends kolab_api_service
$result = $auth->organizationalunit_info($getdata['id']);
// normalize result
- $result = $this->parse_result_attributes('ou', $result, $dn);
+ $result = $this->parse_result_attributes('ou', $result);
if ($result) {
// get base_dn "attribute" for the API client
- $dn = substr($dn, strlen($result['ou']) + 4);
+ $dn = substr($result['entrydn'], strlen($result['ou']) + 4);
if (strpos($dn, 'ou=') === 0) {
$result['base_dn'] = $dn;
}
diff --git a/lib/api/kolab_api_service_resource.php b/lib/api/kolab_api_service_resource.php
index ac04f3b..f5d095f 100644
--- a/lib/api/kolab_api_service_resource.php
+++ b/lib/api/kolab_api_service_resource.php
@@ -165,8 +165,6 @@ class kolab_api_service_resource extends kolab_api_service
// normalize result
$result = $this->parse_result_attributes('resource', $result);
- //console($result);
-
if ($result) {
return $result;
}
diff --git a/lib/api/kolab_api_service_sharedfolder.php b/lib/api/kolab_api_service_sharedfolder.php
index 23518b3..d14c4fc 100644
--- a/lib/api/kolab_api_service_sharedfolder.php
+++ b/lib/api/kolab_api_service_sharedfolder.php
@@ -165,8 +165,6 @@ class kolab_api_service_sharedfolder extends kolab_api_service
// normalize result
$result = $this->parse_result_attributes('sharedfolder', $result);
- //console($result);
-
if ($result) {
return $result;
}
diff --git a/lib/api/kolab_api_service_user.php b/lib/api/kolab_api_service_user.php
index 6cf4483..acdaec0 100644
--- a/lib/api/kolab_api_service_user.php
+++ b/lib/api/kolab_api_service_user.php
@@ -178,11 +178,11 @@ class kolab_api_service_user extends kolab_api_service
$result = $this->parse_result_attributes('user', $result);
if (empty($result['ou'])) {
- $_dn = ldap_explode_dn($result_dn, 0);
+ $dn = ldap_explode_dn($result['entrydn'], 0);
// pop the count and rdn
- unset($_dn['count']);
- unset($_dn[0]);
- $result['ou'] = implode(',', $_dn);
+ unset($dn['count']);
+ unset($dn[0]);
+ $result['ou'] = implode(',', $dn);
}
Log::trace("user.info on " . $getdata['id'] . " parsed result: " . var_export($result, TRUE));