Commit db2fdd0e authored by Franco Fichtner's avatar Franco Fichtner

dyndns: fix widget with IPv6; closes #797

parent 5bc1fdfa
......@@ -53,6 +53,7 @@ if ($_REQUEST['getdyndnsstatus']) {
}
$filename = "/conf/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($dyndns['host']) . "{$dyndns['id']}.cache";
$filename_v6 = "/conf/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($dyndns['host']) . "{$dyndns['id']}_v6.cache";
if (file_exists($filename) && !empty($dyndns['enable'])) {
$ipaddr = dyndnsCheckIP($dyndns['interface']);
$cached_ip_s = preg_split('/:/', file_get_contents($filename));
......@@ -64,7 +65,17 @@ if ($_REQUEST['getdyndnsstatus']) {
}
echo htmlspecialchars($cached_ip);
echo "</font>";
/* XXX IPv6 missing */
} elseif (file_exists($filename_v6) && !empty($dyndns['enable'])) {
$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) {
echo "<font color='red'>";
} else {
echo "<font color='green'>";
}
echo htmlspecialchars($cached_ipv6);
echo "</font>";
} else {
echo '<span class="text-muted">' . gettext('N/A') . '</span>';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment