original_string: public function createAction()
      {
          $success = null;
          $this->paragraphLayout();
  
          /* @var $form \Zend\Form\Form */
          $request    = $this->getRequest();
          $data       = $request->getPost();
          $service    = $this->getServiceLocator();
          $model      = $service->get( 'Grid\User\Model\User\Model' );
          $form       = $service->get( 'Form' )
                                ->get( 'Grid\User\PasswordChangeRequest\Create' );
  
          if ( $request->isPost() )
          {
              $form->setData( $data );
  
              if ( $form->isValid() )
              {
                  $data = $form->getData( 'email' );
                  $user = $model->findByEmail( $data['email'] );
  
                  if ( ! empty( $user ) &&
                       $user->state != UserStructure::STATE_BANNED )
                  {
                      $change = $this->url()
                                     ->fromRoute( 'Grid\User\PasswordChangeRequest\Resolve', array(
                                         'locale' => (string) $this->locale(),
                                         'hash'   => $this->getServiceLocator()
                                                          ->get( 'Grid\User\Model\ConfirmHash' )
                                                          ->create( $user->email ),
                                     ) );
  
                      $this->getServiceLocator()
                           ->get( 'Grid\Mail\Model\Template\Sender' )
                           ->prepare( array(
                               'template' => 'user.forgotten-password',
                               'locale'   => $user->locale,
                           ) )
                           ->send( array(
                               'email'        => $user->email,
                               'display_name' => $user->displayName,
                               'change_url'   => $change,
                           ), array(
                               $user->email   => $user->displayName,
                           ) );
  
                      $success = true;
                  }
                  else
                  {
                      $success = false;
                  }
              }
              else
              {
                  $success = false;
              }
          }
  
          /* Says success even if email does not exists */
          if ( $success === true || $success === false )
          {
              $this->messenger()
                   ->add( 'user.form.passwordRequest.success',
                          'user', Message::LEVEL_INFO );
          }
  
          return new MetaContent( 'user.passwordChangeRequest', array(
              'form' => $form,
          ) );
      }
code: public function createAction()
      {
          $success = null;
          $this->paragraphLayout();
  
          /* @var $form \Zend\Form\Form */
          $request    = $this->getRequest();
          $data       = $request->getPost();
          $service    = $this->getServiceLocator();
          $model      = $service->get( 'Grid\User\Model\User\Model' );
          $form       = $service->get( 'Form' )
                                ->get( 'Grid\User\PasswordChangeRequest\Create' );
  
          if ( $request->isPost() )
          {
              $form->setData( $data );
  
              if ( $form->isValid() )
              {
                  $data = $form->getData( 'email' );
                  $user = $model->findByEmail( $data['email'] );
  
                  if ( ! empty( $user ) &&
                       $user->state != UserStructure::STATE_BANNED )
                  {
                      $change = $this->url()
                                     ->fromRoute( 'Grid\User\PasswordChangeRequest\Resolve', array(
                                         'locale' => (string) $this->locale(),
                                         'hash'   => $this->getServiceLocator()
                                                          ->get( 'Grid\User\Model\ConfirmHash' )
                                                          ->create( $user->email ),
                                     ) );
  
                      $this->getServiceLocator()
                           ->get( 'Grid\Mail\Model\Template\Sender' )
                           ->prepare( array(
                               'template' => 'user.forgotten-password',
                               'locale'   => $user->locale,
                           ) )
                           ->send( array(
                               'email'        => $user->email,
                               'display_name' => $user->displayName,
                               'change_url'   => $change,
                           ), array(
                               $user->email   => $user->displayName,
                           ) );
  
                      $success = true;
                  }
                  else
                  {
                      $success = false;
                  }
              }
              else
              {
                  $success = false;
              }
          }
  
          /* Says success even if email does not exists */
          if ( $success === true || $success === false )
          {
              $this->messenger()
                   ->add( 'user.form.passwordRequest.success',
                          'user', Message::LEVEL_INFO );
          }
  
          return new MetaContent( 'user.passwordChangeRequest', array(
              'form' => $form,
          ) );
      }
code_tokens: public function createAction ( ) { $ success = null ; $ this -> paragraphLayout ( ) ; /* @var $form \Zend\Form\Form */ $ request = $ this -> getRequest ( ) ; $ data = $ request -> getPost ( ) ; $ service = $ this -> getServiceLocator ( ) ; $ model = $ service -> get ( 'Grid\User\Model\User\Model' ) ; $ form = $ service -> get ( 'Form' ) -> get ( 'Grid\User\PasswordChangeRequest\Create' ) ; if ( $ request -> isPost ( ) ) { $ form -> setData ( $ data ) ; if ( $ form -> isValid ( ) ) { $ data = $ form -> getData ( 'email' ) ; $ user = $ model -> findByEmail ( $ data [ 'email' ] ) ; if ( ! empty ( $ user ) && $ user -> state != UserStructure :: STATE_BANNED ) { $ change = $ this -> url ( ) -> fromRoute ( 'Grid\User\PasswordChangeRequest\Resolve' , array ( 'locale' => ( string ) $ this -> locale ( ) , 'hash' => $ this -> getServiceLocator ( ) -> get ( 'Grid\User\Model\ConfirmHash' ) -> create ( $ user -> email ) , ) ) ; $ this -> getServiceLocator ( ) -> get ( 'Grid\Mail\Model\Template\Sender' ) -> prepare ( array ( 'template' => 'user.forgotten-password' , 'locale' => $ user -> locale , ) ) -> send ( array ( 'email' => $ user -> email , 'display_name' => $ user -> displayName , 'change_url' => $ change , ) , array ( $ user -> email => $ user -> displayName , ) ) ; $ success = true ; } else { $ success = false ; } } else { $ success = false ; } } /* Says success even if email does not exists */ if ( $ success === true || $ success === false ) { $ this -> messenger ( ) -> add ( 'user.form.passwordRequest.success' , 'user' , Message :: LEVEL_INFO ) ; } return new MetaContent ( 'user.passwordChangeRequest' , array ( 'form' => $ form , ) ) ; }
docstring: Create a password-request
docstring_tokens: Create a password - request