diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-04-24 17:20:17 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-04-24 17:20:17 +0000 |
| commit | 1cda03ea3911aa7cb17fa09a9613e1f8f0971c29 (patch) | |
| tree | 9e8369f68cd218a74dcd41575e3b2f5e86de621d /frontends/php/include | |
| parent | 253ec5ead738ba2e676f1676be042e207629704b (diff) | |
| download | zabbix-1cda03ea3911aa7cb17fa09a9613e1f8f0971c29.tar.gz zabbix-1cda03ea3911aa7cb17fa09a9613e1f8f0971c29.tar.xz zabbix-1cda03ea3911aa7cb17fa09a9613e1f8f0971c29.zip | |
Check for uniqueness when adding new item.
git-svn-id: svn://svn.zabbix.com/trunk@755 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
| -rw-r--r-- | frontends/php/include/config.inc.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 48eaef19..ae647be8 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -1903,6 +1903,14 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; return 0; } + $sql="select count(*) from items where hostid=$hostid and key_='$key'"; + $result=DBexecute($sql); + if(DBget_field($result,0,0)>0) + { + $ERROR_MSG="An item with the same Key already exists for this host. The key must be unique."; + return 0; + } + if($delay<1) { $ERROR_MSG="Delay cannot be less than 1 second"; |
