catch (Exception $e) { Log::Log("Step4 thrown exception: {$e->getMessage()}", E_USER_WARNING); $errmsg = _("Your session has been expired"); $template_name = "client/domain_reg_step_1"; } } // Show form with contacts elseif ($post_step == 3) { $Registry = $RegistryModuleFactory->GetRegistryByExtension($_SESSION["domaininfo"]["extension"]); $registry_config = $Registry->GetManifest()->GetSectionConfig(); $RegistryContacts = UI::GetContactsListForSmarty($registry_config); $period = ($post_period) ? (int)$post_period : $_SESSION["domaininfo"]["period"]; if ($period > 0) { $_SESSION["domaininfo"]["period"] = $period; $display["TLD"] = $_SESSION["domaininfo"]["extension"]; $set_contacts = true; $_SESSION["wiz_period"] = true; $template_name = "client/domain_reg_step_3"; } else { $display["periods"] = array(); $min_period = (int)$registry_config->domain->registration->min_period;
$XPath = new DOMXPath($XMLNav->XML); $entries = $XPath->query('//node[@type = "tasks"]', $XMLNav->XML->documentElement); if ($entries && $entries->item(0)) { foreach ($entries as $node) { if ($node instanceof DOMElement) { $node->setAttribute("title", sprintf(_("Tasks for %s"), "{$_SESSION['domain']}.{$_SESSION['TLD']}")); } } } $entries = $XPath->query('//item[@type != ""]', $XMLNav->XML->documentElement); if ($entries && $entries->item(0)) { foreach ($entries as $node) { if ($node instanceof DOMElement) { $exists = false; $type = $node->getAttribute("type"); foreach (UI::GetContactsListForSmarty($Registry->Manifest->GetSectionConfig()) as $ck => $cv) { if ($cv["type"] == $type) { $exists = true; } } if (!$exists) { $node->parentNode->removeChild($node); } } } } } // Language Node if (count($display["languages"]) > 1) { // // Add languages to menu
/** * Enter description here... */ public function Render() { $this->rendered_data = array(); $Manifest = $this->Registry->GetManifest(); $section_shared_contacts = (bool) $Manifest->GetRegistryOptions()->ability->section_shared_contacts; $contacts_config = UI::GetContactsListForSmarty($Manifest->GetSectionConfig()); $DbContact = DBContact::GetInstance(); foreach ($contacts_config as $v) { $smarty_contact = $v; $smarty_contact["groupname"] = $Manifest->GetGroupNameByContactType($v["type"]); if (!$section_shared_contacts) { $section_name = $Manifest->GetSectionName(); $target_index = $Manifest->GetContactTargetIndex($this->tld, $smarty_contact["groupname"]); $smarty_contact['target_title'] = $Manifest->GetContactTargetTitle($this->tld, $smarty_contact["groupname"]); } else { $section_name = ""; $target_index = 0; $smarty_contact['target_title'] = $this->Registry->GetModuleName(); } // Calculate contact num in group $num_items = (int) $this->Db->GetOne("\r\n \t\tSELECT COUNT(clid) FROM contacts \r\n \t\tWHERE userid=? AND \r\n \t\t(TLD = ? OR (module_name=? AND section_name=? AND target_index=?)) AND \r\n \t\tgroupname=?", array($this->userid, $this->tld, $this->Registry->GetModuleName(), $section_name, $target_index, $smarty_contact["groupname"])); if ($num_items < self::MAX_ITEMS) { // Render simple contact select list $smarty_contact["exists"] = $this->Db->GetAll("\r\n\t \t\tSELECT clid FROM contacts \r\n\t \t\tWHERE userid=? AND \r\n\t \t\t(TLD = ? OR (module_name=? AND section_name=? AND target_index=?)) AND \r\n\t \t\tgroupname=? \r\n\t \t\tORDER BY id ASC", array($this->userid, $this->tld, $this->Registry->GetModuleName(), $section_name, $target_index, $smarty_contact["groupname"])); $DomainContact = null; if ($this->Domain) { $DomainContact = $this->Domain->GetContact($v["type"]); } $smarty_contact["disabled"] = array(); foreach ($smarty_contact["exists"] as &$c) { try { $Contact = $DbContact->LoadByCLID($c["clid"]); $smarty_contact["disabled"][$c["clid"]] = count($Contact->GetPendingOperationList()); $c['title'] = $Contact->GetTitle(); // Check selected if ($DomainContact && $DomainContact->CLID == $c["clid"]) { $c["selected"] = true; $smarty_contact['selected'] = $c['clid']; } } catch (Exception $e) { Log::Log($e->getMessage(), E_USER_ERROR); unset($c); continue; } catch (ErrorList $e) { Log::Log(join('; ', $e->GetAllMessages()), E_USER_ERROR); unset($c); continue; } } $smarty_contact['list'] = array(); foreach ($smarty_contact['exists'] as $ex) { $smarty_contact['list'][$ex['clid']] = $ex['title']; } } else { // External contact select $smarty_contact['too_many_items'] = true; } $this->rendered_data['contacts'][] = $smarty_contact; } $this->rendered_data['tld'] = $this->tld; $this->rendered_data['form_title'] = $this->form_title; $this->rendered_data['button_text'] = $this->button_text; $this->rendered_data['form_action'] = $this->form_action; $this->rendered_data['form_method'] = $this->form_method; $this->rendered_data['form_fields'] = $this->form_fields; }
$Contact = $Domain->GetContact($req_c); // Create Module object try { $Registry = $RegistryModuleFactory->GetRegistryByExtension($Domain->Extension); if ($Registry) $Manifest = $Registry->GetManifest(); } catch(Exception $e) { $errmsg = $e->getMessage(); } $RegistryContacts = UI::GetContactsListForSmarty($Registry->GetManifest()->GetSectionConfig()); foreach($RegistryContacts as $k=>$v) if ($v["type"] == $req_c) { $cinfo = $v; break; } $display["title"] = sprintf(_("Edit %s contact for %s"), strtolower($cinfo["name"]), $Domain->GetHostName()); $section_config = $Registry->GetManifest()->GetSectionConfig(); $res = $section_config->xpath("contacts/contact[@type='{$req_c}']"); $display["is_optional"] = !(bool)(int)$res[0]->attributes()->required;
// Check invoice $invoice = $db->GetRow("SELECT * FROM invoices WHERE itemid=? AND status='1' AND purpose=?", array($Domain->ID, INVOICE_PURPOSE::DOMAIN_TRANSFER)); if (!$invoice) { $errmsg = _("No corresponding invoice found for this domain"); CoreUtils::Redirect("domains_view.php"); } } else { $errmsg = _("Domain status not allow complete transfer"); CoreUtils::Redirect("domains_view.php"); } $display["fields"] = UI::GetTransferExtraFieldsForSmarty($Manifest->GetSectionConfig()); $RegistryContacts = UI::GetContactsListForSmarty($Manifest->GetSectionConfig(), true); $transfer_contacts = UI::GetTransferContactsForSmarty($Manifest->GetSectionConfig()); $section_shared_contacts = (bool)$Manifest->GetRegistryOptions()->ability->section_shared_contacts; $DbContact = DBContact::GetInstance(); if ($transfer_contacts) { $display["contacts"] = array(); foreach ($transfer_contacts as $v) { foreach ($RegistryContacts as $kk=>$vv) { if ($vv["type"] == $v) { $smarty_contact = $vv;
public static function ValidateCLIDList($clid_list, $Registry) { $ErrList = new ErrorList(); $registry_config = $Registry->GetManifest()->GetSectionConfig(); $RegistryContacts = UI::GetContactsListForSmarty($registry_config); foreach ($RegistryContacts as $k => $v) { if (!$clid_list[$v['type']] && $v["isrequired"] == 1) { $ErrList->AddMessage(sprintf(_("%s contact not specified"), $v["name"])); } } return $ErrList; }