From 7bea8d494174be270e607b66993b17717a66fb2c Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Sun, 31 Jan 2010 17:30:16 +0000 Subject: [PATCH] code cleanups git-svn-id: http://www.observium.org/svn/observer/trunk@753 61d68cd4-352d-0410-923a-c4978735b2b8 --- check-services.php | 2 +- cleanup.php | 2 +- html/pages/delsrv.php | 2 +- html/pages/device/showconfig.inc.php | 5 ++--- map.php | 10 +++++----- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/check-services.php b/check-services.php index e19a772d84..73b160ddc2 100755 --- a/check-services.php +++ b/check-services.php @@ -9,7 +9,7 @@ while ($service = mysql_fetch_array($query)) { unset($check, $service_status, $time, $status); $service_status = $service['service_status']; - $service_type = strtolower($service[service_type]); + $service_type = strtolower($service['service_type']); $service_param = $service['service_param']; $checker_script = "includes/services/" . $service_type . "/check.inc"; if(is_file($checker_script)) { diff --git a/cleanup.php b/cleanup.php index 4b98286482..664b054fb7 100755 --- a/cleanup.php +++ b/cleanup.php @@ -50,7 +50,7 @@ $query = "SELECT * FROM interfaces AS I, devices as D WHERE I.device_id = D.device_id AND D.status = '1'"; $data = mysql_query($query); while($row = mysql_fetch_array($data)) { - $index = $row[ifIndex]; + $index = $row['ifIndex']; $hostname = $row['hostname']; $community = $row['community']; $port = $row['port']; diff --git a/html/pages/delsrv.php b/html/pages/delsrv.php index 672958d964..ad6e5899f4 100644 --- a/html/pages/delsrv.php +++ b/html/pages/delsrv.php @@ -1,6 +1,6 @@ = "5" && is_file($config['rancid_configs'] . $device[ $file = $config['rancid_configs'] . $device['hostname']; $fh = fopen($file, 'r') or die("Can't open file"); $text = fread($fh, filesize($file)); + fclose($fh); if ($config['rancid_ignorecomments']) { $lines = split("\n",$text); @@ -20,11 +21,9 @@ if($_SESSION['userlevel'] >= "5" && is_file($config['rancid_configs'] . $device[ $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS); $geshi->set_overall_style('color: black;'); # $geshi->set_line_style('color: #999999'); - echo $geshi->parse_code(); - fclose($fh); + echo $geshi->parse_code(); } else { print_error("Error : Insufficient access."); } - ?> diff --git a/map.php b/map.php index 39db89324d..8ef5516b24 100755 --- a/map.php +++ b/map.php @@ -44,7 +44,7 @@ while($loc_data = mysql_fetch_array($loc_result)) { if(strpos($host, "vax")) { $hostinfo = "shape=rect style=filled fillcolor=skyblue"; } if(strpos($host, "vsx")) { $hostinfo = "shape=box3d style=filled fillcolor=skyblue"; } - $host = $dev_data[hostname]; + $host = $dev_data['hostname']; $host = str_replace("." . $config['mydomain'],"", $host); echo("\"$host\" [$hostinfo] "); @@ -94,18 +94,18 @@ while($link_data = mysql_fetch_array($links_result)) { $i = 0; while ($i < count($linkdone)) { - $thislink = "$dst $link_data[dif] $src $link_data[sif]"; + $thislink = "$dst ".$link_data['dif']." $src ".$link_data['sif']; if ($linkdone[$i] == $thislink) { $die = "yes"; } $i++; } - $sif = makeshortif($link_data[sif]); - $dif = makeshortif($link_data[dif]); + $sif = makeshortif($link_data['sif']); + $dif = makeshortif($link_data['dif']); if(!$die){ echo("\"$src\" -> \"$dst\" [taillabel=\"$dif\" headlabel=\"$sif\" arrowhead=dot arrowtail=dot $info];\n"); # echo("\"$src\" -> \"$dst\" [ arrowhead=none arrowtail=none $info];\n"); - $linkdone[] = "$src $link_data[sif] $dst $link_data[dif]"; + $linkdone[] = "$src ".$link_data['sif']." $dst ".$link_data['dif']; $x++; } }