xref: /dokuwiki/inc/Action/Denied.php (revision 540b38e2d1ab27e8ce4e994e30aead6b308ccbd6)
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        $data = null;
27        $event = new Event('ACTION_DENIED_TPLCONTENT', $data);
28
29        if ($event->advise_before(true)) {
30            global $INPUT;
31            $this->showBanner();
32            if (empty($INPUT->server->str('REMOTE_USER')) && actionOK('login')) {
33                (new Ui\Login)->show();
34            }
35        }
36
37        $event->advise_after();
38    }
39
40    /**
41     * Display error on denied pages
42     *
43     * @author   Andreas Gohr <andi@splitbrain.org>
44     *
45     * @return void
46     */
47    public function showBanner()
48    {
49        // print intro
50        print p_locale_xhtml('denied');
51    }
52
53}
54