Codestyle + check trustedproxies
[dokuwiki.git] / inc / Menu / Item / Login.php
blobca2542b02fbc1a6058562b504013d70059054da9
1 <?php
3 namespace dokuwiki\Menu\Item;
5 /**
6 * Class Login
8 * Show a login or logout item, based on the current state
9 */
10 class Login extends AbstractItem
12 /** @inheritdoc */
13 public function __construct()
15 global $INPUT;
16 parent::__construct();
18 $this->svg = DOKU_INC . 'lib/images/menu/login.svg';
19 $this->params['sectok'] = getSecurityToken();
20 if ($INPUT->server->has('REMOTE_USER')) {
21 if (!actionOK('logout')) {
22 throw new \RuntimeException("logout disabled");
24 $this->params['do'] = 'logout';
25 $this->type = 'logout';
26 $this->svg = DOKU_INC . 'lib/images/menu/logout.svg';