diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2002-10-20 07:38:26 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2002-10-20 07:38:26 +0000 |
| commit | 82c12394074bc2ee522a4fc2f30f39f26d6a48e0 (patch) | |
| tree | 56a75cd462b5a1b13ebc99e9ef32d7ce35b1ac4a /frontends/php/include | |
| parent | 2b110264a62b85ffd03938f36ab56ff850e31aad (diff) | |
| download | zabbix-82c12394074bc2ee522a4fc2f30f39f26d6a48e0.tar.gz zabbix-82c12394074bc2ee522a4fc2f30f39f26d6a48e0.tar.xz zabbix-82c12394074bc2ee522a4fc2f30f39f26d6a48e0.zip | |
Minor changes.
git-svn-id: svn://svn.zabbix.com/trunk@534 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
| -rw-r--r-- | frontends/php/include/config.inc.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index a53cf2ab..3c5248d9 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -2473,6 +2473,25 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; return DBexecute($sql); } + function delete_groups_by_hostid($hostid) + { + $sql="select groupid from hosts_groups where hostid=$hostid"; + $result=DBselect($sql); + while($row=DBfetch($result)) + { + $sql="delete from hosts_groups where hostid=$hostid and groupid=".$row["groupid"]; + DBexecute($sql); + $sql="select count(*) as count from hosts_groups where groupid=".$row["groupid"]; + $result2=DBselect($sql); + $row2=DBfetch($result2); + if($row2["count"]==0) + { + $sql="delete from groups where groupid=".$row["groupid"]; + DBexecute($sql); + } + } + } + # Delete Host function delete_host($hostid) @@ -2490,6 +2509,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; return FALSE; } } + delete_groups_by_hostid($hostid); $sql="delete from hosts where hostid=$hostid"; return DBexecute($sql); } |
