summaryrefslogtreecommitdiffstats
path: root/frontends/php/acknow.php
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-04-07 13:14:00 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-04-07 13:14:00 +0000
commitd1f0507236793e1d4b28eb213b17432cef9bdd99 (patch)
treed6c07129b66ba6acb0cac47fab9a6bf5452e7b86 /frontends/php/acknow.php
parent81c4d84a47e5d82758d45a83cd0b4b9cb35c7ea8 (diff)
downloadzabbix-d1f0507236793e1d4b28eb213b17432cef9bdd99.tar.gz
zabbix-d1f0507236793e1d4b28eb213b17432cef9bdd99.tar.xz
zabbix-d1f0507236793e1d4b28eb213b17432cef9bdd99.zip
- [DEV-137] improvements in permissions checks (Artem)
- [DEV-137] fixed issue "viewing items, hosts without group in latest data" (Artem) git-svn-id: svn://svn.zabbix.com/trunk@5595 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/acknow.php')
-rw-r--r--frontends/php/acknow.php25
1 files changed, 9 insertions, 16 deletions
diff --git a/frontends/php/acknow.php b/frontends/php/acknow.php
index 07f55ac9..e2552b3e 100644
--- a/frontends/php/acknow.php
+++ b/frontends/php/acknow.php
@@ -62,7 +62,7 @@ include_once "include/page_header.php";
//$bulk = (count($events) > 1);
?>
<?php
- $denyed_hosts = get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_ONLY, PERM_MODE_LT);
+ $available_triggers = get_accessible_triggers(PERM_READ_ONLY, null, get_current_nodeid());
$eventids = '';
foreach($events as $id => $eventid){
@@ -71,13 +71,9 @@ include_once "include/page_header.php";
$eventids = trim($eventids,',');
$db_data = DBfetch(DBselect('SELECT COUNT(DISTINCT e.eventid) as cnt'.
- ' FROM hosts h, items i, functions f, events e, triggers t'.
- ' WHERE h.hostid=i.hostid '.
- ' AND i.itemid=f.itemid '.
- ' AND f.triggerid=t.triggerid '.
- ' AND e.eventid in ('.$eventids.') '.
- ' AND i.hostid not in ('.$denyed_hosts.') '.
- ' AND e.objectid=t.triggerid '.
+ ' FROM events e'.
+ ' WHERE e.eventid in ('.$eventids.') '.
+ ' AND e.objectid IN ('.$available_triggers.') '.
' AND e.object='.EVENT_OBJECT_TRIGGER.
' AND '.DBin_node('e.eventid')
));
@@ -92,24 +88,21 @@ include_once "include/page_header.php";
' AND i.itemid=f.itemid '.
' AND f.triggerid=t.triggerid '.
' AND e.eventid in ('.$eventids.') '.
- ' AND i.hostid not in ('.$denyed_hosts.') '.
- ' AND e.objectid=t.triggerid '.
' AND e.object='.EVENT_OBJECT_TRIGGER.
+ ' AND e.objectid=t.triggerid '.
+ ' AND t.triggerid IN ('.$available_triggers.') '.
' AND '.DBin_node('e.eventid')
));
-
- unset($denyed_hosts);
- if(isset($_REQUEST['save']) && !$bulk)
- {
+ if(isset($_REQUEST['save']) && !$bulk){
$result = add_acknowledge_coment(
$db_data['eventid'],
$USER_DETAILS['userid'],
$_REQUEST['message']);
show_messages($result, S_COMMENT_ADDED, S_CANNOT_ADD_COMMENT);
- if($result)
- {
+
+ if($result){
add_audit(AUDIT_ACTION_UPDATE,AUDIT_RESOURCE_TRIGGER, S_ACKNOWLEDGE_ADDED.
' ['.expand_trigger_description_by_data($db_data).']'.
' ['.$_REQUEST["message"].']');