diff --git a/src/handlers/ic/MainHandler.php b/src/handlers/ic/MainHandler.php index f2d42c3..8e48372 100644 --- a/src/handlers/ic/MainHandler.php +++ b/src/handlers/ic/MainHandler.php @@ -2,12 +2,22 @@ namespace app\ic; +use engine\http\errors\NotFound; use engine\http\HtmlResponse; +use engine\http\PlainTextResponse; class MainHandler extends BaseHandler { + protected function beforeDispatch(string $http_method, string $action) { + if (!isAdmin() && $action != 'index') + throw new NotFound(); + } + public function GET_index() { - return new HtmlResponse($this->skin->render('soon.twig')); + if (!isAdmin()) + return new HtmlResponse($this->skin->render('soon.twig')); + + return new PlainTextResponse('hello world'); } } \ No newline at end of file