diff options
| author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-04-02 11:44:34 +0000 |
|---|---|---|
| committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-04-02 11:44:34 +0000 |
| commit | 908fda905acd739d8d2376ffb33f7e5a63faf26c (patch) | |
| tree | 55f16bf5ae2a95e9dbbf6266f17be864f2d2db32 /frontends/php/chart7.php | |
| parent | 82e68eabae069748d6691cab742f5fde436a56cb (diff) | |
- improvements in permissions (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5577 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/chart7.php')
| -rw-r--r-- | frontends/php/chart7.php | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/frontends/php/chart7.php b/frontends/php/chart7.php index 1bcf5046..b833c5fb 100644 --- a/frontends/php/chart7.php +++ b/frontends/php/chart7.php @@ -49,26 +49,21 @@ include_once "include/page_header.php"; check_fields($fields); ?> <?php - $denyed_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, PERM_MODE_LT, PERM_RES_IDS_ARRAY); - - $items = get_request('items', array()); + $available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, null, PERM_RES_IDS_ARRAY); + $items = get_request('items', array()); asort_by_key($items, 'sortorder'); - foreach($items as $gitem) - { - if( !($host = DBfetch(DBselect('select h.* from hosts h,items i where h.hostid=i.hostid and i.itemid='.$gitem['itemid']))) ) - { + foreach($items as $gitem){ + if(!$host=DBfetch(DBselect('SELECT h.* FROM hosts h,items i WHERE h.hostid=i.hostid AND i.itemid='.$gitem['itemid']))){ fatal_error(S_NO_ITEM_DEFINED); } - if(uint_in_array($host['hostid'], $denyed_hosts)) - { + if(!uint_in_array($host['hostid'], $available_hosts)){ access_deny(); } } $graph = new Pie(get_request("graphtype" ,GRAPH_TYPE_NORMAL)); - $graph->SetHeader($host["host"].":".get_request("name","")); $graph3d = get_request('graph3d',0); @@ -77,7 +72,7 @@ include_once "include/page_header.php"; if($graph3d == 1) $graph->SwitchPie3D(); $graph->SwitchLegend($legend); - unset($host, $denyed_hosts); + unset($host); if(isset($_REQUEST["period"])) $graph->SetPeriod($_REQUEST["period"]); if(isset($_REQUEST["from"])) $graph->SetFrom($_REQUEST["from"]); |
