summaryrefslogtreecommitdiffstats
path: root/frontends/php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2002-05-16 17:19:08 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2002-05-16 17:19:08 +0000
commit754c5bee55fc43c2c1b385d2db893cdd87f440f3 (patch)
tree3d0c0f5c6fd93fa8e924f7e4dc96eac091bd213d /frontends/php
parentb0d6efabe7fdb34edc6b102739761d899b47076f (diff)
downloadzabbix-754c5bee55fc43c2c1b385d2db893cdd87f440f3.tar.gz
zabbix-754c5bee55fc43c2c1b385d2db893cdd87f440f3.tar.xz
zabbix-754c5bee55fc43c2c1b385d2db893cdd87f440f3.zip
- 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
Diffstat (limited to 'frontends/php')
-rw-r--r--frontends/php/include/config.inc11
1 files changed, 11 insertions, 0 deletions
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");