/**
  * @param MvcEvent $event
  *
  * @return mixed|void
  */
 public function onDispatch(MvcEvent $event)
 {
     parent::onDispatch($event);
     /*
      * If user is logged and tries to access one of the given actions
      * he will be redirected to the root url of the website.
      */
     if (getenv('APPLICATION_ENV') !== 'development') {
         if (!$this->UserData()->hasIdentity()) {
             $this->redirect()->toUrl('/');
         }
     }
 }
 /**
  * @param ResetPasswordForm $resetPasswordForm
  */
 public function __construct(ResetPasswordForm $resetPasswordForm)
 {
     parent::__construct();
     $this->resetPasswordForm = $resetPasswordForm;
 }
 /**
  * @param RegistrationForm $registrationForm
  */
 public function __construct(RegistrationForm $registrationForm)
 {
     parent::__construct();
     $this->registrationForm = $registrationForm;
 }
 /**
  * @param LoginForm             $loginForm
  * @param AuthenticationService $authService
  */
 public function __construct(LoginForm $loginForm, AuthenticationService $authService)
 {
     parent::__construct();
     $this->loginForm = $loginForm;
     $this->authService = $authService;
 }
 /**
  * @param ContactForm $contactForm
  */
 public function __construct(ContactForm $contactForm)
 {
     parent::__construct();
     $this->contactForm = $contactForm;
 }
 /**
  * @param NewPasswordForm $newPasswordForm
  */
 public function __construct(NewPasswordForm $newPasswordForm)
 {
     parent::__construct();
     $this->newPasswordForm = $newPasswordForm;
 }