2020-08-04 11:25:22 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Config;
|
2020-05-27 18:46:16 +02:00
|
|
|
|
|
|
|
use CodeIgniter\Config\BaseConfig;
|
|
|
|
|
|
|
|
class Filters extends BaseConfig
|
|
|
|
{
|
2020-06-10 15:00:12 +00:00
|
|
|
// Makes reading things below nicer,
|
|
|
|
// and simpler to change out script that's used.
|
|
|
|
public $aliases = [
|
|
|
|
'csrf' => \CodeIgniter\Filters\CSRF::class,
|
|
|
|
'toolbar' => \CodeIgniter\Filters\DebugToolbar::class,
|
|
|
|
'honeypot' => \CodeIgniter\Filters\Honeypot::class,
|
2020-07-10 12:20:25 +00:00
|
|
|
'login' => \Myth\Auth\Filters\LoginFilter::class,
|
|
|
|
'role' => \Myth\Auth\Filters\RoleFilter::class,
|
2020-07-31 16:05:10 +00:00
|
|
|
'permission' => \App\Filters\Permission::class,
|
2020-06-10 15:00:12 +00:00
|
|
|
];
|
2020-05-27 18:46:16 +02:00
|
|
|
|
2020-06-10 15:00:12 +00:00
|
|
|
// Always applied before every request
|
|
|
|
public $globals = [
|
|
|
|
'before' => [
|
|
|
|
//'honeypot'
|
|
|
|
// 'csrf',
|
|
|
|
],
|
|
|
|
'after' => [
|
|
|
|
'toolbar',
|
|
|
|
//'honeypot'
|
|
|
|
],
|
|
|
|
];
|
2020-05-27 18:46:16 +02:00
|
|
|
|
2020-06-10 15:00:12 +00:00
|
|
|
// Works on all of a particular HTTP method
|
|
|
|
// (GET, POST, etc) as BEFORE filters only
|
|
|
|
// like: 'post' => ['CSRF', 'throttle'],
|
|
|
|
public $methods = [];
|
2020-05-27 18:46:16 +02:00
|
|
|
|
2020-06-10 15:00:12 +00:00
|
|
|
// List filter aliases and any before/after uri patterns
|
|
|
|
// that they should run on, like:
|
|
|
|
// 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']],
|
|
|
|
public $filters = [];
|
2020-07-10 12:20:25 +00:00
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
parent::__construct();
|
|
|
|
|
|
|
|
$this->filters = [
|
|
|
|
'login' => ['before' => [config('App')->adminGateway . '*']],
|
|
|
|
];
|
|
|
|
}
|
2020-05-27 18:46:16 +02:00
|
|
|
}
|