summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-08-31 14:47:00 -0400
committerjim-p <jimp@pfsense.org>2010-08-31 14:47:00 -0400
commit18f15f68384e87d2b7485ab18f3a7381823432ad (patch)
treed6862afd76e5d421b5f75fa5e62879f4f69e1252
parentc48ddff20ecebbbdc26594325b7e9a7005732512 (diff)
downloadpfsense-18f15f68384e87d2b7485ab18f3a7381823432ad.zip
pfsense-18f15f68384e87d2b7485ab18f3a7381823432ad.tar.gz
Improve Namecheap DynDNS update response parsing.
-rw-r--r--etc/inc/dyndns.class9
1 files changed, 6 insertions, 3 deletions
diff --git a/etc/inc/dyndns.class b/etc/inc/dyndns.class
index cb0420e..59738a3 100644
--- a/etc/inc/dyndns.class
+++ b/etc/inc/dyndns.class
@@ -48,6 +48,7 @@
* StaticCling - Last Tested: 27 April 2006
* DNSexit - Last Tested: 20 July 2008
* OpenDNS - Last Tested: 4 August 2008
+ * Namecheap - Last Tested: 31 August 2010
* +====================================================+
*
* @author E.Kristensen
@@ -736,13 +737,15 @@
}
break;
case 'namecheap':
+ $tmp = str_replace("^M", "", $data);
+ $ncresponse = @xml2array($tmp);
if (preg_match("/internal server error/i", $data)) {
$status = "phpDynDNS: (Error) Server side error.";
- } else if (preg_match('/success/i', $data)) {
+ } else if ($ncresponse['interface-response']['ErrCount'] === "0") {
$status = "phpDynDNS: (Success) IP Address Updated Successfully!";
$successful_update = true;
- } else if (preg_match('/<Done>true<\/Done>/i', $data)) {
- $status = "phpDynDNS: (Success) IP Address Updated Successfully!";
+ } else if (is_numeric($ncresponse['interface-response']['ErrCount']) && ($ncresponse['interface-response']['ErrCount'] > 0)) {
+ $status = "phpDynDNS: (Error) " . implode(", ", $ncresponse["interface-response"]["errors"]);
$successful_update = true;
} else {
$status = "phpDynDNS: (Unknown Response)";
OpenPOWER on IntegriCloud