summaryrefslogtreecommitdiff
path: root/action.php
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2011-10-22 02:11:58 +0200
committerYves Fischer <yvesf-git@xapek.org>2011-10-22 02:11:58 +0200
commitb1f758b12b198a51db719578649db9cc95172f3c (patch)
treef78e4ebf8a49388e2ad96e49a25c3f05c38bb72a /action.php
parentfc87f3d31d50ec60fdf4edc3eda68ad77e86e11c (diff)
downloaddokuwiki-plugin-treenav-b1f758b12b198a51db719578649db9cc95172f3c.tar.gz
dokuwiki-plugin-treenav-b1f758b12b198a51db719578649db9cc95172f3c.zip
check user acls. Depend cache on config-filesHEADmaster
Diffstat (limited to 'action.php')
-rw-r--r--action.php24
1 files changed, 16 insertions, 8 deletions
diff --git a/action.php b/action.php
index 1edea7b..e9b7158 100644
--- a/action.php
+++ b/action.php
@@ -64,13 +64,18 @@ class action_plugin_treenav extends DokuWiki_Action_Plugin {
function hook_beforePage(&$event, $param) {
global $ID;
- $deps = p_get_metadata($id, 'treenav_deps', true);
- $cache = new cache(cleanID($ID), 'plugin_treenav');
+ global $INFO;
+ global $config_cascade;
+ $deps = p_get_metadata($id, 'treenav_deps', true);
+ $cache = new cache(cleanID($ID) . $INFO['userinfo']['name'], 'plugin_treenav');
+
if (count($deps)>0 && $cache->useCache($deps)) {
$doc = $cache->retrieveCache(false);
} else {
- $deps = array('files' => array());
+ $deps = array('files' => array($config_cascade['acl']['default']));
+ $deps['files'] = array_merge($deps['files'], getConfigFiles('main'));
+
$root = new treenav_NamespaceNode('',0);
$renderer =& p_get_renderer('xhtml');
@@ -97,7 +102,8 @@ class action_plugin_treenav extends DokuWiki_Action_Plugin {
global $ID;
foreach ($node->getChildren() as $child) {
foreach ($child->getPages() as $page) {
- if (noNS($page['id']) === 'start') {
+ if (noNS($page['id']) === 'start' &&
+ auth_quickaclcheck($page['id']) >= AUTH_READ) {
$renderer->listitem_open();
$deps['files'][] = wikiFN($page['id']); // Add page file to dependencies
$this->_renderPagelink($page['id'], $renderer);
@@ -116,10 +122,12 @@ class action_plugin_treenav extends DokuWiki_Action_Plugin {
foreach ($node->getPages() as $page) {
if (noNS($page['id']) == 'start' && getNS($page['id']) != '')
continue;
- $renderer->listitem_open();
- $deps['files'][] = wikiFN($page['id']); // Add page file to dependencies
- $this->_renderPagelink($page['id'], $renderer);
- $renderer->listitem_close();
+ if (auth_quickaclcheck($page['id']) >= AUTH_READ) {
+ $renderer->listitem_open();
+ $deps['files'][] = wikiFN($page['id']); // Add page file to dependencies
+ $this->_renderPagelink($page['id'], $renderer);
+ $renderer->listitem_close();
+ }
}
}