git-svn-id: http://www.observium.org/svn/observer/trunk@3129 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2012-05-03 15:18:02 +00:00
parent b77c4f84ac
commit 5ca7379aaf
3 changed files with 271 additions and 1 deletions
+7 -1
View File
@@ -14,6 +14,8 @@ include_once("../includes/dbFacile.php");
include_once("includes/functions.inc.php");
include_once("includes/authenticate.inc.php");
if (strpos($_SERVER['REQUEST_URI'], "anon")) { $anon = 1; }
if (is_array($config['branding']))
{
if ($config['branding'][$_SERVER['SERVER_NAME']])
@@ -58,6 +60,7 @@ if (isset($_GET['format']) && preg_match("/^[a-z]*$/", $_GET['format']))
$links = dbFetch("SELECT * from ports AS I, links AS L WHERE I.device_id = ? AND L.local_interface_id = I.interface_id ORDER BY L.remote_hostname", array($device['device_id']));
if (count($links))
{
if($anon) { $device['hostname'] = md5($device['hostname']); }
if (!isset($locations[$device['location']])) { $locations[$device['location']] = $loc_count; $loc_count++; }
$loc_id = $locations[$device['location']];
@@ -92,15 +95,18 @@ if (isset($_GET['format']) && preg_match("/^[a-z]*$/", $_GET['format']))
}
$src = $device['hostname'];
if($anon) { $src = md5($src); }
if ($remote_interface_id)
{
$dst = dbFetchCell("SELECT `hostname` FROM `devices` AS D, `ports` AS I WHERE I.interface_id = ? AND D.device_id = I.device_id", array($remote_interface_id));
$dst = dbFetchCell("SELECT `hostname` FROM `devices` AS D, `ports` AS I WHERE I.interface_id = ? AND D.device_id = I.device_id", array($remote_interface_id));
$dst_host = dbFetchCell("SELECT D.device_id FROM `devices` AS D, `ports` AS I WHERE I.interface_id = ? AND D.device_id = I.device_id", array($remote_interface_id));
} else {
unset($dst_host);
$dst = $link['remote_hostname'];
}
if($anon) { $dst = md5($dst); $src = md5($src);}
$sif = ifNameDescr(dbFetchRow("SELECT * FROM ports WHERE `interface_id` = ?", array($link['local_interface_id'])),$device);
if ($remote_interface_id)
{