Example #1
0
$pollflag["d"] = $pollflag[0];
$pollflag["w"] = $pollflag[1];
$pollflag["m"] = $pollflag[2];
$pollflag["y"] = $pollflag[3];
$cnt = 0;
$lst = array();
while ($row = $rr->FetchRow()) {
    $export->addRow(NULL);
    setdefault("cell", array("class" => color_flip_flop()));
    // work out inet_ntoa once as it is slow!
    $ip = inet_ntoa($row["ipaddr"]);
    $polled = 0;
    // did user select to scan if address is active?
    if ($showactive) {
        if (NMAP == "") {
            if (ScanHost($ip, 1)) {
                insert($t, $c = cell(array("class" => "greencell")));
                // should be transaction here!
                $ds->UpdateIPPoll($baseindex, $row["ipaddr"]);
                $polled = 1;
            } else {
                insert($t, $c = cell(array("class" => "redcell")));
            }
        } else {
            if (isset($ipscan[$ip])) {
                insert($t, $c = cell(array("class" => "greencell")));
                // should be transaction here!
                $ds->UpdateIPPoll($baseindex, $row["ipaddr"]);
                $polled = 1;
            } else {
                insert($t, $c = cell(array("class" => "redcell")));
Example #2
0
    insert($con, $legend = container("legend", array("class" => "legend")));
    insert($legend, text(my_("Requested addresses")));
    insert($con, selectbox($lst, array("name" => "request", "onChange" => "modifyipform()")));
}
// ------------------- request ip address section ends here ------------------------
// ------------------- support functions block start here ------------------------
insert($w, textB(my_("IP Address to modify:") . " " . $iptemp));
// scan the new address to see if it is currently active
if ($probe or $ipplanPoll) {
    if (NMAP != "") {
        $ipscan = NmapScan(NmapRange($iptemp, $iptemp));
        if (!empty($ipscan)) {
            insert($w, text(my_(" (Address active on network) "), array("color" => "#FF0000")));
        }
    } else {
        if (ScanHost($iptemp, 1)) {
            insert($w, text(my_(" (Address active on network) "), array("color" => "#FF0000")));
        }
    }
}
insert($w, block(" | "));
insert($w, anchor("whois.php?lookup=" . $iptemp, my_("Whois")));
insert($w, block(" | "));
// dont bother checking for safe mode as error will be thrown in called scripts
//if (!ini_get("safe_mode")) {
insert($w, anchor("ping.php?lookup=" . $iptemp, my_("Ping")));
insert($w, block(" | "));
insert($w, anchor("traceroute.php?lookup=" . $iptemp, my_("Traceroute")));
insert($w, block(" | "));
//}
insert($w, anchor("dns.php?ip=" . $iptemp, my_("DNS")));