Browse files

Skip pages that can't be read by the user before the collapse test

  • Loading branch information...
1 parent 981d0c7 commit a47fd576cee8780b017f5a9c1e58350cfb4fc6e3 @gjanssens gjanssens committed Feb 16, 2011
Showing with 14 additions and 7 deletions.
  1. +14 −7 syntax.php
View
21 syntax.php
@@ -14,6 +14,7 @@
* - Gunther Hartmann
* - Sebastian Menge
* - Matthias Schulte
+ * - Geert Janssens
*/
if (! defined ('DOKU_INC')) {
@@ -631,6 +632,11 @@ function _addFoundPage (&$data, $ns, $id, $type, $level) {
return false ;
}
}
+
+ // Don't add startpages the user isn't authorized to read
+ if (auth_quickaclcheck (substr($linkid,1)) < AUTH_READ)
+ return false ;
+
if ( $this->opts ["collapse"] ) {
// With collapse, only show:
// - sibling namespaces of the current namespace and it's ancestors
@@ -657,11 +663,6 @@ function _addFoundPage (&$data, $ns, $id, $type, $level) {
}
$linkid = $fqid . $this->start ;
-
- // Don't add startpages the user isn't authorized to read
- if (auth_quickaclcheck (substr($linkid,1)) < AUTH_READ)
- return false ;
-
break ;
}
@@ -983,13 +984,19 @@ function _getMeta (&$page, $key1, $key2 = NULL) {
$key1 == "date" &&
$key2 == "modified" &&
! isset ($page ["meta"]["date"]["modified"])
- ) {
+ ) {
+ $key2 = "created" ;
+ }
+ //
// Return "creator" if "contributor" is null
//
if (
$key1 == "contributor" &&
! isset ($page ["meta"]["contributor"])
- if (
+ ) {
+ $key1 = "creator" ;
+ }
+
if (is_string ($key2))
return $page ["meta"] [$key1] [$key2] ;

0 comments on commit a47fd57

Please sign in to comment.