xref: /dokuwiki/inc/Menu/Item/Login.php (revision 93b8c351fad5246a7a91c86418f15bec833dc99f)
1<?php
2
3namespace dokuwiki\Menu\Item;
4
5class Login extends AbstractItem {
6
7    /** @inheritdoc */
8    public function __construct() {
9        global $INPUT;
10        parent::__construct();
11
12        $this->category = 'user';
13        $this->params['sectok'] = getSecurityToken();
14        if($INPUT->server->has('REMOTE_USER')) {
15            if(!actionOK('logout')) {
16                throw new \RuntimeException("logout disabled");
17            }
18            $this->params['do'] = 'logout';
19            $this->type = 'logout';
20        }
21    }
22
23}
24