diff options
Diffstat (limited to 'frontends/php/actions.php')
-rw-r--r-- | frontends/php/actions.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/frontends/php/actions.php b/frontends/php/actions.php index 1948c32b..3fdbfe3f 100644 --- a/frontends/php/actions.php +++ b/frontends/php/actions.php @@ -140,10 +140,18 @@ if($row["scope"] == 1) { - $sql="select * from actions a,triggers t,hosts h,functions f where a.triggerid=t.triggerid and f.triggerid=t.triggerid and h.hostid=a.triggerid and t.hostid=h.hostid and t.triggerid=".$HTTP_GET_VARS["triggerid"]."and a.scope=1 and h.hostid=".$row["triggerid"]; -// echo $sql; + $sql="select h.hostid from triggers t,hosts h,functions f,items i where f.triggerid=t.triggerid and h.hostid=i.hostid and i.itemid=f.itemid and t.triggerid=".$HTTP_GET_VARS["triggerid"]; +// echo "$sql<br>"; $result2=DBselect($sql); -// if(DBnum_rows($result2)==0) continue; + $found=0; + while($row2=DBfetch($result2)) + { + $sql="select * from actions a,triggers t,hosts h,functions f,items i where a.triggerid=t.triggerid and f.triggerid=t.triggerid and h.hostid=a.triggerid and i.hostid=h.hostid and a.actionid=".$row["actionid"]." and a.scope=1 and h.hostid=".$row2["hostid"]; +// echo "$sql<br>"; + $result3=DBselect($sql); + if(DBnum_rows($result3)>0) $found=1; + } + if($found==0) continue; } if(isset($actionid) && ($actionid==$row["actionid"])) |