public function contactAction() { $oFormContact = new Admin_Form_Contact(); $oModelUser = new Admin_Model_User(); $sEmailAddress = $oModelUser->findEmailAddress($this->_nUserId); $oFormContact->populate(array("email_address" => $sEmailAddress)); if ($this->_request->isPost()) { $aPostData = $this->_request->getPost(); $oMail = new AppCms2_Controller_Plugin_Mail(); $sEmailAddress = $oModelUser->findEmailAddress($this->_nUserId); if ($oFormContact->isValid($aPostData)) { $oMail->sendEmail(array("subject" => trim($sStr = "Kontakt z systemu zamawiania kopii - " . $aPostData["subject"]), "email_address" => $sEmailAddress, "user_name" => $this->_sUserName), $aPostData["message"]); } $oFormContact->clearForm(); } $this->view->oFormContact = $oFormContact; }
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; }
public function renderinvoiceformAction() { $this->_helper->viewRenderer->setNoRender(); $this->_helper->getHelper("layout")->disableLayout(); $oModelVOrderPaymentHistory = new Borrower_Model_VOrderPaymentHistory(); $oFormOrderInvoice = new Borrower_Form_OrderInvoice(); $oUser = new Admin_Model_User(); $aJson = null; if ($this->_request->isPost()) { $aPostData = $this->_request->getPost(); if ($aPostData["module"] == "borrower" && is_numeric($aPostData["order_payment_id"]) && isset($oFormOrderInvoice)) { $oRowset = $oModelVOrderPaymentHistory->getUserPaymentDetails($this->_nUserId, $aPostData["order_payment_id"]); if ($oRowset->count()) { $aParam["id"] = $aPostData["order_payment_id"]; $aParam["user_email_address"] = $oUser->findEmailAddress($this->_nUserId); $aParam["user_name"] = $this->_sUserName; foreach ($oRowset->toArray() as $nKey => $aValue) { $aParam["amount"] = $aValue["order_payment_total_amount"] / 100 . " PLN"; $aParam["order_id"] .= $aValue["order_journal_id"] . "; "; } } $oFormOrderInvoice->populate($aParam); $aJson = $oFormOrderInvoice->render(); } } header("Content-type: application/json"); echo Zend_Json::encode($aJson); exit; }
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"); }