summaryrefslogtreecommitdiffstats
path: root/frontends/php/chart3.php
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/php/chart3.php')
-rw-r--r--frontends/php/chart3.php14
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"]);