Skip to content
Permalink
Browse files

fix: do not show pages without AUTH_READ

We now use the search function correctly for the pages, which now also
means, that the ACL-checks are working correctly šŸ‘
  • Loading branch information...
micgro42 committed Nov 21, 2017
1 parent 59c6d77 commit 1ed9ae0a8ea717a0e75f235f3df4af2aa384f998
Showing with 4 additions and 7 deletions.
  1. +4 āˆ’7 helper.php
@@ -7,19 +7,16 @@
class helper_plugin_sitemapnavi extends DokuWiki_Plugin {
protected $baseNS;
public function getSiteMap($baseNS)
{
global $conf, $INFO;
$this->baseNS = $baseNS;
$base = $conf['datadir'] . '/' . str_replace(':', '/', $baseNS);
$subdir = trim(str_replace(':', '/', $baseNS),'/');
$level = $this->getNumberOfSubnamespaces($baseNS) + 1;
$pages = array();
$currentNS = utf8_encodeFN(str_replace(':', '/', $INFO['namespace']));
search($pages, $base, 'search_index', array('ns' => $currentNS), '', $level);
search($pages, $conf['datadir'], 'search_index', array('ns' => $currentNS), $subdir, $level);
$media = array();
search($media, $conf['mediadir'], [$this, 'searchMediaIndex'], array('ns' => $currentNS, 'depth' => 1, 'showmsg'=>false), str_replace(':', '/', $baseNS));
$media = array_map(function($mediaFile) {
@@ -195,7 +192,7 @@ public function searchMediaIndex(&$data,$base,$file,$type,$lvl,$opts) {
public function listItemCallback($item)
{
$fullId = cleanID($this->baseNS . ':' . $item['id']);
$fullId = cleanID($item['id']);
$ret = '';
$base = ':' . $fullId;
@@ -221,7 +218,7 @@ public function liCallback($item)
{
global $INFO;
$currentClass = '';
$adjustedItemID = str_replace('::', ':', $this->baseNS . ':' . $item['id']);
$adjustedItemID = str_replace('::', ':', ':' . $item['id']);
if (strpos(':' . $INFO['id'] . ':', $adjustedItemID . ':') === 0) {
$currentClass = 'current';
}

0 comments on commit 1ed9ae0

Please sign in to comment.
You canā€™t perform that action at this time.