summaryrefslogtreecommitdiffstats
path: root/lib/kolab_api_controller.php
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-08-22 13:07:28 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-08-22 13:07:28 +0100
commit8fe5574fa0cebce31e8571bf90c5fdfc14a47101 (patch)
tree9f314b4df32ef50640dbf4c2861573d402abccd3 /lib/kolab_api_controller.php
parent648c792b1a212121599e10025602257a620e869b (diff)
downloadwebadmin-8fe5574fa0cebce31e8571bf90c5fdfc14a47101.tar.gz
Fix handling domain-specific capabilities
Diffstat (limited to 'lib/kolab_api_controller.php')
-rw-r--r--lib/kolab_api_controller.php21
1 files changed, 9 insertions, 12 deletions
diff --git a/lib/kolab_api_controller.php b/lib/kolab_api_controller.php
index f5e67d7..c2688a3 100644
--- a/lib/kolab_api_controller.php
+++ b/lib/kolab_api_controller.php
@@ -337,7 +337,8 @@ class kolab_api_controller
$dna = 'associateddomain';
}
- $this->domains = $auth->list_domains();
+ $_domains = $auth->list_domains();
+ $this->domains = $_domains['list'];
$result = array();
@@ -345,15 +346,12 @@ class kolab_api_controller
// we should always return our own.
if (count($this->domains) < 1) {
//console("As there is but one domain, we insert our own");
- $this->domains[] = $_SESSION['user']->get_domain();
+ $this->domains[] = Array($dna => $_SESSION['user']->get_domain());
}
- //console("\$this->domains:", $this->domains);
-
// add capabilities of all registered services
- foreach ($this->domains as $domain) {
-
- $domain_name = is_array($domain) ? (is_array($domain[$dna]) ? $domain[$dna][0] : $domain[$dna]) : $domain;
+ foreach ($this->domains as $domain_dn => $domain_attrs) {
+ $domain_name = is_array($domain_attrs) ? (is_array($domain_attrs[$dna]) ? $domain_attrs[$dna][0] : $domain_attrs[$dna]) : $domain_attrs;
// define our very own capabilities
$actions = array(
@@ -368,15 +366,14 @@ class kolab_api_controller
}
}
- //console("api capabilities", $domain, $domain_name);
-
$result[$domain_name] = array('actions' => $actions);
}
return array(
- 'list' => $result,
- 'count' => count($result),
- );
+ 'list' => $result,
+ 'count' => count($result),
+ );
+
}
private function get_domain() {