Added DynDNS support for GleSYS API (www.glesys.com).

This commit is contained in:
McB 2015-02-03 20:17:24 +01:00
parent e829fcbb91
commit 197cf4331e
3 changed files with 33 additions and 6 deletions

View File

@ -30,6 +30,7 @@
* - Eurodns (eurodns.com)
* - GratisDNS (gratisdns.dk)
* - City Network (citynetwork.se)
* - GleSYS (glesys.com)
* +----------------------------------------------------+
* Requirements:
* - PHP version 4.0.2 or higher with the CURL Library and the PCRE Library
@ -72,6 +73,7 @@
* GratisDNS - Last Tested: 15 August 2012
* OVH DynHOST - Last Tested: NEVER
* City Network - Last Tested: 13 November 2013
* GleSYS - Last Tested: 3 February 2015
* +====================================================+
*
* @author E.Kristensen
@ -211,6 +213,7 @@
$this->_error(10);
} else {
switch ($this->_dnsService) {
case 'glesys':
case 'dnsomatic':
case 'dyndns':
case 'dyndns-static':
@ -279,6 +282,17 @@
}
switch ($this->_dnsService) {
case 'glesys':
$needsIP = TRUE;
if ($this->_dnsVerboseLog)
log_error("DynDNS: ({$this->_dnsHost}) DNS update() starting.");
$server = 'https://api.glesys.com/domain/updaterecord/format/json';
curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass);
$post_data['recordid'] = $this->_dnsHost;
$post_data['data'] = $this->_dnsIP;
curl_setopt($ch, CURLOPT_URL, $server);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
break;
case 'dyndns':
case 'dyndns-static':
case 'dyndns-custom':
@ -683,6 +697,16 @@
return;
}
switch ($this->_dnsService) {
case 'glesys':
if (preg_match('/Record updated/i', $data)) {
$status = "GleSYS ({$this->_dnsHost}): (Success) IP Address Changed Successfully! (".$this->_dnsIP.")";
$successful_update = true;
} else {
$status = "GleSYS ({$this->_dnsHost}): (Unknown Response)";
log_error("GleSYS ({$this->_dnsHost}): PAYLOAD: {$data}");
$this->_debug($data);
}
break;
case 'dnsomatic':
if (preg_match('/badauth/i', $data)) {
$status = "DNS-O-Matic ({$this->_dnsHost}): The DNS-O-Matic username or password specified are incorrect. No updates will be distributed to services until this is resolved.";

View File

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

View File

@ -319,7 +319,8 @@ function _onTypeChange(type){
<span class="red"><strong><?=gettext("Note:");?><br /></strong>
</span>
<?=gettext("Enter the complete host/domain name. example: myhost.dyndns.org");?><br />
<?=gettext("For he.net tunnelbroker, enter your tunnel ID");?>
<?=gettext("he.net tunnelbroker: Enter your tunnel ID");?><br />
<?=gettext("GleSYS: Enter your record ID");?>
</span>
</td>
</tr>
@ -359,8 +360,9 @@ function _onTypeChange(type){
<td width="78%" class="vtable">
<input name="username" type="text" class="formfld user" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>" />
<br /><?= gettext("Username is required for all types except Namecheap, FreeDNS and Custom Entries.");?>
<br /><?= gettext("Route 53: Enter your Access Key ID.");?>
<br /><?= gettext("For Custom Entries, Username and Password represent HTTP Authentication username and passwords.");?>
<br /><?= gettext("Route 53: Enter your Access Key ID.");?>
<br /><?= gettext("GleSYS: Enter your API user.");?>
<br /><?= gettext("For Custom Entries, Username and Password represent HTTP Authentication username and passwords.");?>
</td>
</tr>
<tr>
@ -369,7 +371,8 @@ function _onTypeChange(type){
<input name="password" type="password" class="formfld pwd" id="password" size="20" value="<?=htmlspecialchars($pconfig['password']);?>" />
<br />
<?=gettext("FreeDNS (freedns.afraid.org): Enter your \"Authentication Token\" provided by FreeDNS.");?>
<br /><?= gettext("Route 53: Enter your Secret Access Key.");?>
<br /><?= gettext("Route 53: Enter your Secret Access Key.");?>
<br /><?= gettext("GleSYS: Enter your API key.");?>
</td>
</tr>