public function beforeFilter(Event $event)
    {
        parent::beforeFilter($event);
        $this->Crud->addListener('Users.Users', ['mailer' => 'Users.User']);
        $this->Crud->mapAction('signup', [
            'className' => 'CrudUsers.Register',
            'view' => 'Users.signup',
            'saveOptions' => [
                'fieldList' => ['username', 'email', 'password']
            ],
            'messages' => [
                'success' => [
                    'text' => __('Please check your e-mail to validate your account')
                ],
                'error' => [
                    'text' => __('An error occurred while creating the account')
                ]
            ],
        ]);

        $this->Crud->mapAction('signin', [
            'className' => 'CrudUsers.Login',
            'view' => 'Users.signin',
            'messages' => [
                'success' => [
                    'text' => __('Login successful. Please validate your email address.')
                ],
                'error' => [
                    'text' => __('Your username or password is incorrect.')
                ]
            ],
        ]);

        $this->Crud->mapAction('signout', [
            'className' => 'CrudUsers.Logout',
            'messages' => [
                'success' => [
                    'text' => __('You are now signed out.')
                ],
            ],
        ]);

        $this->Crud->mapAction('sendRecovery', [
            'className' => 'CrudUsers.ForgotPassword',
        ]);

        $this->Crud->mapAction('changePassword', [
            'className' => 'CrudUsers.ResetPassword',
            'findMethod' => 'token',
        ]);

        $this->Crud->mapAction('verify', [
            'className' => 'CrudUsers.Verify',
            'findMethod' => 'token',
        ]);
    }