blob: 04b7cde2f12908d067abfdcf9f5c389c0d5c77a5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
<?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;
}
}
|