more code cleanups, modify renamehost to also take a source parameter so we can build a renamehost function into the web gui some day

git-svn-id: http://www.observium.org/svn/observer/trunk@1980 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-03-27 10:21:19 +00:00
parent 7ffefc0d57
commit 340c71b2e7
27 changed files with 110 additions and 107 deletions
+4 -2
View File
@@ -113,7 +113,8 @@ if (isset($_GET['format']) && preg_match("/^[a-z]*$/", $_GET['format']))
$map .= "\"$dst\" [URL=\"{$config['base_url']}/device/$dst_host/map/\" fontsize=20 shape=box3d]\n";
if ($dst_host == $device['device_id'] || $where == '') {
if ($dst_host == $device['device_id'] || $where == '')
{
$map .= "\"" . $dif['interface_id'] . "\" [label=\"" . $dif['label'] . "\", fontsize=12, fillcolor=lightblue, URL=\"{$config['base_url']}/device/$dst_host/interface/$remote_interface_id/\"]\n";
} else {
$map .= "\"" . $dif['interface_id'] . "\" [label=\"" . $dif['label'] . " \", fontsize=12, fillcolor=lightgray, URL=\"{$config['base_url']}/device/$dst_host/interface/$remote_interface_id/\"]\n";
@@ -156,7 +157,8 @@ if (isset($_GET['format']) && preg_match("/^[a-z]*$/", $_GET['format']))
if ($where == '') { $maptool = 'neato -Gpack'; }
$img = shell_exec("echo \"".addslashes($map)."\" | $maptool -T".$_GET['format']."");
if ($_GET['format'] == "png") {
if ($_GET['format'] == "png")
{
header("Content-type: image/".$_GET['format']);
} elseif ($_GET['format'] == "svg") {
header("Content-type: image/svg+xml");