Ejemplo n.º 1
0
 /**
  * Forgot action method
  *
  * @return void
  */
 public function forgot()
 {
     $this->prepareView('phire/forgot.phtml');
     $this->view->title = 'Password Reminder';
     $this->view->form = new Form\Forgot($this->application->config()['forms']['Phire\\Form\\Forgot']);
     if ($this->request->isPost()) {
         $this->view->form->addFilter('strip_tags')->addFilter('htmlentities', [ENT_QUOTES, 'UTF-8'])->setFieldValues($this->request->getPost());
         if ($this->view->form->isValid()) {
             $this->view->form->clearFilters()->addFilter('html_entity_decode', [ENT_QUOTES, 'UTF-8'])->filter();
             $user = new Model\User();
             $user->forgot($this->view->form->getFields());
             unset($this->view->form);
             $this->view->id = $user->id;
             $this->view->success = true;
         }
     }
     $this->send();
 }