summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-05-20 10:46:46 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-05-20 10:46:46 +0000
commitf1772af2dc84a86ceee17ca21532e7143dbcab65 (patch)
tree58f02929790d87cf5f9bd9454c247f41114f53e6 /frontends/php/include
parent8b7a31ecc6bde646e36f0c6f81c33f15ed26a85d (diff)
downloadzabbix-f1772af2dc84a86ceee17ca21532e7143dbcab65.tar.gz
zabbix-f1772af2dc84a86ceee17ca21532e7143dbcab65.tar.xz
zabbix-f1772af2dc84a86ceee17ca21532e7143dbcab65.zip
- [DEV-137] added WEB scenario deletion, on host remove (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5721 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/hosts.inc.php7
-rw-r--r--frontends/php/include/httptest.inc.php10
2 files changed, 16 insertions, 1 deletions
diff --git a/frontends/php/include/hosts.inc.php b/frontends/php/include/hosts.inc.php
index 46fbee9a..705cd09f 100644
--- a/frontends/php/include/hosts.inc.php
+++ b/frontends/php/include/hosts.inc.php
@@ -22,6 +22,7 @@
require_once "include/graphs.inc.php";
require_once "include/triggers.inc.php";
require_once "include/items.inc.php";
+require_once "include/httptest.inc.php";
/* HOST GROUP functions */
function add_host_to_group($hostid, $groupid){
@@ -444,6 +445,12 @@ require_once "include/items.inc.php";
// delete host profile
delete_host_profile($hostid);
+
+ // delete web tests
+ $db_httptests = get_httptests_by_hostid($hostid);
+ while($db_httptest = DBfetch($db_httptests)){
+ delete_httptest($db_httptest['httptestid']);
+ }
// delete host
return DBexecute("delete from hosts where hostid=$hostid");
diff --git a/frontends/php/include/httptest.inc.php b/frontends/php/include/httptest.inc.php
index 2d2415fa..a0282034 100644
--- a/frontends/php/include/httptest.inc.php
+++ b/frontends/php/include/httptest.inc.php
@@ -389,7 +389,7 @@
return DBfetch(DBselect('select * from httptest where httptestid='.$httptestid));
}
- function &get_httpsteps_by_httptestid($httptestid)
+ function get_httpsteps_by_httptestid($httptestid)
{
return DBselect('select * from httpstep where httptestid='.$httptestid);
}
@@ -403,4 +403,12 @@
{
return DBfetch(DBselect('select * from httpstep where httptestid='.$httptestid.' and no='.$no));
}
+
+ function get_httptests_by_hostid($hostid){
+ $sql = 'SELECT DISTINCT ht.* '.
+ ' FROM httptest ht, applications ap '.
+ ' WHERE ap.hostid='.$hostid.
+ ' AND ht.applicationid=ap.applicationid';
+ return DBselect($sql);
+ }
?>