diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-10-23 07:34:27 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-10-23 07:34:27 +0000 |
| commit | 28a09ed13e41ddbe5e30d63e92a1f5fb3395ef89 (patch) | |
| tree | 8281ccd48964ee0dd11c5ea689091fa3cef706fb /frontends/php/chart.php | |
| parent | 495799b2aa61aab23d74d7faa110a0cd09d59bf0 (diff) | |
| download | zabbix-28a09ed13e41ddbe5e30d63e92a1f5fb3395ef89.tar.gz zabbix-28a09ed13e41ddbe5e30d63e92a1f5fb3395ef89.tar.xz zabbix-28a09ed13e41ddbe5e30d63e92a1f5fb3395ef89.zip | |
- developed group permission system (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3371 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/chart.php')
| -rw-r--r-- | frontends/php/chart.php | 63 |
1 files changed, 41 insertions, 22 deletions
diff --git a/frontends/php/chart.php b/frontends/php/chart.php index 7729d095..e0e0d243 100644 --- a/frontends/php/chart.php +++ b/frontends/php/chart.php @@ -19,32 +19,51 @@ **/ ?> <?php - include "include/config.inc.php"; - include "include/classes/graph.inc.php"; + require_once "include/config.inc.php"; + require_once "include/classes/graph.inc.php"; + + $page["file"] = "chart.php"; + $page["title"] = "S_CHART"; + $page["type"] = PAGE_TYPE_IMAGE; - $graph=new Graph(); - if(isset($_REQUEST["period"])) - { - $graph->setPeriod($_REQUEST["period"]); - } - if(isset($_REQUEST["from"])) - { - $graph->setFrom($_REQUEST["from"]); - } - if(isset($_REQUEST["width"])) - { - $graph->setWidth($_REQUEST["width"]); - } - if(isset($_REQUEST["height"])) - { - $graph->setHeight($_REQUEST["height"]); - } - if(isset($_REQUEST["border"])) +include_once "include/page_header.php"; + +?> +<?php +// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION + $fields=array( + "itemid"=> array(T_ZBX_INT, O_MAND,P_SYS, DB_ID, null), + "period"=> array(T_ZBX_INT, O_OPT, null, BETWEEN(3600,365*24*3600), null), + "from"=> array(T_ZBX_INT, O_OPT, null, '{}>=0', null), + "width"=> array(T_ZBX_INT, O_OPT, null, '{}>0', null), + "height"=> array(T_ZBX_INT, O_OPT, null, '{}>0', null), + "border"=> array(T_ZBX_INT, O_OPT, null, IN('0,1'), null) + ); + + check_fields($fields); +?> +<?php + if(! ($db_data = DBfetch(DBselect("select i.itemid from items i ". + " where i.hostid in (".get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_ONLY).") ". + " and i.itemid=".$_REQUEST["itemid"])))) { - $graph->setBorder(0); + access_deny(); } - $graph->addItem($_REQUEST["itemid"], GRAPH_YAXIS_SIDE_RIGHT, CALC_FNC_ALL); + + $graph = new Graph(); + + if(isset($_REQUEST["period"])) $graph->SetPeriod($_REQUEST["period"]); + if(isset($_REQUEST["from"])) $graph->SetFrom($_REQUEST["from"]); + if(isset($_REQUEST["width"])) $graph->SetWidth($_REQUEST["width"]); + if(isset($_REQUEST["height"])) $graph->SetHeight($_REQUEST["height"]); + if(isset($_REQUEST["border"])) $graph->SetBorder(0); + + $graph->AddItem($_REQUEST["itemid"], GRAPH_YAXIS_SIDE_RIGHT, CALC_FNC_ALL); $graph->Draw(); ?> +<?php +include_once "include/page_footer.php"; + +?> |
