示例#1
0
 /**
  * processAction
  * Update the record previously selected
  * @return unknown_type
  */
 public function processAction()
 {
     $request = $this->getRequest();
     try {
         // Check if we have a POST request
         if (!$request->isPost()) {
             return $this->_helper->redirector('index');
         }
         // Get our form and validate it
         $form = $this->getForm('/admin/domains/process');
         if (!$form->isValid($request->getPost())) {
             // Invalid entries
             $this->view->form = $form;
             $this->view->title = $this->translator->translate("Domain Process");
             $this->view->description = $this->translator->translate("Check all the information posted before saving them.");
             return $this->_helper->viewRenderer('customform');
             // re-render the login form
         }
         // Get the values posted
         $params = $form->getValues();
         // Get the id
         $id = $params['domain_id'];
         if (!empty($params['dnsform']['target']) && !empty($params['dnsform']['zones'])) {
             Dns_Zones::addDnsZone($id, $params['dnsform']['subdomain'], $params['dnsform']['target'], $params['dnsform']['zones']);
         }
         // Save the message note
         if (!empty($params['note'])) {
             Messages::addMessage($params['note'], $this->customer['customer_id'], $id);
             $isp = Shineisp_Registry::get('ISP');
             $placeholder['fullname'] = $this->customer['firstname'] . " " . $this->customer['lastname'];
             $placeholder['domain'] = domains::getDomainName($id);
             $placeholder['message'] = $params['note'];
             $placeholder['messagetype'] = $this->translator->translate('Domain');
             Messages::sendMessage("message_new", $this->customer['email'], $placeholder);
             Messages::sendMessage("message_admin", $isp->email, $placeholder);
         }
         Domains::setAuthInfo($id, $params['authinfocode']);
         Domains::setAutorenew($id, $params['autorenew']);
         $this->_helper->redirector('edit', 'domains', 'default', array('id' => $id, 'mex' => 'The task requested has been executed successfully.', 'status' => 'success'));
     } catch (Exception $e) {
         die($e->getMessage());
     }
 }
示例#2
0
 /**
  * processAction
  * Update the record previously selected
  * @return unknown_type
  */
 public function processAction()
 {
     $request = $this->getRequest();
     // Check if we have a POST request
     if (!$request->isPost()) {
         return $this->_helper->redirector('index');
     }
     // Get our form and validate it
     $form = $this->getForm('/admin/domains/process');
     if (!$form->isValid($request->getPost())) {
         // Invalid entries
         $this->view->form = $form;
         $this->view->title = $this->translator->translate("Domain process task");
         $this->view->description = $this->translator->translate("Here you have to fix the domain parameters set.");
         return $this->render('applicantform');
         // re-render the login form
     }
     // Get the values posted
     $params = $form->getValues();
     // Get the id
     $id = $this->getRequest()->getParam('domain_id');
     // Create the buttons in the edit form
     $this->view->buttons = array(array("url" => "#", "label" => $this->translator->translate('Save'), "params" => array('css' => null, 'id' => 'submit')), array("url" => "/admin/domains/list", "label" => $this->translator->translate('List'), "params" => array('css' => null, 'id' => 'submit')), array("url" => "/admin/domains/new/", "label" => $this->translator->translate('New'), "params" => array('css' => null)));
     try {
         $id = Domains::saveAll($id, $params);
         Domains::saveDnsZones($id, $params);
         Domains::setAutorenew($id, $params['autorenew'] == 0 ? false : true);
         DomainsNichandle::setNicHandles($id, $params['owner'], $params['admin'], $params['tech'], $params['billing']);
         // If the domain status has been set as active
         // the registrar task record will be set as completed
         if ($params['status_id'] == Statuses::id("active", 'domains')) {
             DomainsTasks::setStatusTask($id, Statuses::id("complete", 'domains_tasks'));
             // Complete
         }
         // Save the message note
         if (!empty($params['message'])) {
             $message = new Messages();
             $message->dateposted = date('Y-m-d H:i:s');
             $message->message = $params['message'];
             $message->isp_id = 1;
             $message->domain_id = $id;
             $message->save();
         }
         $this->_helper->redirector('edit', 'domains', 'admin', array('id' => $id, 'mex' => 'The task requested has been executed successfully.', 'status' => 'success'));
     } catch (Exception $e) {
         $this->_helper->redirector('list', 'domains', 'admin', array('mex' => $e->getMessage(), 'status' => 'danger'));
     }
 }