diff options
author | Steve Beaver <sbeaver@netgate.com> | 2016-11-21 11:46:45 -0500 |
---|---|---|
committer | Steve Beaver <sbeaver@netgate.com> | 2016-11-21 11:47:45 -0500 |
commit | a7391526c83a8d4b33e81d730141a4811ae8d482 (patch) | |
tree | bffee02231e7dd3d6aad681f10219ab8b475b01a /src/usr/local/www/widgets | |
parent | f6973634c34b34908644e2df17154274d2ab12be (diff) | |
download | pfsense-a7391526c83a8d4b33e81d730141a4811ae8d482.zip pfsense-a7391526c83a8d4b33e81d730141a4811ae8d482.tar.gz |
Fixed #6922
Added code for IPv6 Dynamic DNS
Diffstat (limited to 'src/usr/local/www/widgets')
-rw-r--r-- | src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php b/src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php index b242556..cbbb005 100644 --- a/src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php +++ b/src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php @@ -96,21 +96,33 @@ if ($_REQUEST['getdyndnsstatus']) { } $filename = "{$g['conf_path']}/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($hostname) . "{$dyndns['id']}.cache"; + $filename_v6 = "{$g['conf_path']}/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($hostname) . "{$dyndns['id']}_v6.cache"; if (file_exists($filename)) { - if (($dyndns['type'] == '_rfc2136_') && (!isset($dyndns['usepublicip']))) { - $ipaddr = get_interface_ip(get_failover_interface($dyndns['interface'])); - } else { - $ipaddr = dyndnsCheckIP($dyndns['interface']); - } - $cached_ip_s = explode($cache_sep, file_get_contents($filename)); + $ipaddr = dyndnsCheckIP($dyndns['interface']); + $cached_ip_s = explode(":", file_get_contents($filename)); $cached_ip = $cached_ip_s[0]; - if (trim($ipaddr) != trim($cached_ip)) { + + if ($ipaddr != $cached_ip) { print('<span class="text-danger">'); } else { print('<span class="text-success">'); } + print(htmlspecialchars($cached_ip)); print('</span>'); + } else if (file_exists($filename_v6)) { + $ipv6addr = get_interface_ipv6($dyndns['interface']); + $cached_ipv6_s = explode("|", file_get_contents($filename_v6)); + $cached_ipv6 = $cached_ipv6_s[0]; + + if ($ipv6addr != $cached_ipv6) { + print('<span class="text-danger">'); + } else { + print('<span class="text-success">'); + } + + print(htmlspecialchars($cached_ipv6)); + print('</span>'); } else { print('N/A ' . date("H:i:s")); } |