summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-14 09:17:51 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-14 09:17:51 +0100
commitae29e8f58e0528d5a965b95542b0254ff55ca023 (patch)
treea6e3c917826834676b3daacf2cf056e3de70e2a8
parent3d8dcdb5e4dae17c9d636b9d7477a198c379c810 (diff)
downloadwebadmin-ae29e8f58e0528d5a965b95542b0254ff55ca023.tar.gz
Be more verbose on the capabilities and how they impact the menu
-rw-r--r--lib/kolab_client_task.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php
index 4bcc56b..6a16538 100644
--- a/lib/kolab_client_task.php
+++ b/lib/kolab_client_task.php
@@ -457,14 +457,14 @@ class kolab_client_task
$capabilities = $this->capabilities();
- //console($capabilities);
+ console("Obtained the following capabilities:", $capabilities);
foreach ($this->menu as $idx => $label) {
- //console("$task: $task, idx: $idx, label: $label");
+ console("Looking if \$task: $task, \$idx: $idx, \$label: $label is part of the capabilities");
if (in_array($task, array('user', 'group'))) {
if (!array_key_exists($task . "." . $idx, $capabilities['actions'])) {
- //console("$task.$idx not in \$capabilities['actions'], skipping", $capabilities['actions']);
+ console("$task.$idx not in \$capabilities['actions'], skipping", $capabilities['actions']);
continue;
}
}
@@ -553,17 +553,19 @@ class kolab_client_task
*/
protected function capabilities()
{
+ $domain = $_SESSION['user']['domain'];
+
if (!isset($_SESSION['capabilities'])) {
$result = $this->api->post('system.capabilities');
$list = $result->get('list');
if (is_array($list)) {
$_SESSION['capabilities'] = $list;
+ } else {
+ $_SESSION['capabilities'][$domain] = $list;
}
}
- $domain = $_SESSION['user']['domain'];
-
return $_SESSION['capabilities'][$domain];
}