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