summaryrefslogtreecommitdiffstats
path: root/lib/api/kolab_api_service_domain_types.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/kolab_api_service_domain_types.php')
-rw-r--r--lib/api/kolab_api_service_domain_types.php44
1 files changed, 40 insertions, 4 deletions
diff --git a/lib/api/kolab_api_service_domain_types.php b/lib/api/kolab_api_service_domain_types.php
index 487faeb..7ea999e 100644
--- a/lib/api/kolab_api_service_domain_types.php
+++ b/lib/api/kolab_api_service_domain_types.php
@@ -57,6 +57,33 @@ class kolab_api_service_domain_types extends kolab_api_service
),
);
+ public static $HOSTED_TYPE_ATTRS = array(
+ 'auto_form_fields' => array(),
+ 'form_fields' => array(
+ 'associateddomain' => array(
+ 'type' => 'list'
+ ),
+// 'inetdomainbasedn' => array(
+// 'optional' => true,
+// ),
+ 'inetdomainstatus' => array(
+ 'optional' => true,
+ 'type' => 'select',
+ 'values' => array(
+ '', 'active', 'suspended', 'deleted',
+ ),
+ ),
+ ),
+ 'fields' => array(
+ 'domainrelatedobject_only' => 1,
+ 'objectclass' => array(
+ 'top',
+ 'domainrelatedobject',
+ 'inetdomain',
+ ),
+ ),
+ );
+
/**
* Returns service capabilities.
@@ -83,14 +110,23 @@ class kolab_api_service_domain_types extends kolab_api_service
public function domain_types_list($get, $post)
{
// @TODO: move to database
- $types = array(
- 1 => array(
+ $types = array();
+
+ if ($this->conf->get('kolab_wap', 'hosted_root_dn')) {
+ $types[1] = array(
+ 'key' => 'hosted',
+ 'name' => 'Hosted domain',
+ 'description' => 'A hosted domain name space',
+ 'attributes' => self::$HOSTED_TYPE_ATTRS,
+ );
+ } else {
+ $types[1] = array(
'key' => 'standard',
'name' => 'Standard domain',
'description' => 'A standard domain name space',
'attributes' => self::$DEFAULT_TYPE_ATTRS,
- ),
- );
+ );
+ }
return array(
'list' => $types,