From 23fc7b60bf04b93e7cbbf53be686f2c4fd2bbe3f Mon Sep 17 00:00:00 2001 From: artem Date: Wed, 19 Dec 2007 16:33:36 +0000 Subject: - [ZBX-170] fixed availability to zoom past NOW (Artem) git-svn-id: svn://svn.zabbix.com/trunk@5197 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/include/graphs.inc.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'frontends/php/include') 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_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"]; } -- cgit