/var/www/vhosts/ihelp.ro/_OLD/src/Controller
Edit: /var/www/vhosts/ihelp.ro/_OLD/src/Controller/AppController.php (2330B)
loadComponent('FormProtection');`
*
* @return void
*/
public function initialize(): void
{
parent::initialize();
$this->loadComponent('RequestHandler');
$this->loadComponent('Flash');
// Add this line to check authentication result and lock your site
$this->loadComponent('Authentication.Authentication');
$this->loadComponent('Authorization.Authorization');
/*
* Enable the following component for recommended CakePHP form protection settings.
* see https://book.cakephp.org/4/en/controllers/components/form-protection.html
*/
//$this->loadComponent('FormProtection');
// $is_authenticated = $this->Authentication->getIdentity();
// $this->set(compact("is_authenticated"));
}
# --------------------------------
# App > beforeFilter
# --------------------------------
public function beforeFilter(EventInterface $event)
{
$this->_setUserAuth();
}
private function _setUserAuth(): void
{
$auth = $this->Authentication->getIdentity();
$this->userAuth = $auth;
$this->set('userAuth', $this->userAuth);
}
}