summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-12-19 16:33:36 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-12-19 16:33:36 +0000
commit23fc7b60bf04b93e7cbbf53be686f2c4fd2bbe3f (patch)
treebba78f56262232e8e4768ab1c64e1aad41ba1fe5 /frontends/php/include
parentf2ad489e2e1fc8097852c628a0e76e9635ae4b3d (diff)
downloadzabbix-23fc7b60bf04b93e7cbbf53be686f2c4fd2bbe3f.tar.gz
zabbix-23fc7b60bf04b93e7cbbf53be686f2c4fd2bbe3f.tar.xz
zabbix-23fc7b60bf04b93e7cbbf53be686f2c4fd2bbe3f.zip
- [ZBX-170] fixed availability to zoom past NOW (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5197 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/graphs.inc.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/frontends/php/include/graphs.inc.php b/frontends/php/include/graphs.inc.php
index 77d8a3e9..e1e32692 100644
--- a/frontends/php/include/graphs.inc.php
+++ b/frontends/php/include/graphs.inc.php
@@ -809,15 +809,23 @@
if(!isset($_REQUEST["period"])) $_REQUEST["period"]=ZBX_PERIOD_DEFAULT;
if(!isset($_REQUEST["from"])) $_REQUEST["from"]=0;
if(!isset($_REQUEST["stime"])) $_REQUEST["stime"]=null;
-
+
if($_REQUEST['period']<ZBX_MIN_PERIOD){
show_message(S_WARNING.'. '.S_TIME_PERIOD.SPACE.S_MIN_VALUE_SMALL.': '.ZBX_MIN_PERIOD.' ('.(int)(ZBX_MIN_PERIOD/3600).'h)');
$_REQUEST['period'] = ZBX_MIN_PERIOD;
+
}
else if($_REQUEST['period'] > ZBX_MAX_PERIOD){
show_message(S_WARNING.'. '.S_TIME_PERIOD.SPACE.S_MAX_VALUE_SMALL.': '.ZBX_MAX_PERIOD.' ('.(int)(ZBX_MAX_PERIOD/86400).'d)');
- $_REQUEST['period'] = ZBX_MAX_PERIOD;
+ $_REQUEST['period'] = ZBX_MAX_PERIOD;
}
+
+ if(isset($_REQUEST["stime"])){
+ $bstime = $_REQUEST['stime'];
+ $time = mktime(substr($bstime,8,2),substr($bstime,10,2),0,substr($bstime,4,2),substr($bstime,6,2),substr($bstime,0,4));
+ if(($time+$_REQUEST['period']) > time()) unset($_REQUEST['stime']);
+ }
+
return $_REQUEST["period"];
}