4in1_ws_web/classes/handler/admin/AdminRequestHandler.php
2023-12-30 23:29:31 +00:00

21 lines
483 B
PHP

<?php
namespace handler\admin;
use admin;
use exceptions\ForbiddenException;
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 LoginHandler) && !admin::isAdmin())
throw new ForbiddenException('These aren\'t the pages you\'re looking for...');
return null;
}
}