From 3aae364d67669bb61c04bf2ad42475968b6882ca Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 3 Dec 2007 01:49:59 +0000 Subject: Inherit allowed privs from $g['privs'] --- etc/inc/pfsense-utils.inc | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 0b4c466..7a684e6 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -2145,21 +2145,9 @@ function get_disk_info() { function display_top_tabs(& $tab_array) { global $HTTP_SERVER_VARS; global $config; - global $allowed; - - $auth_user = $HTTP_SERVER_VARS['AUTH_USER']; - - $groupindex = index_groups(); - $userindex = index_users(); + global $g; + $allowed = $g['privs']; - if(!$allowed) { - $allowed = array (); - $allowed[] = ''; - if (isset($config['system']['group'][$groupindex[$config['system']['user'][$userindex[$HTTP_SERVER_VARS['AUTH_USER']]]['groupname']]]['pages'])) { - $allowed = &$config['system']['group'][$groupindex[$config['system']['user'][$userindex[$HTTP_SERVER_VARS['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 @@ -3841,7 +3829,7 @@ function is_fqdn($fqdn) { if(preg_match("/\.\./", $fqdn)) { $hostname = false; } - if(preg_match("/^\./i", $fqdn)) { + if(preg_match("/^\./i", $fqdn)) { $hostname = false; } if(preg_match("/\//i", $fqdn)) { -- cgit v1.1