Esempio n. 1
0
         if (strpos(strtoupper($myrow["net_ip_address"]), $search) !== false) {
             $search_field = "IP Address";
             $search_result = $myrow["net_ip_address"];
         } else {
             if (strpos(strtoupper($myrow["net_ip_address"]), $search_padded) !== false) {
                 $search_field = "IP Address";
                 $search_result = ip_trans($myrow["net_ip_address"]);
             }
         }
         $bgcolor = change_row_color($bgcolor, $bg1, $bg2);
         $result_set[] = array($myrow["system_name"], $myrow["system_uuid"], ip_trans($myrow["net_ip_address"]), $search_field, $search_result);
     } while ($myrow = mysql_fetch_array($result));
 } else {
 }
 // Search for IP address into "other" table
 $search_padded = ip_trans_to($search);
 $sql = "SELECT DISTINCT other_network_name, other_id, other_ip_address ";
 $sql .= "FROM other WHERE ";
 $sql .= "other_ip_address LIKE '%{$search}%' OR ";
 $sql .= "other_ip_address LIKE '%{$search_padded}%'";
 $result = mysql_query($sql, $db);
 if ($myrow = mysql_fetch_array($result)) {
     do {
         if (strpos(strtoupper($myrow["other_ip_address"]), $search) !== false) {
             $search_field = "Device IP Address";
             $search_result = $myrow["other_ip_address"];
         } else {
             if (strpos(strtoupper($myrow["other_ip_address"]), $search_padded) !== false) {
                 $search_field = "Device IP Address";
                 $search_result = ip_trans($myrow["other_ip_address"]);
             }
 if ($uuid == "" and $mac != "00:00:00:00:00:00") {
     // Insert into other table
     $sql = "INSERT INTO other (other_network_name, other_ip_address, other_mac_address, ";
     $sql .= "other_description, other_manufacturer, other_type, ";
     $sql .= "other_timestamp, other_first_timestamp) VALUES (";
     $sql .= "'{$name}','" . ip_trans_to($ip_address) . "','{$mac}',";
     $sql .= "'{$running}','{$manufacturer}','{$device_type}',";
     $sql .= "'{$timestamp}','{$timestamp}')";
     $result = mysql_query($sql) or die('Insert Failed: <br />' . $sql . '<br />' . mysql_error());
     $uuid = mysql_insert_id();
     $process = "new_other";
     echo $sql . "<br />";
 } else {
 }
 if ($process == "other_mac") {
     $sql = "UPDATE other SET other_ip_address = '" . ip_trans_to($ip_address) . "', ";
     $sql .= "other_mac_address = '{$mac}', other_timestamp = '{$timestamp}' ";
     $sql .= "WHERE other_id = '{$uuid}'";
     $result = mysql_query($sql) or die('Insert Failed: <br />' . $sql . '<br />' . mysql_error());
     //$uuid = mysql_insert_id();
     $process = "update_other";
     echo $sql . "<br />\n";
 } else {
 }
 if ($process != "") {
     // Process the file
     echo "UUID: " . $uuid . "<br />";
     echo "Process: " . $process . "<br />";
     $sql = "DELETE FROM nmap_ports WHERE nmap_other_id = '" . $uuid . "'";
     echo $sql . "<br />\n";
     $result = mysql_query($sql) or die('Delete Failed: <br />' . $sql . '<br />' . mysql_error());
Esempio n. 3
0
<?php

$page = "other";
include "include_config.php";
include "include_functions.php";
include "include_lang.php";
mysql_connect($mysql_server, $mysql_user, $mysql_password) or die("Could not connect");
mysql_select_db($mysql_database) or die("Could not select database");
if (isset($_REQUEST["view"]) and isset($_REQUEST["category"])) {
    //Other-System ------------------------------------------------------------------------------
    if ($_REQUEST["view"] == "other_system" and $_REQUEST["category"] == "summary" or $_REQUEST["view"] == "printer" and $_REQUEST["category"] == "summary") {
        $sql = "UPDATE other SET other_network_name = '" . $_REQUEST['other_network_name'] . "',";
        $sql .= " other_ip_address = '" . ip_trans_to($_REQUEST['other_ip_address']) . "',";
        $sql .= " other_mac_address = '" . $_REQUEST['other_mac_address'] . "',";
        $sql .= " other_p_port_name = '" . $_REQUEST['other_p_port_name'] . "',";
        $sql .= " other_description = '" . $_REQUEST['other_description'] . "',";
        $sql .= " other_serial = '" . $_REQUEST['other_serial'] . "',";
        $sql .= " other_manufacturer = '" . $_REQUEST['other_manufacturer'] . "',";
        $sql .= " other_model='" . $_REQUEST['other_model'] . "',";
        $sql .= " other_type='" . $_REQUEST['other_type'] . "',";
        $sql .= " other_location='" . $_REQUEST['other_location'] . "',";
        $sql .= " other_date_purchased='" . $_REQUEST['other_date_purchased'] . "',";
        $sql .= " other_value='" . $_REQUEST['other_value'] . "',";
        $sql .= " other_linked_pc='" . $_REQUEST['other_linked_pc'] . "' ";
        $sql .= " WHERE other_id='" . $_REQUEST['other'] . "'";
        $url = "./system.php?other=" . $_REQUEST["other"] . "&view=" . $_REQUEST["view"] . " ";
        //Monitor ------------------------------------------------------------------------------------
    } elseif ($_REQUEST["view"] == "monitor" and $_REQUEST["category"] == "summary") {
        $sql = "UPDATE monitor SET ";
        $sql .= " monitor_uuid = '" . $_REQUEST['monitor_uuid'] . "', ";
        $sql .= " monitor_date_purchased = '" . $_REQUEST['monitor_date_purchased'] . "', ";