summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorErik Fonnesbeck <efonnes@gmail.com>2010-08-23 22:24:19 -0600
committerErik Fonnesbeck <efonnes@gmail.com>2010-08-23 22:50:36 -0600
commit44aef5432bf5e647d79b5951015076909f6c136c (patch)
tree1ace73fe4bcd6264c6e55f59b2b70cec57fedca3 /usr
parent9cd5e6f516437e9b31e2fc17826d463ca78381bf (diff)
downloadpfsense-44aef5432bf5e647d79b5951015076909f6c136c.zip
pfsense-44aef5432bf5e647d79b5951015076909f6c136c.tar.gz
See if the name matches a gateway instead of showing everything ending in -quality. Also do a more restrictive match when checking which graph to display, so it doesn't match ones it shouldn't. (for example, WAN matching both WAN and GW_WAN)
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/status_rrd_graph.php35
1 files changed, 28 insertions, 7 deletions
diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php
index dd659c7..3630bba 100755
--- a/usr/local/www/status_rrd_graph.php
+++ b/usr/local/www/status_rrd_graph.php
@@ -447,11 +447,20 @@ function get_dates($curperiod, $graph) {
/* only show interfaces with a gateway */
$optionc = "$optionc[0]";
if(!interface_has_gateway($optionc)) {
- if(!preg_match("/($optionc)-(quality)/", $curdatabase)) {
+ if(!isset($gateways_arr))
+ $gateways_arr = return_gateways_array();
+ $found_gateway = false;
+ foreach ($gateways_arr as $gw) {
+ if ($gw['name'] == $optionc) {
+ $found_gateway = true;
+ break;
+ }
+ }
+ if(!$found_gateway) {
continue 2;
}
}
- if(! preg_match("/($optionc)[-.]/i", $curdatabase)) {
+ if(! preg_match("/(^$optionc-|-$optionc\\.)/i", $curdatabase)) {
continue 2;
}
break;
@@ -463,7 +472,7 @@ function get_dates($curperiod, $graph) {
break;
default:
/* just use the name here */
- if(! preg_match("/($curoption)[-.]/i", $curdatabase)) {
+ if(! preg_match("/(^$curoption-|-$curoption\\.)/i", $curdatabase)) {
continue 2;
}
}
@@ -502,11 +511,23 @@ function get_dates($curperiod, $graph) {
$replace = array(" :: ", "", $friendly);
switch($curoption) {
case "outbound":
+ $optionc = "$optionc[0]";
if(!interface_has_gateway($optionc)) {
- continue 2;
- }
- if(! stristr($curdatabase, $optionc)) {
+ if(!isset($gateways_arr))
+ $gateways_arr = return_gateways_array();
+ $found_gateway = false;
+ foreach ($gateways_arr as $gw) {
+ if ($gw['name'] == $optionc) {
+ $found_gateway = true;
+ break;
+ }
+ }
+ if(!$found_gateway) {
continue 2;
+ }
+ }
+ if(! preg_match("/(^$optionc-|-$optionc\\.)/i", $curdatabase)) {
+ continue 2;
}
break;
case "allgraphs":
@@ -517,7 +538,7 @@ function get_dates($curperiod, $graph) {
break;
default:
/* just use the name here */
- if(! stristr($curdatabase, $curoption)) {
+ if(! preg_match("/(^$curoption-|-$curoption\\.)/i", $curdatabase)) {
continue 2;
}
}
OpenPOWER on IntegriCloud