Example #1
0
 public function updateAction()
 {
     $domain_id = $this->getRequest()->getParam('id');
     if (is_numeric($domain_id)) {
         try {
             $record = $this->domains->find($domain_id, "d.domain as domain, d.tld as tld, d.authinfocode, cdr.customer_id as customer_id, cdr.value as nichandle", true);
             if (is_array($record[0])) {
                 $product = Domains::findProduct($domain_id, 'domain_id');
                 $domain = $record[0]['domain'] . "." . $record[0]['tld'];
                 $domain_id = $record[0]['domain_id'];
                 $retval = DomainsTasks::AddTask($domain, 'update');
                 if ($retval) {
                     $this->_helper->redirector('edit', 'domains', 'admin', array('id' => $domain_id, 'mex' => 'Domain task added to queue.', 'status' => 'success'));
                 } else {
                     $this->_helper->redirector('edit', 'domains', 'admin', array('id' => $domain_id, 'mex' => 'Domain task has been not added to the queue.', 'status' => 'danger'));
                 }
             }
         } catch (Exception $e) {
             $this->_helper->redirector('edit', 'domains', 'admin', array('id' => $domain_id, 'mex' => $e->getMessage(), 'status' => 'danger'));
         }
         $this->_helper->redirector('index', 'domains');
     }
 }