From 30c8cd36b605913558d8c86e5fbd5395320f65ee Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 2 Dec 2007 03:14:41 +0000 Subject: Kill off illegal offsets error and make code more readable while I am here. --- etc/inc/pfsense-utils.inc | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index ce2a6d8..c2e04a6 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -2151,17 +2151,25 @@ function get_disk_info() { function display_top_tabs(& $tab_array) { global $HTTP_SERVER_VARS; global $config; + + $auth_user = $HTTP_SERVER_VARS['AUTH_USER']; $groupindex = index_groups(); $userindex = index_users(); - $allowed = array (); + $auth_user_index = $userindex[$auth_user]; + $auth_user_group_index = $groupindex[$config['system']['user'][$auth_user_index]['groupname']]; - $allowed[] = ''; - if (!isSystemAdmin($HTTP_SERVER_VARS['AUTH_USER']) && isset ($config['system']['group'][$groupindex[$config['system']['user'][$userindex[$HTTP_SERVER_VARS['AUTH_USER']]]['groupname']]]['pages'][0]['page'])) { - $allowed = & $config['system']['group'][$groupindex[$config['system']['user'][$userindex[$HTTP_SERVER_VARS['AUTH_USER']]]['groupname']]]['pages'][0]['page']; - } + print_r($groupindex); + print_r($userindex); + print_r($HTTP_SERVER_VARS); + $allowed = array (); + $allowed[] = ''; + if (!isSystemAdmin($HTTP_SERVER_VARS['AUTH_USER'])) + if (isset($config['system']['group'][$groupindex[$config['system']['user'][$userindex[$auth_user]]['groupname']]]['pages'])) + $allowed = &$config['system']['group'][$groupindex[$config['system']['user'][$userindex[$auth_user]]['groupname']]]['pages']; + /* does the user have access to this tab? * master user has access to everything. * if the user does not have access, simply -- cgit v1.1