summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/hosts.inc.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-01-25 10:46:56 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-01-25 10:46:56 +0000
commit800ef4ec1472f443cbc7a69e0267071d33aae489 (patch)
tree21d9a491aa84c328127ce01687c641a15dd659b8 /frontends/php/include/hosts.inc.php
parenta098eba611e1633be9a3b168cdbcf71751f0ae1a (diff)
- fixed deletion of applications with httptests (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3753 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/hosts.inc.php')
-rw-r--r--frontends/php/include/hosts.inc.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/frontends/php/include/hosts.inc.php b/frontends/php/include/hosts.inc.php
index 6ad32242..2db6de97 100644
--- a/frontends/php/include/hosts.inc.php
+++ b/frontends/php/include/hosts.inc.php
@@ -685,7 +685,21 @@ require_once "include/items.inc.php";
$result = delete_application($db_app["applicationid"]);
if(!$result) return $result;
}
+
+ if($info = DBfetch(DBselect('select name from httptest where applicationid='.$applicationid)))
+ {
+ info("Application '".$host["host"].":".$app["name"]."' used by scenario '".$info['name']."'");
+ return false;
+ }
+ if($info = DBfetch(DBselect('select i.key_, i.description from items_applications ia, items i '.
+ ' where i.type='.ITEM_TYPE_HTTPTEST.' and i.itemid=ia.itemid and ia.applicationid='.$applicationid)))
+ {
+ info("Application '".$host["host"].":".$app["name"]."' used by item '".
+ item_description($info['description'], $info['key_'])."'");
+ return false;
+ }
+
$result = DBexecute("delete from items_applications where applicationid=$applicationid");
$result = DBexecute("delete from applications where applicationid=$applicationid");