Skip to content
Snippets Groups Projects
Commit 71e8eb20 authored by Scott's avatar Scott
Browse files

Added the WHMCS logModuleCall at EPP requests for some debugging info


Signed-off-by: default avatarScott Barr <scott@barr.co.za>
Change-Id: I12e3cbdc296c932ad0aa11fe09fcf508980f82f1
parent 6cfff6d2
No related branches found
No related tags found
No related merge requests found
......@@ -68,7 +68,7 @@ function cozaepp_GetNameservers($params) {
}
# Get list of nameservers for domain
$result = $client->request('
$result = $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>
......@@ -83,6 +83,8 @@ function cozaepp_GetNameservers($params) {
$doc = new DOMDocument();
$doc->preserveWhiteSpace = false;
$doc->loadXML($result);
logModuleCall('Cozaepp', 'GetNameservers', $xml, $result);
# Pull off status
$coderes = $doc->getElementsByTagName('result')->item(0)->getAttribute('code');
$msg = $doc->getElementsByTagName('msg')->item(0)->nodeValue;
......@@ -195,7 +197,7 @@ function cozaepp_SaveNameservers($params) {
}
# Build request
$request = $client->request('
$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" xmlns:cozadomain="http://co.za/epp/extensions/cozadomain-1-0"
xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">
......@@ -222,6 +224,8 @@ function cozaepp_SaveNameservers($params) {
# Parse XML result
$doc= new DOMDocument();
$doc->loadXML($request);
logModuleCall('Cozaepp', 'SaveNameservers', $xml, $request);
# Pull off status
$coderes = $doc->getElementsByTagName('result')->item(0)->getAttribute('code');
$msg = $doc->getElementsByTagName('msg')->item(0)->nodeValue;
......@@ -388,7 +392,7 @@ function cozaepp_RegisterDomain($params) {
$values["status"] = $msg;
$request = $client->request('
$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" xmlns:cozadomain="http://co.za/epp/extensions/cozadomain-1-0"
xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">
......@@ -413,6 +417,8 @@ function cozaepp_RegisterDomain($params) {
');
$doc= new DOMDocument();
$doc->loadXML($request);
logModuleCall('Cozaepp', 'RegisterDomain', $xml, $request);
$coderes = $doc->getElementsByTagName('result')->item(0)->getAttribute('code');
$msg = $doc->getElementsByTagName('msg')->item(0)->nodeValue;
if($coderes != '1000') {
......@@ -498,7 +504,7 @@ function cozaepp_TransferDomain($params) {
$values["status"] = $msg;
# Create contact details
$request = $client->request('
$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">
<epp:command>
......@@ -530,6 +536,8 @@ function cozaepp_TransferDomain($params) {
# Parse XML result
$doc= new DOMDocument();
$doc->loadXML($request);
logModuleCall('Cozaepp', 'TransferDomain', $xml, $request);
$coderes = $doc->getElementsByTagName('result')->item(0)->getAttribute('code');
$msg = $doc->getElementsByTagName('msg')->item(0)->nodeValue;
if($coderes == '1000') {
......@@ -599,7 +607,7 @@ function cozaepp_RenewDomain($params) {
}
# Send request to renew
$request = $client->request('
$request = $client->request($xml = '
<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>
......@@ -615,6 +623,8 @@ function cozaepp_RenewDomain($params) {
# Parse XML result
$doc= new DOMDocument();
$doc->loadXML($request);
logModuleCall('Cozaepp', 'RenewDomain', $xml, $request);
$coderes = $doc->getElementsByTagName('result')->item(0)->getAttribute('code');
$msg = $doc->getElementsByTagName('msg')->item(0)->nodeValue;
if($coderes != '1000') {
......@@ -677,7 +687,7 @@ function cozaepp_GetContactDetails($params) {
}
# Grab contact info
$request = $client->request('
$request = $client->request($xml = '
<epp:epp xmlns:epp="urn:ietf:params:xml:ns:epp-1.0" xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
<epp:command>
<epp:info>
......@@ -691,6 +701,8 @@ function cozaepp_GetContactDetails($params) {
# Parse XML result
$doc= new DOMDocument();
$doc->loadXML($request);
logModuleCall('Cozaepp', 'GetContactDetails', $xml, $request);
$coderes = $doc->getElementsByTagName('result')->item(0)->getAttribute('code');
$msg = $doc->getElementsByTagName('msg')->item(0)->nodeValue;
# Check result
......@@ -803,6 +815,8 @@ function cozaepp_SaveContactDetails($params) {
# Parse XML result
$doc= new DOMDocument();
$doc->loadXML($request);
logModuleCall('Cozaepp', 'SaveContactDetails', $xml, $request);
$coderes = $doc->getElementsByTagName('result')->item(0)->getAttribute('code');
$msg = $doc->getElementsByTagName('msg')->item(0)->nodeValue;
if($coderes != '1001') {
......@@ -1084,7 +1098,7 @@ function _cozaepp_Client() {
}
# Perform login
$request = $client->request('
$request = $client->request($xml = '
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<login>
......@@ -1102,6 +1116,7 @@ function _cozaepp_Client() {
</command>
</epp>
');
logModuleCall('Cozaepp', 'Connect', $xml, $request);
return $client;
}
......
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