summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-09-11 15:07:17 +0200
committerAleksander Machniak <alec@alec.pl>2013-09-11 15:07:17 +0200
commit35e100a781299b7b497d8f5d836a8b03ad0ee918 (patch)
tree378585b0c33badbdf9846effcdae23f06102cc71 /lib
parent7c4f566db4786079c30f9a6ec6428cd07364b4cb (diff)
downloadwebadmin-35e100a781299b7b497d8f5d836a8b03ad0ee918.tar.gz
Fix inetdomainstatus - changed field to select with options: '', 'active', 'suspended' (Bug #2202)
Diffstat (limited to 'lib')
-rw-r--r--lib/api/kolab_api_service_domain_types.php54
-rw-r--r--lib/kolab_api_service.php28
2 files changed, 34 insertions, 48 deletions
diff --git a/lib/api/kolab_api_service_domain_types.php b/lib/api/kolab_api_service_domain_types.php
index 6152ea4..6829047 100644
--- a/lib/api/kolab_api_service_domain_types.php
+++ b/lib/api/kolab_api_service_domain_types.php
@@ -28,6 +28,33 @@
*/
class kolab_api_service_domain_types extends kolab_api_service
{
+ public static $DEFAULT_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',
+ ),
+ ),
+ ),
+ 'fields' => array(
+ 'objectclass' => array(
+ 'top',
+ 'domainrelatedobject',
+ 'inetdomain',
+ ),
+ ),
+ );
+
+
/**
* Returns service capabilities.
*
@@ -55,31 +82,10 @@ class kolab_api_service_domain_types extends kolab_api_service
// @TODO: move to database
$types = array(
1 => array(
- 'key' => 'standard',
- 'name' => 'Standard domain',
+ 'key' => 'standard',
+ 'name' => 'Standard domain',
'description' => 'A standard domain name space',
- 'attributes' => array(
- 'auto_form_fields' => array(),
- 'form_fields' => array(
- 'associateddomain' => array(
- 'type' => 'list',
- ),
- 'inetdomainbasedn' => array(
- 'optional' => true,
- ),
- 'inetdomainstatus' => array(
- 'type' => 'checkbox',
- 'optional' => true,
- ),
- ),
- 'fields' => array(
- 'objectclass' => array(
- 'top',
- 'domainrelatedobject',
- 'inetdomain',
- ),
- ),
- ),
+ 'attributes' => self::$DEFAULT_TYPE_ATTRS,
),
);
diff --git a/lib/kolab_api_service.php b/lib/kolab_api_service.php
index 4d2f9ef..a154f7d 100644
--- a/lib/kolab_api_service.php
+++ b/lib/kolab_api_service.php
@@ -80,30 +80,10 @@ abstract class kolab_api_service
if (empty($object_types[$type_id])) {
if ($object_name == 'domain') {
- $result = array(
- 'auto_form_fields' => array(),
- 'form_fields' => array(
- 'aci' => array(
- 'type' => 'list',
- 'optional' => true,
- ),
- 'associateddomain' => array(
- 'type' => 'list'
- ),
- 'inetdomainbasedn' => array(
- 'optional' => true,
- ),
- 'inetdomainstatus' => array(
- 'optional' => true,
- ),
- ),
- 'fields' => array(
- 'objectclass' => array(
- 'top',
- 'domainrelatedobject',
- 'inetdomain',
- ),
- ),
+ $result = kolab_api_service_domain_types::$DEFAULT_TYPE_ATTRS;
+ $result['form_fields']['aci'] = array(
+ 'type' => 'list',
+ 'optional' => true,
);
return $result;