コード例 #1
0
 public function confirmchangepasswordAction()
 {
     $this->_helper->viewRenderer->setNoRender();
     $this->_helper->getHelper("layout")->disableLayout();
     $oModelUser = new Admin_Model_User();
     $oModelUserNewPassword = new Admin_Model_UserNewPassword();
     $oModelVUser = new Admin_Model_VUser();
     $sActivatingCode = $this->_request->getParam("code");
     if (isset($sActivatingCode) && is_string($sActivatingCode) && strlen($sActivatingCode) == 32) {
         $oRow = $oModelUserNewPassword->confirmNewPassword($sActivatingCode);
         if (!isset($oRow) && is_string($oRow->new_password) && strlen($oRow->new_password) == 32) {
             $this->_redirect("user/login");
         }
         if ($oModelUser->activatingNewPassword($oRow->user_id, $oRow->new_password)) {
             $oModelUserNewPassword->deleteConfirmCode($sActivatingCode);
             $sEmailAddress = $oModelUser->findEmailAddress($oRow->user_id);
             $aParam = $oModelVUser->getUserParam($oRow->user_id)->toArray();
             $oMail = new AppCms2_Controller_Plugin_Mail();
             $oMail->sendNewPasswordConfirmation($sEmailAddress, $aParam);
         }
     }
     $this->_redirect("admin/user/login");
 }