예제 #1
0
 public function forgotpasswordAction()
 {
     global $mySession;
     $db = new Db();
     $this->view->pageTitle = "Forgot Password";
     $myform = new Form_Forgotpassword();
     $varsuccess = 0;
     if ($this->getRequest()->isPost()) {
         $request = $this->getRequest();
         $dataForm = $myform->getValues();
         if ($myform->isValid($request->getPost())) {
             $dataForm = $myform->getValues();
             //prd($dataForm);
             $sql = "select * from " . USERS . " where email_address = '" . $dataForm['email_address'] . "'";
             $chkArr = $db->runQuery($sql);
             if (count($chkArr) > 0) {
                 $myObj = new Users();
                 $dataForm['pswd_change_link'] = $_REQUEST['pswd_change_link'];
                 $Result = $myObj->CheckForgotData($dataForm);
                 $mySession->sucessMsg = "mail has been sent to your account";
                 $varsuccess = 1;
             } else {
                 $mySession->errorMsg = "Username or email_address is incorrect";
             }
         } else {
             $mySession->errorMsg = "Username or email_address is incorrect";
         }
     }
     $this->view->myform = $myform;
     $this->view->varsuccess = $varsuccess;
 }
예제 #2
0
 public function getpasswordAction()
 {
     global $mySession;
     $db = new Db();
     $this->_helper->layout->setLayout('myaccount');
     $myform = new Form_Forgotpassword();
     $this->view->myform = $myform;
     if ($this->getRequest()->isPost()) {
         $request = $this->getRequest();
         //$myform = new Form_Forgotpassword();
         if ($myform->isValid($request->getPost())) {
             //echo "kk";die;
             $dataForm = $myform->getValues();
             //prd($dataForm);
             $myObj = new Users();
             $Result = $myObj->CheckForgotpass($dataForm);
             if ($Result > 0) {
                 $mySession->errorMsg = "Your password reset information has been sent to your email address.";
                 /*$mySession->LoggedUserId=$Result;*/
                 $this->_redirect('login/index');
             } else {
                 $mySession->errorMsg = "Email Address you entered is not registerd.";
                 //$this->view->myform = $myform1;
                 $this->_redirect('login/forgotpassword');
                 //$this->render('index');
             }
         } else {
             $this->view->myform = $myform;
             $this->render('forgotpassword');
         }
     }
 }