Commit a2b2f398 authored by Scott's avatar Scott
Browse files

Add support for domain periods.



Signed-off-by: Scott's avatarScott Barr <scott@barr.co.za>
parent eb6a8cad
......@@ -491,11 +491,19 @@ function zacr_RegisterDomain($params) {
<domain:ns>'.$add_hosts.'</domain:ns>
<domain:registrant>'.$contactid.'</domain:registrant>';
# Some SLDs require the presence of admin, billing and tech contacts.
# Check if our domain has the requirement and get/create the required contact id.
$_server = _zacr_SldLookup($domain);
if ($_server['additional_contacts']) {
# Some SLDs support longer registration periods.
# Check if our domain meets the requirements and add the
# WHMCS selected period to the request.
if ($_server['domain_periods']) {
$domaincreate .= '
<domain:period unit="y">'.$regperiod.'</domain:period>';
}
# Some SLDs require the presence of admin, billing and tech contacts.
# Check if our domain has the requirement and get/create the required contact id.
if ($_server['additional_contacts']) {
$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:contact="urn:ietf:params:xml:ns:contact-1.0" xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">
......@@ -764,23 +772,36 @@ function zacr_RenewDomain($params) {
}
# Send request to renew
$request = $client->request($xml = '
$domainrenew = '
<epp:epp xmlns:epp="urn:ietf:params:xml:ns:epp-1.0" xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<epp:command>
<epp:renew>
<domain:renew>
<domain:name>'.$domain.'</domain:name>
<domain:curExpDate>'.$expdate.'</domain:curExpDate>
<domain:curExpDate>'.$expdate.'</domain:curExpDate>';
$_server = _zacr_SldLookup($domain);
# Some SLDs support longer registration periods.
# Check if our domain meets the requirements and add the
# WHMCS selected period to the request.
if ($_server['domain_periods']) {
$domainrenew .= '
<domain:period unit="y">'.$regperiod.'</domain:period>';
}
$domainrenew .= '
</domain:renew>
</epp:renew>
</epp:command>
</epp:epp>
');
</epp:epp>';
$request = $client->request($domainrenew);
# Parse XML result
$doc= new DOMDocument();
$doc->loadXML($request);
logModuleCall('ZACR', 'RenewDomain', $xml, $request);
logModuleCall('ZACR', 'RenewDomain', $domainrenew, $request);
$coderes = $doc->getElementsByTagName('result')->item(0)->getAttribute('code');
$msg = $doc->getElementsByTagName('msg')->item(0)->nodeValue;
......@@ -1362,22 +1383,26 @@ function _zacr_SldLookup($domain) {
'co.za' => array(
'fqdn' => 'epp.coza.net.za',
'port' => 3121,
'additional_contacts' => false
'additional_contacts' => false,
'domain_periods' => false
),
'org.za' => array(
'fqdn' => 'org-epp.registry.net.za',
'port' => 3121,
'additional_contacts' => true
'additional_contacts' => true,
'domain_periods' => true
),
'web.za' => array(
'fqdn' => 'web-epp.registry.net.za',
'port' => 3121,
'additional_contacts' => true
'additional_contacts' => true,
'domain_periods' => true
),
'net.za' => array(
'fqdn' => 'net-epp.registry.net.za',
'port' => 3121,
'additional_contacts' => true
'additional_contacts' => true,
'domain_periods' => true
),
);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment