From b8f82cd79a58fc7a7830c517d473c445ab69d2f4 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 2 Dec 2007 05:34:18 +0000 Subject: Only show menu subitems that the user has access to. --- usr/local/www/fbegin.inc | 154 +++++++++++++++++++++++++++-------------------- 1 file changed, 89 insertions(+), 65 deletions(-) (limited to 'usr/local/www/fbegin.inc') diff --git a/usr/local/www/fbegin.inc b/usr/local/www/fbegin.inc index 5f2cc3f..e688d4e 100755 --- a/usr/local/www/fbegin.inc +++ b/usr/local/www/fbegin.inc @@ -1,6 +1,6 @@
System
  • Interfaces
    @@ -152,40 +156,40 @@ if ($_REQUEST['noticeaction'] == 'acknowledge') {
  • Firewall
  • Services
  • VPN
  • @@ -193,24 +197,25 @@ if ($_REQUEST['noticeaction'] == 'acknowledge') {
    Status
    @@ -233,22 +238,22 @@ if ($_REQUEST['noticeaction'] == 'acknowledge') {
  • Diagnostics
  • @@ -282,6 +287,25 @@ if ($_REQUEST['noticeaction'] == 'acknowledge') { echo ""; echo ""; } + + $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']; + +function output_menu_item($url, $name) { + global $auth_user, $groupindex, $userindex, $allowed, $HTTP_SERVER_VARS; + if (!isSystemAdmin($HTTP_SERVER_VARS['AUTH_USER'])) + if (!in_array(basename($url), $allowed)) + return; + echo "
  • {$name}
  • \n"; +} ?> -- cgit v1.1