Skip to content

Commit

Permalink
Hide page menu item from anonymous users
Browse files Browse the repository at this point in the history
  • Loading branch information
annda committed Nov 24, 2022
1 parent 71a147c commit 9fd061b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions action.php
Expand Up @@ -61,6 +61,8 @@ public function handle(Doku_Event $event) {
public function handleMenu(Doku_Event $event)
{
if ($event->data['view'] !== 'page') return;
// menu item is only for logged in users
if (empty($_SERVER['REMOTE_USER'])) return;

array_splice($event->data['items'], -1, 0, [new \dokuwiki\plugin\recommend\MenuItem()]);
}
Expand Down

0 comments on commit 9fd061b

Please sign in to comment.