diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-04-18 15:16:33 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-04-18 15:16:33 +0000 |
| commit | be6ea34f2de74134500313ecf31fef237e077864 (patch) | |
| tree | e58db26269f5dd7ecb3932fb572f96e33651dc1f /frontends/php/include/items.inc.php | |
| parent | 8f5b6dc7db062516691836e4ff9df984f6e2de67 (diff) | |
| download | zabbix-be6ea34f2de74134500313ecf31fef237e077864.tar.gz zabbix-be6ea34f2de74134500313ecf31fef237e077864.tar.xz zabbix-be6ea34f2de74134500313ecf31fef237e077864.zip | |
- fix permission check for overviews (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@2742 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/items.inc.php')
| -rw-r--r-- | frontends/php/include/items.inc.php | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/frontends/php/include/items.inc.php b/frontends/php/include/items.inc.php index e7ee6f67..4f6e074b 100644 --- a/frontends/php/include/items.inc.php +++ b/frontends/php/include/items.inc.php @@ -470,20 +470,24 @@ $hosts=array(); $result=DBselect("select h.hostid,h.host from hosts h,items i $group_where". - " h.status=".HOST_STATUS_MONITORED." and h.hostid=i.hostid". + " h.status=".HOST_STATUS_MONITORED." and h.hostid=i.hostid and i.status=".ITEM_STATUS_ACTIVE. " group by h.host,h.hostid order by h.host"); while($row=DBfetch($result)) { - $header=array_merge($header,array(new CImg("vtext.php?text=".$row["host"]))); - $hosts=array_merge($hosts,array($row["hostid"])); + if(!check_right("Host","R",$row["hostid"])) continue; //TODO optimize duplication check !!!! see buttom + + array_push($header,new CImg("vtext.php?text=".$row["host"])); + array_push($hosts,$row["hostid"]); } $table->SetHeader($header,"vertical_header"); - - $db_items = DBselect("select distinct i.description from hosts h,items i $group_where". - " h.status=".HOST_STATUS_MONITORED." and h.hostid=i.hostid order by 1"); + $db_items = DBselect("select distinct i.description,h.hostid from hosts h,items i $group_where". + " h.status=".HOST_STATUS_MONITORED." and h.hostid=i.hostid and i.status=".ITEM_STATUS_ACTIVE. + " order by 1"); while($item = DBfetch($db_items)) { + if(!check_right("Host","R",$row["hostid"])) continue; //TODO optimize duplication check !!!! see top + $table_row = array(nbsp($item["description"])); foreach($hosts as $hostid) { @@ -495,6 +499,9 @@ continue; } $host_item = DBfetch($db_host_items); + + if(!check_right("Item","R",$host_item["itemid"])) continue; + if(!isset($host_item["lastvalue"])) { array_push($table_row,"-"); |
