summaryrefslogtreecommitdiffstats
path: root/frontends/php/alerts.php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-02-17 22:41:20 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-02-17 22:41:20 +0000
commit33ca5f663dca2bb55a10c10aa45acedb5be130ab (patch)
tree6485d246586d97c180d6ab2ab336206544d74b8a /frontends/php/alerts.php
parent64783dd7e2037814b9e114dfebb001f0351d6878 (diff)
downloadzabbix-33ca5f663dca2bb55a10c10aa45acedb5be130ab.tar.gz
zabbix-33ca5f663dca2bb55a10c10aa45acedb5be130ab.tar.xz
zabbix-33ca5f663dca2bb55a10c10aa45acedb5be130ab.zip
Improvements for new algorithm for action handling.
git-svn-id: svn://svn.zabbix.com/trunk@1262 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/alerts.php')
-rw-r--r--frontends/php/alerts.php23
1 files changed, 19 insertions, 4 deletions
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 "<TD><a href=\"alarms.php?triggerid=".$row["triggerid"]."\">".date("Y.M.d H:i:s",$row["clock"])."</a></TD>";
+ if($row["scope"]==0)
+ {
+ echo "<TD><a href=\"alarms.php?triggerid=".$row["triggerid"]."\">".date("Y.M.d H:i:s",$row["clock"])."</a></TD>";
+ }
+ else
+ {
+ echo "<TD>".date("Y.M.d H:i:s",$row["clock"])."</TD>";
+ }
echo "<TD>".$row["description"]."</TD>";
if($row["status"] == 1)
{