summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/page_header.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-12-11 15:10:54 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-12-11 15:10:54 +0000
commitb94a78202aa03da273e83887656eb8694a87bffa (patch)
tree96a088277c80a86e888e2d0c095470fe754f1852 /frontends/php/include/page_header.php
parent0ae3511add8cfd69b881885a82f646351bf2214c (diff)
downloadzabbix-b94a78202aa03da273e83887656eb8694a87bffa.tar.gz
zabbix-b94a78202aa03da273e83887656eb8694a87bffa.tar.xz
zabbix-b94a78202aa03da273e83887656eb8694a87bffa.zip
- fixed master node adding (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3594 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/page_header.php')
-rw-r--r--frontends/php/include/page_header.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/frontends/php/include/page_header.php b/frontends/php/include/page_header.php
index 487b06c2..9433ee8a 100644
--- a/frontends/php/include/page_header.php
+++ b/frontends/php/include/page_header.php
@@ -24,8 +24,7 @@
global $USER_DETAILS;
- global $ZBX_CURNODEID;
- global $ZBX_LOCALNODEID;
+ global $ZBX_LOCALNODEID, $ZBX_LOCMASTERID;
global $page;
COpt::profiling_start("page");
@@ -59,19 +58,30 @@ COpt::profiling_start("page");
process_locales();
/* Init CURRENT NODE ID */
+ global $ZBX_CURNODEID, $ZBX_CURMASTERID;
+
if(!defined('ZBX_PAGE_NO_AUTHERIZATION') && ZBX_DISTRIBUTED)
{
$ZBX_CURNODEID = get_cookie('current_nodeid', $ZBX_LOCALNODEID); // Selected node
if(isset($_REQUEST['switch_node']))
{
- if(DBfetch(DBselect("select nodeid from nodes where nodeid=".$_REQUEST['switch_node'])))
+ if($node_data = DBfetch(DBselect("select * from nodes where nodeid=".$_REQUEST['switch_node'])))
+ {
$ZBX_CURNODEID = $_REQUEST['switch_node'];
+ }
+ unset($node_data);
+ }
+
+ if($node_data = DBfetch(DBselect("select * from nodes where nodeid=".$ZBX_CURNODEID)))
+ {
+ $ZBX_CURMASTERID = $node_data['masterid'];
}
if(count(get_accessible_nodes_by_user($USER_DETAILS,PERM_READ_LIST,null,PERM_RES_IDS_ARRAY,$ZBX_CURNODEID)) <= 0)
{
$denyed_page_requested = true;
$ZBX_CURNODEID = $ZBX_LOCALNODEID;
+ $ZBX_CURMASTERID = $ZBX_LOCMASTERID;
}
zbx_setcookie("current_nodeid",$ZBX_CURNODEID);
@@ -79,6 +89,7 @@ COpt::profiling_start("page");
else
{
$ZBX_CURNODEID = $ZBX_LOCALNODEID;
+ $ZBX_CURMASTERID = $ZBX_LOCMASTERID;
}
switch($page["type"])