diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-01-10 14:08:01 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-01-10 14:08:01 +0000 |
| commit | a2183b603aa79005e2c01c41a9e04d719266832e (patch) | |
| tree | 856ae6cb71128b83a9664e74bd0a45f865f527c9 /frontends/php/include/config.inc.php | |
| parent | 370568ec852e6db2190a16d51f4d24abdb17651e (diff) | |
- added login/logout information into auditlog (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3685 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/config.inc.php')
| -rw-r--r-- | frontends/php/include/config.inc.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 665329be..b97e12c5 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -152,6 +152,45 @@ function VDP($var, $msg=null) { echo "DEBUG DUMP: "; if(isset($msg)) echo '"'.$m /********** END INITIALIZATION ************/ + function init_nodes() + { + /* Init CURRENT NODE ID */ + global $ZBX_LOCALNODEID, $ZBX_LOCMASTERID; + 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($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); + } + else + { + $ZBX_CURNODEID = $ZBX_LOCALNODEID; + $ZBX_CURMASTERID = $ZBX_LOCMASTERID; + } + } + function access_deny() { include_once "include/page_header.php"; |
