diff --git a/modules/registrars/cozaepp/cozaepp.php b/modules/registrars/cozaepp/cozaepp.php index 280a25ff5b3e121bc7097adec994b755416eae38..44f0ff38c7516f35dfe751c659c13f72f6242820 100644 --- a/modules/registrars/cozaepp/cozaepp.php +++ b/modules/registrars/cozaepp/cozaepp.php @@ -730,15 +730,21 @@ function cozaepp_GetContactDetails($params) { return $values; } - # Setup return values - $values["Registrant"]["Contact Name"] = $doc->getElementsByTagName('name')->item(0)->nodeValue; - $values["Registrant"]["Organisation"] = $doc->getElementsByTagName('org')->item(0)->nodeValue; - $values["Registrant"]["Address line 1"] = $doc->getElementsByTagName('street')->item(0)->nodeValue; - $values["Registrant"]["Address line 2"] = $doc->getElementsByTagName('street')->item(1)->nodeValue; - $values["Registrant"]["TownCity"] = $doc->getElementsByTagName('city')->item(0)->nodeValue; - $values["Registrant"]["State"] = $doc->getElementsByTagName('sp')->item(0)->nodeValue; - $values["Registrant"]["Zip code"] = $doc->getElementsByTagName('pc')->item(0)->nodeValue; - $values["Registrant"]["Country Code"] = $doc->getElementsByTagName('cc')->item(0)->nodeValue; + $nodes = $doc->getElementsByTagName('postalInfo'); + for ($i = 0; ($i < $nodes->length); $i++) { + if ($nodes->item($i)->getAttributeNode('type')->nodeValue == 'loc') { + $childNodes = $nodes->item($i); + $values["Registrant"]["Contact Name"] = $childNodes->getElementsByTagName('name')->item(0)->nodeValue; + $values["Registrant"]["Organisation"] = $childNodes->getElementsByTagName('org')->item(0)->nodeValue; + $values["Registrant"]["Address line 1"] = $childNodes->getElementsByTagName('street')->item(0)->nodeValue; + $values["Registrant"]["Address line 2"] = $childNodes->getElementsByTagName('street')->item(1)->nodeValue; + $values["Registrant"]["TownCity"] = $childNodes->getElementsByTagName('city')->item(0)->nodeValue; + $values["Registrant"]["State"] = $childNodes->getElementsByTagName('sp')->item(0)->nodeValue; + $values["Registrant"]["Zip code"] = $childNodes->getElementsByTagName('pc')->item(0)->nodeValue; + $values["Registrant"]["Country Code"] = $childNodes->getElementsByTagName('cc')->item(0)->nodeValue; + } + } + $values["Registrant"]["Phone"] = $doc->getElementsByTagName('voice')->item(0)->nodeValue; $values["Registrant"]["Email"] = $doc->getElementsByTagName('email')->item(0)->nodeValue; @@ -747,7 +753,6 @@ function cozaepp_GetContactDetails($params) { return $values; } - return $values; } @@ -1122,7 +1127,7 @@ function _cozaepp_Client() { $use_ssl = true; } # Set certificate if we have one - if ($use_ssl && !empty($params['Certificate'])) { + if ($use_ssl && !empty($params['Certificate'])) { if (!file_exists($params['Certificate'])) { throw new Exception("System configuration error(3), please contact your provider"); }