diff options
author | Scavy <svg@scavy.net> | 2013-09-27 11:29:50 +0200 |
---|---|---|
committer | Scavy <svg@scavy.net> | 2013-09-27 11:29:50 +0200 |
commit | 5458bc5944b475fb715290029b0b8688758d416c (patch) | |
tree | 3664852aae67df10e7459e857ed9b087c5462e43 /etc | |
parent | 97c78e19e673184a5c90a6b8482a4281466801b4 (diff) | |
download | pfsense-5458bc5944b475fb715290029b0b8688758d416c.zip pfsense-5458bc5944b475fb715290029b0b8688758d416c.tar.gz |
Update to include GratisDNS dynDNS service
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/dyndns.class | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/etc/inc/dyndns.class b/etc/inc/dyndns.class index 327478f..4a1a737 100644 --- a/etc/inc/dyndns.class +++ b/etc/inc/dyndns.class @@ -28,6 +28,7 @@ * - Custom DDNS IPv6 (any URL) * - CloudFlare (www.cloudflare.com) * - Eurodns (eurodns.com) + * - GratisDNS (gratisdns.dk) * +----------------------------------------------------+ * Requirements: * - PHP version 4.0.2 or higher with the CURL Library and the PCRE Library @@ -66,7 +67,8 @@ * Amazon Route 53 - Last tested: 01 April 2012 * DNS-O-Matic - Last Tested: 9 September 2010 * CloudFlare - Last Tested: 30 May 2013 - * Eurodns - Last Tested : 27 June 2013 + * Eurodns - Last Tested: 27 June 2013 + * GratisDNS - Last Tested: 15 August 2012 * +====================================================+ * * @author E.Kristensen @@ -233,6 +235,7 @@ case 'route53': case 'cloudflare': case 'eurodns': + case 'gratisdns': $this->_update(); if($this->_dnsDummyUpdateDone == true) { // If a dummy update was needed, then sleep a while and do the update again to put the proper address back. @@ -627,7 +630,16 @@ if($this->_dnsPort) $port = ":" . $this->_dnsPort; curl_setopt($ch, CURLOPT_URL, $server .$port . '?hostname=' . $this->_dnsHost . '&myip=' . $this->_dnsIP); - break; + break; + case 'gratisdns': + $needsIP = FALSE; + if ($this->_dnsVerboseLog) + log_error("GratisDNS.dk ({$this->_dnsHost}): DNS update() starting."); + $server = "https://ssl.gratisdns.dk/ddns.phtml"; + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); + list($hostname, $domain) = explode(".", $this->_dnsHost, 2); + curl_setopt($ch, CURLOPT_URL, $server . '?u=' . $this->_dnsUser . '&p=' . $this->_dnsPass . '&h=' . $this->_dnsHost . '&d=' . $domain); + break; default: break; } @@ -1101,6 +1113,24 @@ $this->_debug($data); } break; + case 'gratisdns': + if (preg_match('/Forkerte værdier/i', $data)) { + $status = "phpDynDNS: (Error) Wrong values - Update could not be completed."; + } else if (preg_match('/Bruger login: Bruger eksistere ikke/i', $data)) { + $status = "phpDynDNS: (Error) Unknown username - User does not exist."; + } else if (preg_match('/Bruger login: 1Fejl i kodeord/i', $data)) { + $status = "phpDynDNS: (Error) Wrong password - Remember password is case sensitive."; + } else if (preg_match('/Domæne kan IKKE administreres af bruger/i', $data)) { + $status = "phpDynDNS: (Error) User unable to administer the selected domain."; + } else if (preg_match('/OK/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) { |