diff --git a/modules/registrars/cozaepp/cozaepp.php b/modules/registrars/cozaepp/cozaepp.php index 53b0cf97bfd9e110305b1b9856421df0211905c8..1abd47d616efb5b437eddc0f5e5b9285206a5825 100644 --- a/modules/registrars/cozaepp/cozaepp.php +++ b/modules/registrars/cozaepp/cozaepp.php @@ -279,77 +279,6 @@ function cozaepp_SaveRegistrarLock($params) { return $values; } -# Function to retrieve an available contact id -function _cozaepp_CheckContact($prehash) { - $prehash = $prehash . time() . rand(0, 1000000); - $contactid = substr(md5($prehash), 0,15); - - # Get client instance and check for available contact id - try { - $client = _cozaepp_Client(); - - $contactAvailable = 0; - $count = 0; - - while ($contactAvailable == 0) { - - # Check if contact exists - $request = $client->request($xml = ' - <epp xmlns="urn:ietf:params:xml:ns:epp-1.0"> - <command> - <check> - <contact:check - xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> - <contact:id>'.$contactid.'</contact:id> - </contact:check> - </check> - </command> - </epp> - '); - - # Parse XML result - $doc= new DOMDocument(); - $doc->loadXML($request); - logModuleCall('Cozaepp', 'RegisterDomain:CheckContact', $xml, $request); - - # Pull off status - $coderes = $doc->getElementsByTagName('result')->item(0)->getAttribute('code'); - $contactAvailable = $doc->getElementsByTagName('id')->item(0)->getAttribute('avail'); - $msg = $doc->getElementsByTagName('msg')->item(0)->nodeValue; - if($coderes == '1000') { - $values['contact'] = 'Contact Created'; - } else if($coderes == '2302') { - $values['contact'] = 'Contact Already exists'; - } else if($coderes == '2201') { - $values['contact'] = 'Contact Already exists and is not owned by you'; - } else { - $values["error"] = "RegisterDomain/contact-check($contactid): Code ($coderes) $msg"; - return $values; - } - - $values["status"] = $msg; - - # if contact still isn't available attempt to add a random time again rehash and return - if ($contactAvailable == 0) { - $contactAvailable = substr(md5($prehash . time() . rand(0, 1000000) . $count), 0,15); - } - - if ($count >= 10) { - break; - } - - $count++; - } - - return $contactid; - - } catch (Exception $e) { - $values["error"] = 'RegisterDomain/EPP: '.$e->getMessage(); - return $values; - } - -} - # Function to register domain function cozaepp_RegisterDomain($params) { # Grab varaibles @@ -380,8 +309,7 @@ function cozaepp_RegisterDomain($params) { $AdminEmailAddress = $params["adminemail"]; $AdminPhone = $params["adminphonenumber"]; # Our details - $contactid = _cozaepp_CheckContact($sld . '.' . $tld); - + $contactid = substr(md5($sld . '.' . $tld), 0,15); # Generate XML for namseverss if ($nameserver1 = $params["ns1"]) { @@ -554,7 +482,7 @@ function cozaepp_TransferDomain($params) { $AdminEmailAddress = $params["adminemail"]; $AdminPhone = $params["adminphonenumber"]; # Our details - $contactid = _cozaepp_CheckContact($sld . '.' . $tld); + $contactid = substr(md5($sld . '.' . $tld), 0,15); # Get client instance try {