summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-12-03 01:46:04 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-12-03 01:46:04 +0000
commitf29117399b13880679e80ceda429ef66198c1465 (patch)
treecc3a3896a098529b610ce101d132ccc45c6c7bb2 /etc
parentcd0e6d73b8506e2de1eac0128044b6b0410cd4cf (diff)
downloadpfsense-f29117399b13880679e80ceda429ef66198c1465.zip
pfsense-f29117399b13880679e80ceda429ef66198c1465.tar.gz
Do not set allowed_groups variables. Auth.inc is not alaways available on console scripts but they do not need session auth.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/pfsense-utils.inc21
1 files changed, 10 insertions, 11 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 265dbca..0b4c466 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -33,12 +33,6 @@
*
*/
-
-if(!$groupindex)
- $groupindex = index_groups();
-if(!$userindex)
- $userindex = index_users();
-
/****f* pfsense-utils/does_url_exist
* NAME
* does_url_exist
@@ -2151,17 +2145,20 @@ 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();
- $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'];
+ 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.
@@ -2185,6 +2182,8 @@ function display_top_tabs(& $tab_array) {
$pos_qmark = strpos($link, "?");
$link = substr($link, 0, $pos_qmark);
}
+ $authorized_text = print_r($allowed, true);
+ log_error("comparing " . basename($link) . " {$authorized_text}");
if (in_array(basename($link), $authorized))
$tab_temp[] = $ta;
}
OpenPOWER on IntegriCloud