コード例 #1
0
 public function disableuserAction()
 {
     $this->_helper->viewRenderer->setNoRender();
     $this->_helper->getHelper("layout")->disableLayout();
     $aInputFilters = array("*" => array(new Zend_Filter_StringTrim()));
     $aInputValidators = array("id" => array(new Zend_Validate_Digits()));
     $oInput = new Zend_Filter_Input($aInputFilters, $aInputValidators, $_POST);
     $nUserId = $oInput->getUnescaped("id");
     $oModelUser = new Admin_Model_User();
     $oModelVUser = new Admin_Model_VUser();
     $bJson = $oModelUser->disableUser($nUserId);
     if ($bJson) {
         $sEmailAddress = $oModelUser->findEmailAddress($nUserId);
         $aParam = $oModelVUser->getUserParam($nUserId);
         $oMail = new AppCms2_Controller_Plugin_Mail();
         $oMail->sendUserAccountDeactivation($sEmailAddress, $aParam);
     }
     header("Content-type: application/json");
     echo Zend_Json::encode($bJson);
     exit;
 }
コード例 #2
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");
 }