summaryrefslogtreecommitdiff
path: root/lib/kolab_api_service.php
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-10-30 16:07:12 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-10-30 16:07:12 (GMT)
commit4ed5d8bac6679405c00121b1a061b49f5f54d9cf (patch)
tree059ab95a52e8914ffc22b9b5303aa148a3e49077 /lib/kolab_api_service.php
parent24311b40a521fed384d5d26b297eb88a8088f5c3 (diff)
downloadkolab-wap-4ed5d8bac6679405c00121b1a061b49f5f54d9cf.tar.gz
Add functions to generate and validate Asterisk account attributes
Diffstat (limited to 'lib/kolab_api_service.php')
-rw-r--r--lib/kolab_api_service.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/kolab_api_service.php b/lib/kolab_api_service.php
index a2eda00..ea62318 100644
--- a/lib/kolab_api_service.php
+++ b/lib/kolab_api_service.php
@@ -264,7 +264,17 @@ abstract class kolab_api_service
$form_service = $this->controller->get_service('form_value');
// With the result, start validating the input
- $form_service->validate(null, $attribs);
+ $validate_result = $form_service->validate(null, $attribs);
+
+ $special_attr_validate = Array();
+
+ foreach ($validate_result as $attr_name => $value) {
+ if (!empty($value) && $value !== "OK" && $value !== 0) {
+ $special_attr_validate[$attr_name] = $value;
+ }
+ }
+
+ Log::trace("kolab_api_service::parse_input_attributes() \$special_attr_validate: " . var_export($special_attr_validate, TRUE));
$result = array();
@@ -316,7 +326,9 @@ abstract class kolab_api_service
}
}
- Log::trace("parse_input_attributes result", $result);
+ $result = array_merge($result, $special_attr_validate);
+
+ Log::trace("parse_input_attributes result (merge of \$result and \$special_attr_validate)", $result);
return $result;
}