1<?php
2
3namespace dokuwiki\Action;
4
5use dokuwiki\Extension\Event;
6use dokuwiki\Ui;
7
8/**
9 * Class Denied
10 *
11 * Show the access denied screen
12 *
13 * @package dokuwiki\Action
14 */
15class Denied extends AbstractAction
16{
17    /** @inheritdoc */
18    public function minimumPermission()
19    {
20        return AUTH_NONE;
21    }
22
23    /** @inheritdoc */
24    public function tplContent()
25    {
26        $this->showBanner();
27
28        $data = null;
29        $event = new Event('ACTION_DENIED_TPLCONTENT', $data);
30        if ($event->advise_before()) {
31            global $INPUT;
32            if (empty($INPUT->server->str('REMOTE_USER')) && actionOK('login')) {
33                (new Ui\Login)->show();
34            }
35        }
36        $event->advise_after();
37    }
38
39    /**
40     * Display error on denied pages
41     *
42     * @author   Andreas Gohr <andi@splitbrain.org>
43     *
44     * @return void
45     */
46    public function showBanner()
47    {
48        // print intro
49        print p_locale_xhtml('denied');
50    }
51
52}
53