예제 #1
0
 public function forgotAction()
 {
     $request = $this->getRequest();
     $this->view->form = $form = new Application_Form_Forgot();
     $elements = $form->getElements();
     $form->clearDecorators();
     foreach ($elements as $element) {
         $element->removeDecorator('label');
     }
     $options = $request->getParams();
     if ($request->isPost()) {
         if ($form->isValid($request->getPost())) {
             $model = new Application_Model_User();
             $model = $model->fetchRow("email='{$options['email']}'");
             if (false !== $model) {
                 $Auth = new Base_Auth_Auth();
                 $Auth->recoverPassword($model);
                 //$this->view->msg="Your password has been reset and emailed to your email address.";
                 $msgNs = new Zend_Session_Namespace("app");
                 $msgNs->message = "Your password has been reset and emailed to your email address.";
                 $form->reset();
                 return $this->_helper->redirector('forgot', 'index', "default");
             }
         }
     }
     $msgNs = new Zend_Session_Namespace("app");
     $this->view->msg = $msgNs->message;
     $msgNs->message = "";
 }