Merge pull request #811 from Scavy/patch-1

Patch to include GratisDNS as dynDNS service
This commit is contained in:
Renato Botelho 2013-09-27 04:58:02 -07:00
commit bab13e1f72
2 changed files with 34 additions and 4 deletions

View File

@ -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) {

View File

@ -38,8 +38,8 @@
pfSense_MODULE: utils
*/
define('DYNDNS_PROVIDER_VALUES', 'dnsomatic dyndns dyndns-static dyndns-custom dhs dyns easydns noip noip-free ods zoneedit loopia freedns dnsexit opendns namecheap he-net he-net-v6 he-net-tunnelbroker selfhost route53 cloudflare custom custom-v6 eurodns');
define('DYNDNS_PROVIDER_DESCRIPTIONS', 'DNS-O-Matic,DynDNS (dynamic),DynDNS (static),DynDNS (custom),DHS,DyNS,easyDNS,No-IP,No-IP (free),ODS.org,ZoneEdit,Loopia,freeDNS,DNSexit,OpenDNS,Namecheap,HE.net,HE.net (v6),HE.net Tunnelbroker,SelfHost,Route 53,CloudFlare,Custom,Custom (v6),Euro Dns');
define('DYNDNS_PROVIDER_VALUES', 'dnsomatic dyndns dyndns-static dyndns-custom dhs dyns easydns noip noip-free ods zoneedit loopia freedns dnsexit opendns namecheap he-net he-net-v6 he-net-tunnelbroker selfhost route53 cloudflare custom custom-v6 eurodns gratisdns');
define('DYNDNS_PROVIDER_DESCRIPTIONS', 'DNS-O-Matic,DynDNS (dynamic),DynDNS (static),DynDNS (custom),DHS,DyNS,easyDNS,No-IP,No-IP (free),ODS.org,ZoneEdit,Loopia,freeDNS,DNSexit,OpenDNS,Namecheap,HE.net,HE.net (v6),HE.net Tunnelbroker,SelfHost,Route 53,CloudFlare,Custom,Custom (v6),Euro Dns,GratisDNS');
/* implement ipv6 route advertising deamon */
function services_radvd_configure() {