summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorjim-p <jim@pingle.org>2010-08-30 23:40:17 -0400
committerjim-p <jim@pingle.org>2010-08-30 23:40:17 -0400
commit61c30081675657a9eb76b309cde2b75eeb5d5511 (patch)
tree7b7174107004b06ede2b61571180844f8117c6b0 /etc
parent2f384448b09eb135e44d7881e93e0798b3009eec (diff)
downloadpfsense-61c30081675657a9eb76b309cde2b75eeb5d5511.zip
pfsense-61c30081675657a9eb76b309cde2b75eeb5d5511.tar.gz
First try at a dyndns update type for Namecheap.com servers.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/dyndns.class28
1 files changed, 28 insertions, 0 deletions
diff --git a/etc/inc/dyndns.class b/etc/inc/dyndns.class
index 2e90386..0168d3e 100644
--- a/etc/inc/dyndns.class
+++ b/etc/inc/dyndns.class
@@ -17,6 +17,7 @@
* - StaticCling (staticcling.org)
* - DNSexit (dnsexit.com)
* - OpenDNS (opendns.com)
+ * - Namecheap (namecheap.com)
* +----------------------------------------------------+
* Requirements:
* - PHP version 4.0.2 or higher with CURL Library
@@ -148,6 +149,7 @@
case 'staticcling':
case 'dnsexit':
case 'opendns':
+ case 'namecheap':
$this->_update();
break;
default:
@@ -416,6 +418,20 @@
curl_close($ch);
$this->_checkStatus($data);
break;
+ case 'namecheap':
+ /* Example:
+ https://dynamicdns.park-your-domain.com/update?host=[host_name]&domain=[domain.com]&password=[domain_password]&ip=[your_ip]
+ */
+ $needsIP = FALSE;
+ log_error("Namecheap: DNS update() starting.");
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
+ list($hostname, $domain) = explode(".", $this->_dnsHost, 2);
+ $server = "https://dynamicdns.park-your-domain.com/update?host={$hostname}&domain={$domain}&password={$this->_dnsPass}&ip={$this->_dnsIP}";
+ curl_setopt($ch, CURLOPT_URL, $server);
+ $data = curl_exec($ch);
+ if (@curl_error($ch)) log_error("Curl error occurred: " . curl_error($ch));
+ curl_close($ch);
+ $this->_checkStatus($data);
default:
break;
}
@@ -719,6 +735,18 @@
$this->_debug($data);
}
break;
+ case 'namecheap':
+ if (preg_match("/internal server error/i", $data)) {
+ $status = "phpDynDNS: (Error) Server side error.";
+ } else if (preg_match('/success/i', $data)) {
+ $status = "phpDynDNS: (Success) IP Address Updated Successfully!";
+ $successful_update = true;
+ } else {
+ $status = "phpDynDNS: (Unknown Response)";
+ log_error("phpDynDNS: PAYLOAD: {$data}");
+ $this->_debug($data);
+ }
+ break;
}
if($successful_update == true) {
OpenPOWER on IntegriCloud