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/chart3.php | |
parent | 82e68eabae069748d6691cab742f5fde436a56cb (diff) | |
download | zabbix-908fda905acd739d8d2376ffb33f7e5a63faf26c.tar.gz zabbix-908fda905acd739d8d2376ffb33f7e5a63faf26c.tar.xz zabbix-908fda905acd739d8d2376ffb33f7e5a63faf26c.zip |
- improvements in permissions (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5577 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/chart3.php')
-rw-r--r-- | frontends/php/chart3.php | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/frontends/php/chart3.php b/frontends/php/chart3.php index 54d69938..f75737cb 100644 --- a/frontends/php/chart3.php +++ b/frontends/php/chart3.php @@ -51,20 +51,16 @@ 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); + $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(); } } @@ -73,7 +69,7 @@ include_once "include/page_header.php"; $graph->SetHeader($host["host"].":".get_request("name","")); - unset($host, $denyed_hosts); + unset($host); if(isset($_REQUEST["period"])) $graph->SetPeriod($_REQUEST["period"]); if(isset($_REQUEST["from"])) $graph->SetFrom($_REQUEST["from"]); |