summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorsmos <seth.mos@dds.nl>2010-08-23 22:31:54 +0200
committersmos <seth.mos@dds.nl>2010-08-23 22:31:54 +0200
commit58ed10132e74338f2beebd847ca31bd375bd4520 (patch)
treec01b0608c0f7fc596780220874573d46faaddaa3 /usr
parent8fd0badddbead2b224c50d55542897d75ed668e6 (diff)
downloadpfsense-58ed10132e74338f2beebd847ca31bd375bd4520.zip
pfsense-58ed10132e74338f2beebd847ca31bd375bd4520.tar.gz
Fix logic operator for graph endpoint
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/status_rrd_graph.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php
index 14dc30d..6e577c1 100755
--- a/usr/local/www/status_rrd_graph.php
+++ b/usr/local/www/status_rrd_graph.php
@@ -227,12 +227,13 @@ function get_dates($curperiod, $graph) {
break;
}
$start = mktime((8 + $houroffset), 0, 0, $curmonth, $curday, $curyear);
- if($offset == 0)
+ if(($offset != 0) || (($start + ($end - (12 * 3600)) ) > 0) ) {
$end = mktime((8 + $houroffset) + 12, 0, 0, $curmonth, $curday, $curyear);
+ }
break;
case "day":
$start = mktime(0, 0, 0, $curmonth, ($curday + $offset), $curyear);
- if($offset == 0)
+ if($offset != 0)
$end = mktime(0, 0, 0, $curmonth, (($curday + $offset) + 1), $curyear);
break;
case "week":
@@ -245,27 +246,27 @@ function get_dates($curperiod, $graph) {
break;
}
$start = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset), $curyear);
- if($offset == 0)
+ if($offset != 0)
$end = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset + 7), $curyear);
break;
case "month":
$start = mktime(0, 0, 0, ($curmonth + $offset), 0, $curyear);
- if($offset == 0)
+ if($offset != 0)
$end = mktime(0, 0, 0, (($curmonth + $offset) + 1), 0, $curyear);
break;
case "quarter":
$start = mktime(0, 0, 0, (($curmonth - 2) + $offset), 0, $curyear);
- if($offset == 0)
+ if($offset != 0)
$end = mktime(0, 0, 0, (($curmonth + $offset) + 1), 0, $curyear);
break;
case "year":
$start = mktime(0, 0, 0, 1, 0, ($curyear + $offset));
- if($offset == 0)
+ if($offset != 0)
$end = mktime(0, 0, 0, 1, 0, (($curyear + $offset) +1));
break;
case "4year":
$start = mktime(0, 0, 0, 1, 0, (($curyear - 3) + $offset));
- if($offset == 0)
+ if($offset != 0)
$end = mktime(0, 0, 0, 1, 0, (($curyear + $offset) +1));
break;
}
OpenPOWER on IntegriCloud