xref: /dokuwiki/inc/Menu/Item/Admin.php (revision d9672f6752d0f3712b36e338e1c2cb2283e4b1bc)
1<?php
2
3namespace dokuwiki\Menu\Item;
4
5/**
6 * Class Admin
7 *
8 * Opens the Admin screen. Only shown to managers or above
9 */
10class Admin extends AbstractItem
11{
12    /** @inheritdoc */
13    public function __construct()
14    {
15        global $INPUT;
16        global $INFO;
17
18        parent::__construct();
19
20        if (!$INPUT->server->str('REMOTE_USER')) {
21            throw new \RuntimeException("admin is only for logged in users");
22        }
23
24        if (!isset($INFO) || !$INFO['ismanager']) {
25            throw new \RuntimeException("admin is only for managers and above");
26        }
27
28        $this->svg = DOKU_INC . 'lib/images/menu/settings.svg';
29    }
30}
31