diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-03-21 13:17:24 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-03-21 13:17:24 +0000 |
| commit | 8ef6917ea5eaae24bc2a15a06a99b3b1f24d1f35 (patch) | |
| tree | 86b9957c4a9a6c4da386064fb497a69cad9fad03 /frontends/php/include | |
| parent | 2547403188f63f0042a15aff4d17e04e2e80d715 (diff) | |
- added quick help for overview (Eugene)
- developed Dicovery system (Alexei/Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3904 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
| -rw-r--r-- | frontends/php/include/classes/chelp.inc.php | 15 | ||||
| -rw-r--r-- | frontends/php/include/classes/ctag.inc.php | 4 | ||||
| -rw-r--r-- | frontends/php/include/classes/ctriggerinfo.mod.php | 2 | ||||
| -rw-r--r-- | frontends/php/include/config.inc.php | 12 | ||||
| -rw-r--r-- | frontends/php/include/defines.inc.php | 5 | ||||
| -rw-r--r-- | frontends/php/include/locales/en_gb.inc.php | 6 | ||||
| -rw-r--r-- | frontends/php/include/page_header.php | 73 |
7 files changed, 87 insertions, 30 deletions
diff --git a/frontends/php/include/classes/chelp.inc.php b/frontends/php/include/classes/chelp.inc.php index 310c3286..0f11ab19 100644 --- a/frontends/php/include/classes/chelp.inc.php +++ b/frontends/php/include/classes/chelp.inc.php @@ -22,10 +22,21 @@ class CHelp extends CLink { /* public */ - function CHelp($url="index.php") + function CHelp($url="index.php",$side=null) { + if(is_null($side)) $side = 'right'; + if($side == 'right') + { + $pside = 'left'; + } + else + { + $side = 'left'; + $pside = 'right'; + } + parent::CLink(new CImg('images/general/help.gif','?'), 'http://www.zabbix.com/manual/v1.1/'.$url); - $this->options['style'] = 'float:right'; + $this->options['style'] = 'padding-'.$pside.': 5px; float:'.$side; $this->options['target'] = '_blank'; } } diff --git a/frontends/php/include/classes/ctag.inc.php b/frontends/php/include/classes/ctag.inc.php index df7d91ae..70decbfc 100644 --- a/frontends/php/include/classes/ctag.inc.php +++ b/frontends/php/include/classes/ctag.inc.php @@ -218,7 +218,7 @@ { insert_showhint_javascript(); - $text = addslashes(htmlspecialchars($text)); + $text = addslashes(htmlspecialchars(unpack_object($text))); if($width != '' || $class!= '') { $code = "show_hint_ext(this,event,'".$text."','".$width."','".$class."');"; @@ -229,7 +229,7 @@ } $this->AddAction('onMouseOver', $code); - $this->AddAction('onMouseMove', $code); + $this->AddAction('onMouseMove', 'update_hint(this,event);'); } function OnClick($handle_code) diff --git a/frontends/php/include/classes/ctriggerinfo.mod.php b/frontends/php/include/classes/ctriggerinfo.mod.php index 89481990..0f9c4b20 100644 --- a/frontends/php/include/classes/ctriggerinfo.mod.php +++ b/frontends/php/include/classes/ctriggerinfo.mod.php @@ -70,7 +70,7 @@ " and i.status=".ITEM_STATUS_ACTIVE. ' and h.hostid in ('.get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_ONLY, null, null, $this->nodeid).') '. - " group by priority"); + " group by priority,t.value"); while($row=DBfetch($db_priority)) { switch($row["value"]) diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index ed817d42..012a0566 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -1531,6 +1531,18 @@ function show_hint_ext(obj, e, hint_text, width, class_name) obj.onmouseout = hide_hint; } +function update_hint(obj, e) +{ + if(!hint_box) return; + + var cursor = get_cursor_position(e); + + var pos = GetPos(obj); + + hint_box.style.left = cursor.x + 10 + "px"; + hint_box.style.top = hint_box.y + obj.offsetHeight + "px"; +} + function create_hint_box() { if(hint_box) return; diff --git a/frontends/php/include/defines.inc.php b/frontends/php/include/defines.inc.php index 8583fcf0..c7dd3d2c 100644 --- a/frontends/php/include/defines.inc.php +++ b/frontends/php/include/defines.inc.php @@ -327,6 +327,9 @@ define('DRULE_STATUS_ACTIVE', 0); define('DRULE_STATUS_DISABLED', 1); + define('DSVC_STATUS_ACTIVE', 0); + define('DSVC_STATUS_DISABLED', 1); + define('SVC_SSH', 0); define('SVC_LDAP', 1); define('SVC_SMTP', 2); @@ -337,6 +340,8 @@ define('SVC_IMAP', 7); define('SVC_TCP', 8); + define('DHOST_STATUS_ACTIVE', 0); + define('DHOST_STATUS_DISABLED', 1); define("BR", "<br/>\n"); define("SPACE", " "); diff --git a/frontends/php/include/locales/en_gb.inc.php b/frontends/php/include/locales/en_gb.inc.php index b700e228..30bc8013 100644 --- a/frontends/php/include/locales/en_gb.inc.php +++ b/frontends/php/include/locales/en_gb.inc.php @@ -74,6 +74,8 @@ 'S_CANNOT_UPDATE_DISCOVERY_RULE'=> 'Cannot update discovery rule', 'S_DISCOVERY_RULE_ADDED'=> 'Discovery rule added', 'S_CANNOT_ADD_DISCOVERY_RULE'=> 'Cannot add discovery rule', + 'S_STATUS_OF_DISCOVERY_BIG'=> 'STATUS OF DISCOVERY', + 'S_STATUS_OF_DISCOVERY'=> 'Status of discovery', // httpdetails.php "S_DETAILS_OF_SCENARIO"=> "Details of scenario", @@ -843,6 +845,8 @@ "S_SHOW_GRAPH_OF_ITEM"=> "Show graph of item", "S_SHOW_VALUES_OF_ITEM"=> "Show values of item", "S_VALUES"=> "Values", + "S_5_MIN"=> "5 min", + "S_15_MIN"=> "15 min", // queue.php "S_QUEUE_BIG"=> "QUEUE", @@ -1054,12 +1058,14 @@ // srv_status.php "S_IT_SERVICES_BIG"=> "IT SERVICES", "S_SERVICE"=> "Service", + "S_SERVICES"=> "Services", "S_REASON"=> "Reason", "S_SLA_LAST_7_DAYS"=> "SLA (last 7 days)", "S_PLANNED_CURRENT_SLA"=> "Planned/current SLA", "S_TRIGGER_BIG"=> "TRIGGER", // triggers.php + "S_NO_TRIGGER"=> "No trigger", "S_NO_TRIGGERS_DEFINED"=> "No triggers defined", "S_CONFIGURATION_OF_TRIGGERS"=> "Configuration of triggers", "S_CONFIGURATION_OF_TRIGGERS_BIG"=> "CONFIGURATION OF TRIGGERS", diff --git a/frontends/php/include/page_header.php b/frontends/php/include/page_header.php index 7b6d8d93..3d5d568b 100644 --- a/frontends/php/include/page_header.php +++ b/frontends/php/include/page_header.php @@ -110,6 +110,7 @@ COpt::profiling_start("page"); $ZBX_MENU = array( "view"=>array( "label" => S_MONITORING, + "node_perm" => PERM_READ_LIST, "default_page_id" => 0, "pages"=>array( array("url"=>"overview.php" ,"label"=>S_OVERVIEW ), @@ -133,6 +134,7 @@ COpt::profiling_start("page"); "sub_pages"=>array("chart2.php") ), array("url"=>"screens.php" ,"label"=>S_SCREENS ), + array("url"=>"discovery.php" ,"label"=>S_DISCOVERY , "user_type"=>USER_TYPE_ZABBIX_ADMIN), array("url"=>"srv_status.php" ,"label"=>S_IT_SERVICES , "sub_pages"=>array("report3.php","chart_sla.php","chart5.php") ), @@ -142,6 +144,7 @@ COpt::profiling_start("page"); ), "cm"=>array( "label" => S_INVENTORY, + "node_perm" => PERM_READ_LIST, "default_page_id" => 0, "pages"=>array( array("url"=>"hostprofiles.php" ,"label"=>S_HOSTS ) @@ -149,6 +152,7 @@ COpt::profiling_start("page"); ), "reports"=>array( "label" => S_REPORTS, + "node_perm" => PERM_READ_LIST, "default_page_id" => 0, "pages"=>array( array("url"=>"report1.php", "label"=>S_STATUS_OF_ZABBIX ), @@ -158,6 +162,8 @@ COpt::profiling_start("page"); ), "config"=>array( "label" => S_CONFIGURATION, + "user_type" => USER_TYPE_ZABBIX_ADMIN, + "node_perm" => PERM_READ_LIST, "default_page_id" => 0, "pages"=>array( array("url"=>"config.php" ,"label"=>S_GENERAL , @@ -189,6 +195,8 @@ COpt::profiling_start("page"); ), "admin"=>array( "label" => S_ADMINISTRATION, + "user_type" => USER_TYPE_SUPER_ADMIN, + "node_perm" => PERM_READ_WRITE, "default_page_id" => 1, "pages"=>array( ZBX_DISTRIBUTED ? array("url"=>"nodes.php" ,"label"=>S_NODES) : null , @@ -219,42 +227,59 @@ COpt::profiling_start("page"); foreach($ZBX_MENU as $label=>$sub) { -// Check permissions +// Check permissions for main menu unset($deny); if(!defined('ZBX_PAGE_NO_AUTHERIZATION')) { - if($label!='login' && !isset($USER_DETAILS['type'])) + if(isset($sub['user_type'])) { - $deny = true; + if($USER_DETAILS['type'] < $sub['user_type']) + $deny = true; } - elseif($label=='admin' && (!in_array($USER_DETAILS['type'], array(USER_TYPE_SUPER_ADMIN)) || - !in_array($ZBX_CURNODEID, get_accessible_nodes_by_user( - $USER_DETAILS,PERM_READ_WRITE,null, - PERM_RES_IDS_ARRAY,$ZBX_CURNODEID)))) - { - $deny = true; - } - elseif($label=='config' && ( - !in_array($USER_DETAILS['type'], array(USER_TYPE_SUPER_ADMIN, USER_TYPE_ZABBIX_ADMIN)) || - !in_array($ZBX_CURNODEID, get_accessible_nodes_by_user( - $USER_DETAILS,PERM_READ_LIST,null, - PERM_RES_IDS_ARRAY,$ZBX_CURNODEID)))) + + if(isset($sub['node_perm'])) { - $deny = true; - } - elseif($label!='login' && !in_array($ZBX_CURNODEID, get_accessible_nodes_by_user( - $USER_DETAILS,PERM_READ_LIST,null, + if(!in_array($ZBX_CURNODEID,get_accessible_nodes_by_user( + $USER_DETAILS,$sub['node_perm'],null, PERM_RES_IDS_ARRAY,$ZBX_CURNODEID))) + $deny = true; + } + + if($label=='login') { - $deny = true; + unset($deny); } } -// End of check permissions +// End of main menu permissions checking unset($menu_url); foreach($sub['pages'] as $id => $sub_pages) { + if(!defined('ZBX_PAGE_NO_AUTHERIZATION')) + { + if(isset($sub_pages['user_type'])) + { + if($USER_DETAILS['type'] < $sub_pages['user_type']) + { + unset($sub['pages'][$id]); + continue; + } + } + + if(isset($sub_pages['node_perm'])) + { + if(!in_array($ZBX_CURNODEID,get_accessible_nodes_by_user( + $USER_DETAILS,$sub_pages['node_perm'],null, + PERM_RES_IDS_ARRAY,$ZBX_CURNODEID))) + { + unset($sub['pages'][$id]); + continue; + } + } + } + + if(isset($page_exist)) continue; if($page['file'] == $sub_pages['url']) { @@ -263,7 +288,7 @@ COpt::profiling_start("page"); $menu_url = $sub_pages['url']; } $page_exist = true; - break; + $sub['pages'][$id]['active'] = true; /* mark as active */ } else if(isset($sub_pages['sub_pages'])) { @@ -274,15 +299,13 @@ COpt::profiling_start("page"); $menu_url = $sub_pages['url']; } $page_exist = true; - break; + $sub['pages'][$id]['active'] = true; /* mark as active */ } } } if(isset($menu_url)) /* active menu */ { - $sub['pages'][$id]['active'] = true; /* mark as active */ - $class = "active"; update_profile('web.menu.'.$label.'.last', $menu_url); |
