Closed fthommen closed 2 years ago
hi,
the link "Edit this page" is always shown in the header even if the user is not allowed to edit the page, eg. by ACL.
I've fixed this on our site by adding an additional condition $INFO["editable"] to the relevant section in tpl_parts/tpl_pageheader.html. This changes
$INFO["editable"]
tpl_parts/tpl_pageheader.html
<!-- Edit this page --> <?php if ($ACT == "show" && $INFO["userinfo"]) { ?> <a style="margin-left:auto" href="<?php echo wl($ID,array('do'=>'edit'),true,'&'); ?>"> <i class="fas fa-pencil-alt"></i> <span> Edit this page</span> </a> <?php } ?>
to
<!-- Edit this page --> <?php if ($ACT == "show" && $INFO["userinfo"] && $INFO["editable"]) { ?> <a style="margin-left:auto" href="<?php echo wl($ID,array('do'=>'edit'),true,'&'); ?>"> <i class="fas fa-pencil-alt"></i> <span> Edit this page</span> </a> <?php } ?>
I'm not sure if this is the official way to do it for DokuWiki, but if it is, then I suggest to add this to the template.
I confirmed the bug and your fix just worked fine. I'll add your fix to the next release. Thanks!
hi,
the link "Edit this page" is always shown in the header even if the user is not allowed to edit the page, eg. by ACL.
I've fixed this on our site by adding an additional condition
$INFO["editable"]
to the relevant section intpl_parts/tpl_pageheader.html
. This changesto
I'm not sure if this is the official way to do it for DokuWiki, but if it is, then I suggest to add this to the template.