summaryrefslogtreecommitdiffstats
path: root/lib/kolab_api_controller.php
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-08-10 18:18:59 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-08-10 18:18:59 +0200
commit2558a1d859603bdc2ffd85a2cc669cd96001f1f9 (patch)
treeff0753452654907e3772c8c92c3d8fcfefb38a4a /lib/kolab_api_controller.php
parent7f0dcaa1e430b92bab0b1f8a5e9a3369a591f0ea (diff)
downloadwebadmin-2558a1d859603bdc2ffd85a2cc669cd96001f1f9.tar.gz
Make the api more generic by using the configured domain name attribute
Diffstat (limited to 'lib/kolab_api_controller.php')
-rw-r--r--lib/kolab_api_controller.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/kolab_api_controller.php b/lib/kolab_api_controller.php
index e0dbf8b..575ba26 100644
--- a/lib/kolab_api_controller.php
+++ b/lib/kolab_api_controller.php
@@ -308,6 +308,13 @@ class kolab_api_controller
$auth = Auth::get_instance();
+ // Get the domain name attribute
+ $conf = Conf::get_instance();
+ $dna = $conf->get('ldap', 'domain_name_attribute');
+ if (empty($dna)) {
+ $dna = 'associateddomain';
+ }
+
$this->domains = $auth->list_domains();
$result = array();
@@ -323,9 +330,9 @@ class kolab_api_controller
// add capabilities of all registered services
foreach ($this->domains as $domain) {
- // TODO: 'associateddomain' is very specific to 389ds based deployments, and this
- // is supposed to be very generic.
- $domain_name = is_array($domain) ? (is_array($domain['associateddomain']) ? $domain['associateddomain'][0] : $domain['associateddomain']) : $domain;
+
+ $domain_name = is_array($domain) ? (is_array($domain[$dna]) ? $domain[$dna][0] : $domain[$dna]) : $domain;
+
// define our very own capabilities
$actions = array(
'system.quit' => array('type' => 'w'),