Skip to content
Snippets Groups Projects
Commit df96ab59 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Added missing TransferSync function

Now domain transfer notifications will be sent when a domain is
transferred to us.

Change-Id: I6ee63deecc0876220c84c7cc4ee0c146284bb70a
parent 95b57488
No related branches found
No related tags found
No related merge requests found
......@@ -1162,6 +1162,81 @@ function _cozaepp_Client() {
return $client;
}
function cozaepp_TransferSync($params) {
$domainid = $params['domainid'];
$domain = $params['domain'];
$sld = $params['sld'];
$tld = $params['tld'];
$registrar = $params['registrar'];
$regperiod = $params['regperiod'];
$status = $params['status'];
$dnsmanagement = $params['dnsmanagement'];
$emailforwarding = $params['emailforwarding'];
$idprotection = $params['idprotection'];
# Other parameters used in your _getConfigArray() function would also be available for use in this function
# Grab domain info
try {
$client = _cozaepp_Client();
# Grab domain info
$request = $client->request($xml = '
<epp:epp xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">
<epp:command>
<epp:info>
<domain:info xsi:schemaLocation="urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd">
<domain:name hosts="all">'.$domain.'</domain:name>
</domain:info>
</epp:info>
</epp:command>
</epp:epp>
');
$doc= new DOMDocument();
$doc->loadXML($request);
logModuleCall('Cozaepp', 'TransferSync', $xml, $request);
$coderes = $doc->getElementsByTagName('result')->item(0)->getAttribute('code');
$msg = $doc->getElementsByTagName('msg')->item(0)->nodeValue;
# Check result
if($coderes != '1000') {
$values['error'] = "TransferSync/domain-info($domain): Code("._cozaepp_message($coderes).") $msg";
return $values;
}
# Check if we can get a status back
if($doc->getElementsByTagName('status')->item(0)) {
$statusres = $doc->getElementsByTagName('status')->item(0)->getAttribute('s');
$createdate = substr($doc->getElementsByTagName('crDate')->item(0)->nodeValue,0,10);
$nextduedate = substr($doc->getElementsByTagName('exDate')->item(0)->nodeValue,0,10);
} else {
$values['error'] = "TransferSync/domain-info($domain): Domain not found";
return $values;
}
$values['status'] = $msg;
# Check status and update
if ($statusres == "ok") {
$values['completed'] = true;
} else {
$values['error'] = "TransferSync/domain-info($domain): Unknown status code '$statusres' (File a bug report here: http://devlabs.linuxassist.net/projects/whmcs-coza-epp/issues/new)";
}
$values['expirydate'] = $nextduedate;
} catch (Exception $e) {
$values["error"] = 'TransferSync/EPP: '.$e->getMessage();
return $values;
}
return $values;
}
function cozaepp_Sync($params) {
$domainid = $params['domainid'];
$domain = $params['domain'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment