dyndns: minor tweaks+note that ipv6 missing from widget

This commit is contained in:
Franco Fichtner 2016-02-26 18:21:58 +01:00
parent 1f3e5b1d9e
commit fc886e654d
2 changed files with 5 additions and 4 deletions

View File

@ -151,7 +151,7 @@ $main_buttons = array(
}
echo htmlspecialchars($cached_ip);
echo "</font>";
} elseif (file_exists($filename_v6)) {
} 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];
@ -163,7 +163,7 @@ $main_buttons = array(
echo htmlspecialchars($cached_ipv6);
echo "</font>";
} else {
echo "N/A";
echo gettext('N/A');
}?>
</td>
<td><?=$dyndns['descr'];?></td>

View File

@ -53,7 +53,7 @@ if ($_REQUEST['getdyndnsstatus']) {
}
$filename = "/conf/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($dyndns['host']) . "{$dyndns['id']}.cache";
if (file_exists($filename)) {
if (file_exists($filename) && !empty($dyndns['enable'])) {
$ipaddr = dyndnsCheckIP($dyndns['interface']);
$cached_ip_s = preg_split('/:/', file_get_contents($filename));
$cached_ip = $cached_ip_s[0];
@ -64,8 +64,9 @@ if ($_REQUEST['getdyndnsstatus']) {
}
echo htmlspecialchars($cached_ip);
echo "</font>";
/* XXX IPv6 missing */
} else {
echo gettext("N/A ") . date("H:i:s");
echo '<span class="text-muted">' . gettext('N/A') . '</span>';
}
}
exit;