public function enableuserAction() { $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->enableUser($nUserId); if ($bJson) { $sEmailAddress = $oModelUser->findEmailAddress($nUserId); $aParam = $oModelVUser->getUserParam($nUserId); $oMail = new AppCms2_Controller_Plugin_Mail(); $oMail->sendUserAccountActivation($sEmailAddress, $aParam); } header("Content-type: application/json"); echo Zend_Json::encode($bJson); exit; }
public function confirmnewaccountAction() { $this->_helper->viewRenderer->setNoRender(); $this->_helper->getHelper("layout")->disableLayout(); $oModelUser = new Admin_Model_User(); $oModelUserNewAccount = new Admin_Model_UserNewAccount(); $sActivatingCode = $this->_request->getParam("code"); if (isset($sActivatingCode) && is_string($sActivatingCode) && strlen($sActivatingCode) == 32) { $nUserId = $oModelUserNewAccount->confirmNewAccount($sActivatingCode); if (!is_numeric($nUserId)) { $this->_redirect("admin/user/login"); } if ($oModelUser->activatingNewUser($nUserId)) { $sEmailAddress = $oModelUser->findEmailAddress($nUserId); $oModelUserNewAccount->deleteConfirmCode($sActivatingCode); $oMail = new AppCms2_Controller_Plugin_Mail(); $oMail->sendUserAccountActivation($sEmailAddress); } } $this->_redirect("admin/user/login"); }