diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-09-18 15:50:47 -0400 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-09-18 15:51:17 -0400 |
commit | da4a4b9f556c3b374c361513684ad4ca4c44ffcc (patch) | |
tree | d2c4ab392e92d26e65f191f358b8a003893d29bf /src/usr/local/www/head.inc | |
parent | d17f9289fe900cd0e3d4add6f765cb036b5a17da (diff) | |
download | pfsense-da4a4b9f556c3b374c361513684ad4ca4c44ffcc.zip pfsense-da4a4b9f556c3b374c361513684ad4ca4c44ffcc.tar.gz |
Fixed #5160
Diffstat (limited to 'src/usr/local/www/head.inc')
-rwxr-xr-x | src/usr/local/www/head.inc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/usr/local/www/head.inc b/src/usr/local/www/head.inc index 85603e3..e023cd8 100755 --- a/src/usr/local/www/head.inc +++ b/src/usr/local/www/head.inc @@ -116,13 +116,22 @@ $helpurl .= "{$g['help_base_url']}?page={$pagename}"; function return_ext_menu($section) { global $config; + $htmltext = ""; $extarray = array(); - if ($config['installedpackages']['menu'] != "") { - foreach ($config['installedpackages']['menu'] as $menuitem) { - if ($menuitem['section'] != $section) { + + if (!empty($config['installedpackages']['package'])) { + foreach ($config['installedpackages']['package'] as $package) { + + if ($package['category'] != $section) { continue; } + + // A package has been found that matches the specified category. We need to read it's config file + $pkg_config = parse_xml_config_pkg("/usr/local/pkg/" . $package['configurationfile'], "packagegui"); + + $menuitem = $pkg_config['menu'][0]; + if ($menuitem['url'] != "") { $test_url=$menuitem['url']; $addresswithport = getenv("HTTP_HOST"); @@ -138,9 +147,11 @@ function return_ext_menu($section) { $description = '/pkg.php?xml=' . $menuitem['configfile']; $test_url=$description; } + if (isAllowedPage($test_url)) { - $extarray[] = array($menuitem['name'], $description); + $extarray[] = array($pkg_config['name'], $description); } + } } return $extarray; @@ -184,6 +195,7 @@ if (!isAllowedPage("system_usermanager.php*")) { } else { $system_menu[] = array(gettext("User Manager"), "/system_usermanager.php"); } + $system_menu = msort(array_merge($system_menu, return_ext_menu("System")), 0); // Interfaces |