ic: close website for non-admins
This commit is contained in:
parent
0aa77194c3
commit
a3850dc679
@ -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');
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user