From 754c5bee55fc43c2c1b385d2db893cdd87f440f3 Mon Sep 17 00:00:00 2001 From: hugetoad Date: Thu, 16 May 2002 17:19:08 +0000 Subject: - protection from items.delay set to 0 (Alexei) - values provided by an agent can be less than zero (Alexei) git-svn-id: svn://svn.zabbix.com/trunk@368 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/include/config.inc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'frontends/php/include') diff --git a/frontends/php/include/config.inc b/frontends/php/include/config.inc index 3abce7dd..79318144 100644 --- a/frontends/php/include/config.inc +++ b/frontends/php/include/config.inc @@ -1157,6 +1157,11 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; $ERROR_MSG="Insufficient permissions"; return 0; } + if($delay<1) + { + $ERROR_MSG="Delay cannot be less than 1 second"; + return 0; + } $sql="update items set description='$description',key_='$key',hostid=$hostid,delay=$delay,history=$history,lastdelete=0,nextcheck=0,status=$status,type=$type,snmp_community='$snmp_community',snmp_oid='$snmp_oid',value_type=$value_type where itemid=$itemid"; return DBexecute($sql); @@ -1446,6 +1451,12 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; return 0; } + if($delay<1) + { + $ERROR_MSG="Delay cannot be less than 1 second"; + return 0; + } + $sql="insert into items (description,key_,hostid,delay,history,lastdelete,nextcheck,status,type,snmp_community,snmp_oid,value_type) values ('$description','$key',$hostid,$delay,$history,0,0,$status,$type,'$snmp_community','$snmp_oid',$value_type)"; $result=DBexecute($sql); return DBinsert_id($result,"items","itemid"); -- cgit