1 | <?php |
||
16 | trait SecurityController |
||
17 | { |
||
18 | /** |
||
19 | * Create an internal URL |
||
20 | * Uses method from |
||
21 | * @see \FFCMS\Helpers\UrlHelper |
||
22 | * @param string $url |
||
23 | * @param array $params |
||
24 | */ |
||
25 | abstract public function url(string $url, array $params = []): string; |
||
26 | |||
27 | /** |
||
28 | * Check for CSRF token, reroute if failed, otherwise generate new csrf token |
||
29 | * Call this method from a controller method class to check and then set a new csrf token |
||
30 | * then include $f3-get('csrf') as a hidden type in your form to be submitted |
||
31 | * |
||
32 | * @param string $url if csrf check fails |
||
33 | * @param array $params for querystring |
||
34 | * @return boolean true/false if csrf enabled |
||
35 | */ |
||
36 | public function csrf(string $url = '@index', array $params = []): bool |
||
59 | |||
60 | |||
61 | /** |
||
62 | * Check ip-address is blacklisted, halt, if-so |
||
63 | * |
||
64 | * @return bool |
||
65 | */ |
||
66 | public function dnsbl(): bool |
||
82 | |||
83 | } |
||
84 |