/**
  * @param $frontendUser
  * @param $confKey
  * @param $defaultForward
  * @param array $extraConf
  * @return bool|object
  */
 protected function doBehaviors($frontendUser, $confKey, $defaultForward, $extraConf = array())
 {
     $behaviorsConf = $this->settings['behaviors']['frontendUser'][$confKey];
     if (!is_array($behaviorsConf)) {
         $behaviorsConf = array();
     }
     $behaviorResponse = $this->behaviorService->executeBehaviors($behaviorsConf, $frontendUser, $this->controllerContext, $defaultForward, $extraConf);
     return $behaviorResponse;
 }
예제 #2
0
 /**
  * Accepts the forget password form submission and executes behaviors tied to the forgot password
  * event.
  *
  * @param string $emailAddress
  * @validate $emailAddress notEmpty
  * @validate $emailAddress emailAddress
  */
 public function handleForgotPasswordAction($emailAddress)
 {
     // If the extension is configured to not allow forgot password, this action is not allowed.
     if (!$this->settings['login']['allowForgotPassword']) {
         $GLOBALS['TSFE']->pageNotFoundAndExit();
     } else {
         // forgot password is allowed...
         $user = $this->frontendUserRepository->findOneByEmail($emailAddress);
         if (is_object($user) && $user->getUid()) {
             $behaviorsConf = $this->settings['behaviors']['login']['forgotPassword'];
             $this->behaviorService->executeBehaviors($behaviorsConf, $user, $this->controllerContext, 'forgotPassword');
             $this->forward('forgotPassword', NULL, NULL, array('requestProcessed' => true, 'requestSuccessful' => true));
         } else {
             // The developer can decide whether she wants to show feedback in the view when the request was not successful.
             $this->forward('forgotPassword', NULL, NULL, array('requestProcessed' => true, 'requestSuccessful' => false));
         }
     }
 }