|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?php
-
- namespace Config;
-
- use App\Filters\FormularioInicialFilter;
- use App\Filters\InicioFilter;
- use CodeIgniter\Config\BaseConfig;
- use CodeIgniter\Filters\CSRF;
- use CodeIgniter\Filters\DebugToolbar;
- use CodeIgniter\Filters\Honeypot;
- use CodeIgniter\Filters\InvalidChars;
- use CodeIgniter\Filters\SecureHeaders;
-
- class Filters extends BaseConfig
- {
- /**
- * Configures aliases for Filter classes to
- * make reading things nicer and simpler.
- *
- * @var array
- */
- public $aliases = [
- 'csrf' => CSRF::class,
- 'toolbar' => DebugToolbar::class,
- 'honeypot' => Honeypot::class,
- 'invalidchars' => InvalidChars::class,
- 'secureheaders' => SecureHeaders::class,
- 'login' => \Myth\Auth\Filters\LoginFilter::class,
- 'inicio' => InicioFilter::class,
- 'formulario_inicial' => FormularioInicialFilter::class,
- ];
-
- /**
- * List of filter aliases that are always
- * applied before and after every request.
- *
- * @var array
- */
- public $globals = [
- 'before' => [
- // 'honeypot',
- // 'csrf',
- // 'invalidchars',
- 'login'
- ],
- 'after' => [
- 'toolbar',
- // 'honeypot',
- // 'secureheaders',
- ],
- ];
-
- /**
- * List of filter aliases that works on a
- * particular HTTP method (GET, POST, etc.).
- *
- * Example:
- * 'post' => ['foo', 'bar']
- *
- * If you use this, you should disable auto-routing because auto-routing
- * permits any HTTP method to access a controller. Accessing the controller
- * with a method you don’t expect could bypass the filter.
- *
- * @var array
- */
- public $methods = [
- 'post' => ['csrf'],
- ];
-
- /**
- * List of filter aliases that should run on any
- * before or after URI patterns.
- *
- * Example:
- * 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']]
- *
- * @var array
- */
- public $filters = [
- 'inicio' => ['before' => ['/', '/horas']],
- 'formulario_inicial' => ['before' => ['registro/']]
- ];
- }
|