original_string: public function recoverAction($request)
      {
          $data = $request->get('data');
          $modelUser = new ModelUser;
  
          if ($this->isAuthenticated()) {
              $this->setMessage('error', 'Your are already authenticated.');
              return $this->redirect('/');
          }
  
          if (!filter_var($data['model']['email'], FILTER_VALIDATE_EMAIL)) {
              $this->setMessage('error', 'Thats is not an email');
              return $this->redirect('/user/recover');
          }
  
          if (!$modelUser->findByEmail($data['model']['email'])) {
              $this->setMessage('error', 'Your are not registered');
              return $this->redirect('/user/register');
          }
  
          //Send the email
          $password = $modelUser->regeneratePassword();
          $to = $modelUser->email;
          $subject = 'Password from Reader';
          $message = 'Your new password is ' . $password;
          $this->sendMail($to, $subject, $message);
  
          return $this->twig()->render('user\recoverAction.twig');
      }
code: public function recoverAction($request)
      {
          $data = $request->get('data');
          $modelUser = new ModelUser;
  
          if ($this->isAuthenticated()) {
              $this->setMessage('error', 'Your are already authenticated.');
              return $this->redirect('/');
          }
  
          if (!filter_var($data['model']['email'], FILTER_VALIDATE_EMAIL)) {
              $this->setMessage('error', 'Thats is not an email');
              return $this->redirect('/user/recover');
          }
  
          if (!$modelUser->findByEmail($data['model']['email'])) {
              $this->setMessage('error', 'Your are not registered');
              return $this->redirect('/user/register');
          }
  
          //Send the email
          $password = $modelUser->regeneratePassword();
          $to = $modelUser->email;
          $subject = 'Password from Reader';
          $message = 'Your new password is ' . $password;
          $this->sendMail($to, $subject, $message);
  
          return $this->twig()->render('user\recoverAction.twig');
      }
code_tokens: public function recoverAction ( $ request ) { $ data = $ request -> get ( 'data' ) ; $ modelUser = new ModelUser ; if ( $ this -> isAuthenticated ( ) ) { $ this -> setMessage ( 'error' , 'Your are already authenticated.' ) ; return $ this -> redirect ( '/' ) ; } if ( ! filter_var ( $ data [ 'model' ] [ 'email' ] , FILTER_VALIDATE_EMAIL ) ) { $ this -> setMessage ( 'error' , 'Thats is not an email' ) ; return $ this -> redirect ( '/user/recover' ) ; } if ( ! $ modelUser -> findByEmail ( $ data [ 'model' ] [ 'email' ] ) ) { $ this -> setMessage ( 'error' , 'Your are not registered' ) ; return $ this -> redirect ( '/user/register' ) ; } //Send the email $ password = $ modelUser -> regeneratePassword ( ) ; $ to = $ modelUser -> email ; $ subject = 'Password from Reader' ; $ message = 'Your new password is ' . $ password ; $ this -> sendMail ( $ to , $ subject , $ message ) ; return $ this -> twig ( ) -> render ( 'user\recoverAction.twig' ) ; }
docstring: Handles the recover action.
  
  @param $request
  
  @return string|\Symfony\Component\HttpFoundation\RedirectResponse
docstring_tokens: Handles the recover action .