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