From 5d1c421822f5d444c7193b67508c708d5cd9a643 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Sun, 17 Jan 2010 21:30:12 +0000 Subject: [PATCH] global map page almost there ;) git-svn-id: http://www.observium.org/svn/observer/trunk@711 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/map.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/html/map.php b/html/map.php index 2076b00204..cadd9e64c2 100755 --- a/html/map.php +++ b/html/map.php @@ -4,18 +4,16 @@ include("../config.php"); include("../includes/functions.php"); include("includes/authenticate.inc"); -if ($_GET['device']) { $where = "WHERE device_id = ".$_GET['device']; } else { $where = ""; } +if (isset($_GET['device'])) { $where = "WHERE device_id = ".$_GET['device']; } else { $where = ""; } $deviceresult = mysql_query("SELECT * from devices $where"); -if (preg_match("/^[a-z]*$/", $_GET['format'])) +if (isset($_GET['format']) && preg_match("/^[a-z]*$/", $_GET['format'])) { $map = "digraph G { sep=0.01; size=\"12,5.5\"; pack=100; bgcolor=transparent; splines=true; overlap=scale; concentrate=0; epsilon=0.001; rankdir=0; node [ fontname=\"helvetica\", fontstyle=bold, style=filled, color=white, fillcolor=lightgrey, overlap=false;]; edge [ bgcolor=white; fontname=\"helvetica\"; fontstyle=bold; arrowhead=dot; arrowtail=dot]; - graph [bgcolor=transparent;]; - -"; + graph [bgcolor=transparent;];\n\n"; if(!$_SESSION['authenticated']) { @@ -114,5 +112,14 @@ if (preg_match("/^[a-z]*$/", $_GET['format'])) } echo("$img"); } - +else +{ + if ($_SESSION['authenticated']) ## FIXME level 10 only? + { + echo '
+ + +
'; + } +} ?>