ch1p_io_web/handler/admin/AdminRequestHandler.php
2022-07-11 02:59:40 +03:00

20 lines
424 B
PHP

<?php
namespace handler\admin;
use admin;
use Response;
class AdminRequestHandler extends \RequestHandler {
public function beforeDispatch(): ?Response {
$this->skin->static[] = 'css/admin.css';
$this->skin->static[] = 'js/admin.js';
if (!($this instanceof Login) && !admin::isAdmin())
throw new \ForbiddenException('looks like you are not admin');
return null;
}
}