<?php

namespace app\omnia;

use engine\http\errors\Forbidden;

class MainHandler
    extends BaseHandler
{
    public function beforeDispatch(string $http_method, string $action) {
        if (!isAdmin())
            throw new Forbidden();
    }

    public function GET_index() {
        $this->skin->meta->title = lang('meta_index_title');
        $this->skin->meta->description = lang('meta_index_description');
        $this->skin->meta->url = 'https://'.$_SERVER['HTTP_HOST'].'/';

        $this->skin->options->isIndex = true;

        return $this->skin->renderPage('index.twig');
    }
}
