From 33ca5f663dca2bb55a10c10aa45acedb5be130ab Mon Sep 17 00:00:00 2001 From: hugetoad Date: Tue, 17 Feb 2004 22:41:20 +0000 Subject: Improvements for new algorithm for action handling. git-svn-id: svn://svn.zabbix.com/trunk@1262 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/alerts.php | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'frontends/php/alerts.php') diff --git a/frontends/php/alerts.php b/frontends/php/alerts.php index cced0641..e4dd6e4d 100644 --- a/frontends/php/alerts.php +++ b/frontends/php/alerts.php @@ -66,11 +66,11 @@ if(!isset($HTTP_GET_VARS["start"])) { - $sql="select a.alertid,a.clock,mt.description,a.sendto,a.subject,a.message,ac.triggerid,a.status,a.retries from alerts a,actions ac,media_type mt where a.actionid=ac.actionid and mt.mediatypeid=a.mediatypeid and a.alertid>$maxalertid-200 order by a.clock desc limit 200"; + $sql="select a.alertid,a.clock,mt.description,a.sendto,a.subject,a.message,ac.triggerid,a.status,a.retries,ac.scope from alerts a,actions ac,media_type mt where a.actionid=ac.actionid and mt.mediatypeid=a.mediatypeid and a.alertid>$maxalertid-200 order by a.clock desc limit 200"; } else { - $sql="select a.alertid,a.clock,mt.description,a.sendto,a.subject,a.message,ac.triggerid,a.status,a.retries from alerts a,actions ac,media_type mt where a.actionid=ac.actionid and mt.mediatypeid=a.mediatypeid and a.alertid>$maxalertid-200-".$HTTP_GET_VARS["start"]." order by a.clock desc limit ".($HTTP_GET_VARS["start"]+500); + $sql="select a.alertid,a.clock,mt.description,a.sendto,a.subject,a.message,ac.triggerid,a.status,a.retries,ac.scope from alerts a,actions ac,media_type mt where a.actionid=ac.actionid and mt.mediatypeid=a.mediatypeid and a.alertid>$maxalertid-200-".$HTTP_GET_VARS["start"]." order by a.clock desc limit ".($HTTP_GET_VARS["start"]+500); } $result=DBselect($sql); @@ -92,7 +92,15 @@ { continue; } - if(!check_right_on_trigger("R",$row["triggerid"])) + if(($row["scope"]==0)&&!check_right_on_trigger("R",$row["triggerid"])) + { + continue; + } + if(($row["scope"]==1)&&!check_right("Host","R",$row["triggerid"])) + { + continue; + } + if(($row["scope"]==2)&&!check_anyright("Default permission","R")) { continue; } @@ -102,7 +110,14 @@ if($col>100) break; - echo "".date("Y.M.d H:i:s",$row["clock"]).""; + if($row["scope"]==0) + { + echo "".date("Y.M.d H:i:s",$row["clock"]).""; + } + else + { + echo "".date("Y.M.d H:i:s",$row["clock"]).""; + } echo "".$row["description"].""; if($row["status"] == 1) { -- cgit