Ejemplo n.º 1
0
								<?php 
    echo htmlspecialchars($rfc2136['server']);
    ?>
							</td>
							<td>
								<?php 
    echo htmlspecialchars($rfc2136['host']);
    ?>
							</td>
							<td>
<?php 
    $filename = "{$g['conf_path']}/dyndns_{$rfc2136['interface']}_rfc2136_" . escapeshellarg($rfc2136['host']) . "_{$rfc2136['server']}.cache";
    if (file_exists($filename)) {
        print 'IPv4: ';
        if (isset($rfc2136['usepublicip'])) {
            $ipaddr = dyndnsCheckIP($rfc2136['interface']);
        } else {
            $ipaddr = get_interface_ip($rfc2136['interface']);
        }
        $cached_ip_s = explode("|", file_get_contents($filename));
        $cached_ip = $cached_ip_s[0];
        if ($ipaddr != $cached_ip) {
            print '<span class="text-danger">';
        } else {
            print '<span class="text-success">';
        }
        print htmlspecialchars($cached_ip);
        print '</span>';
    } else {
        print 'IPv4: N/A';
    }
Ejemplo n.º 2
0
if (!is_array($config['dyndnses']['dyndns'])) {
    $config['dyndnses']['dyndns'] = array();
}
$a_dyndns =& $config['dyndnses']['dyndns'];
if ($_REQUEST['getdyndnsstatus']) {
    $first_entry = true;
    foreach ($a_dyndns as $dyndns) {
        if ($first_entry) {
            $first_entry = false;
        } else {
            // Put a vertical bar delimiter between the echoed HTML for each entry processed.
            echo "|";
        }
        $filename = "{$g['conf_path']}/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($dyndns['host']) . "{$dyndns['id']}.cache";
        if (file_exists($filename)) {
            $ipaddr = dyndnsCheckIP($dyndns['interface']);
            $cached_ip_s = split(":", file_get_contents($filename));
            $cached_ip = $cached_ip_s[0];
            if ($ipaddr != $cached_ip) {
                echo "<font color='red'>";
            } else {
                echo "<font color='green'>";
            }
            echo htmlspecialchars($cached_ip);
            echo "</font>";
        } else {
            echo "N/A " . date("H:i:s");
        }
    }
    exit;
}
Ejemplo n.º 3
0
    echo htmlspecialchars($rfc2136['server']);
    ?>
							</td>
							<td>
								<?php 
    echo htmlspecialchars($rfc2136['host']);
    ?>
							</td>
							<td>
<?php 
    $filename = "{$g['conf_path']}/dyndns_{$rfc2136['interface']}_rfc2136_" . escapeshellarg($rfc2136['host']) . "_{$rfc2136['server']}.cache";
    $if = get_failover_interface($rfc2136['interface']);
    if (file_exists($filename)) {
        print 'IPv4: ';
        if (isset($rfc2136['usepublicip'])) {
            $ipaddr = dyndnsCheckIP($if);
        } else {
            $ipaddr = get_interface_ip($if);
        }
        $cached_ip_s = explode("|", file_get_contents($filename));
        $cached_ip = $cached_ip_s[0];
        if ($ipaddr != $cached_ip) {
            print '<span class="text-danger">';
        } else {
            print '<span class="text-success">';
        }
        print htmlspecialchars($cached_ip);
        print '</span>';
    } else {
        print 'IPv4: N/A';
    }