diff --git a/modules/registrars/cozaepp/cozaepp.php b/modules/registrars/cozaepp/cozaepp.php index c06e3491602ecf4e15801fdcebd68d6584d81892..534e17d0999f3942aa4c6065201481997cd9f10f 100644 --- a/modules/registrars/cozaepp/cozaepp.php +++ b/modules/registrars/cozaepp/cozaepp.php @@ -734,25 +734,43 @@ function cozaepp_GetContactDetails($params) { 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; + $results["Registrant"]["Contact Name"] = $childNodes->getElementsByTagName('name')->item(0)->nodeValue; + $results["Registrant"]["Organisation"] = $childNodes->getElementsByTagName('org')->item(0)->nodeValue; + $results["Registrant"]["Address line 1"] = $childNodes->getElementsByTagName('street')->item(0)->nodeValue; + $results["Registrant"]["Address line 2"] = $childNodes->getElementsByTagName('street')->item(1)->nodeValue; + $results["Registrant"]["TownCity"] = $childNodes->getElementsByTagName('city')->item(0)->nodeValue; + $results["Registrant"]["State"] = $childNodes->getElementsByTagName('sp')->item(0)->nodeValue; + $results["Registrant"]["Zip code"] = $childNodes->getElementsByTagName('pc')->item(0)->nodeValue; + $results["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; + $results["Registrant"]["Phone"] = $doc->getElementsByTagName('voice')->item(0)->nodeValue; + $results["Registrant"]["Email"] = $doc->getElementsByTagName('email')->item(0)->nodeValue; } catch (Exception $e) { $values["error"] = 'GetContactDetails/EPP: '.$e->getMessage(); return $values; } + + # What we going to do here is make sure all the attirbutes we return back are set + # If we don't do this WHMCS won't display the options for editing + foreach ( + array("Contact Name","Organisation","Address line 1","Address line 2","TownCity","State","Zip code","Country Code","Phone","Email") + as $item + ) { + # Check if the item is set + if ($results["Registrant"][$item] == "") { + # Just set it to - + $values["Registrant"][$item] = "-"; + } else { + # We setting this here so we maintain the right order, else we get the set + # things first and all the unsets second, which looks crap + $values["Registrant"][$item] = $results["Registrant"][$item]; + } + } + return $values; }