function preFilter() { parent::preFilter(); if (!$this->isAdmin) { $this->session->set('error', _('You need to be an admin to manage maps.')); $this->request->redirectArgList('/'); } }
function postFilter() { parent::postFilter(); $this->response->host = $this->server->rpcHost; $this->response->port = $this->server->rpcPort; $this->response->isRelay = $this->server->isRelay; $this->response->maniaplanetJoin = $this->server->getLink('join'); $this->response->maniaplanetSpectate = $this->server->getLink('spectate'); $this->response->playersCount = count($this->players); $this->response->options = $this->options; $this->response->currentMap = $this->currentMap; $this->response->nextMap = $this->nextMap; }