blob: 5a6bd12c112e9a019558944d8857d7595ed1756e (
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;
}
}
|