From b7aa4f7a3c8bce0ec87834a009ead31b3df9d92c Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Mon, 18 Jun 2012 15:16:17 +0000 Subject: [PATCH] 2012-06-18 Sergio Martin * include/functions_menu.php index.php operation/menu.php godmode/menu.php: Added functions to manage sec and sec2 to control access in ACLs. Rename variables in menu construction to can get all the sata structures in other sections Merged from 4.0.2 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6574 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 10 ++ pandora_console/godmode/menu.php | 128 ++++++++++----------- pandora_console/include/functions_menu.php | 96 ++++++++++++++++ pandora_console/index.php | 2 +- pandora_console/operation/menu.php | 106 ++++++++--------- 5 files changed, 224 insertions(+), 118 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index df1312cbd5..f33ac3a51c 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,13 @@ +2012-06-18 Sergio Martin + + * include/functions_menu.php + index.php + operation/menu.php + godmode/menu.php: Added functions to manage sec and sec2 to control + access in ACLs. Rename variables in menu construction to can get + all the sata structures in other sections + Merged from 4.0.2 + 2012-06-18 Vanessa Gil * include/functions_config.php: Fixed bug: Notice to change diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 55ffa4c7ce..609be6e1db 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -21,13 +21,13 @@ check_login (); enterprise_include ('godmode/menu.php'); require_once ('include/functions_menu.php'); -$menu = array (); -$menu['class'] = 'godmode'; +$menu_godmode = array (); +$menu_godmode['class'] = 'godmode'; if (check_acl ($config['id_user'], 0, "AW") and ($config['metaconsole'] == 0)) { - $menu["gagente"]["text"] = __('Manage monitoring'); - $menu["gagente"]["sec2"] = "godmode/agentes/modificar_agente"; - $menu["gagente"]["id"] = "god-agents"; + $menu_godmode["gagente"]["text"] = __('Manage monitoring'); + $menu_godmode["gagente"]["sec2"] = "godmode/agentes/modificar_agente"; + $menu_godmode["gagente"]["id"] = "god-agents"; $sub = array (); $sub['godmode/agentes/modificar_agente']['text'] = __('Manage agents'); @@ -44,13 +44,13 @@ if (check_acl ($config['id_user'], 0, "AW") and ($config['metaconsole'] == 0)) { } enterprise_hook('agents_submenu'); - $menu["gagente"]["sub"] = $sub; + $menu_godmode["gagente"]["sub"] = $sub; } if (check_acl ($config['id_user'], 0, "AW") and ($config['metaconsole'] == 0)) { - $menu["gmassive"]["text"] = __('Massive operations'); - $menu["gmassive"]["sec2"] = "godmode/massive/massive_operations"; - $menu["gmassive"]["id"] = "god-massive"; + $menu_godmode["gmassive"]["text"] = __('Massive operations'); + $menu_godmode["gmassive"]["sec2"] = "godmode/massive/massive_operations"; + $menu_godmode["gmassive"]["id"] = "god-massive"; $sub = array (); $sub["godmode/massive/massive_operations&tab=massive_agents"]["text"] = __('Agents operations'); @@ -61,7 +61,7 @@ if (check_acl ($config['id_user'], 0, "AW") and ($config['metaconsole'] == 0)) { $sub["godmode/massive/massive_operations&tab=massive_alerts"]["text"] = __('Alerts operations'); enterprise_hook('massivepolicies_submenu'); - $menu["gmassive"]["sub"] = $sub; + $menu_godmode["gmassive"]["sub"] = $sub; } /* @@ -71,9 +71,9 @@ if (check_acl ($config['id_user'], 0, "AW")) { */ if (check_acl ($config['id_user'], 0, "PM") and ($config['metaconsole'] == 0)) { - $menu["gmodules"]["text"] = __('Manage modules'); - $menu["gmodules"]["sec2"] = "godmode/modules/manage_network_templates"; - $menu["gmodules"]["id"] = "god-modules"; + $menu_godmode["gmodules"]["text"] = __('Manage modules'); + $menu_godmode["gmodules"]["sec2"] = "godmode/modules/manage_network_templates"; + $menu_godmode["gmodules"]["id"] = "god-modules"; $sub = array (); $sub["godmode/modules/manage_nc_groups"]["text"] = __('Component groups'); @@ -88,13 +88,13 @@ if (check_acl ($config['id_user'], 0, "PM") and ($config['metaconsole'] == 0)) { $sub["godmode/modules/module_list"]["text"] = __('Module types'); - $menu["gmodules"]["sub"] = $sub; + $menu_godmode["gmodules"]["sub"] = $sub; } if (check_acl ($config['id_user'], 0, "LM") and ($config['metaconsole'] == 0)) { - $menu["galertas"]["text"] = __('Manage alerts'); - $menu["galertas"]["sec2"] = "godmode/alerts/alert_list"; - $menu["galertas"]["id"] = "god-alerts"; + $menu_godmode["galertas"]["text"] = __('Manage alerts'); + $menu_godmode["galertas"]["sec2"] = "godmode/alerts/alert_list"; + $menu_godmode["galertas"]["id"] = "god-alerts"; $sub = array (); $sub["godmode/alerts/alert_templates"]["text"] = __('Templates'); @@ -107,7 +107,7 @@ if (check_acl ($config['id_user'], 0, "LM") and ($config['metaconsole'] == 0)) { $sub["godmode/alerts/alert_special_days"]["text"] = __('Special days list'); enterprise_hook('eventalerts_submenu'); - $menu["galertas"]["sub"] = $sub; + $menu_godmode["galertas"]["sub"] = $sub; } if (check_acl ($config['id_user'], 0, "AW") and ($config['metaconsole'] == 0)) { @@ -115,51 +115,51 @@ if (check_acl ($config['id_user'], 0, "AW") and ($config['metaconsole'] == 0)) { } if (check_acl ($config['id_user'], 0, "UM") and ($config['metaconsole'] == 0)) { - $menu["gusuarios"]["text"] = __('Manage users'); - $menu["gusuarios"]["sec2"] = "godmode/users/user_list"; - $menu["gusuarios"]["id"] = "god-users"; + $menu_godmode["gusuarios"]["text"] = __('Manage users'); + $menu_godmode["gusuarios"]["sec2"] = "godmode/users/user_list"; + $menu_godmode["gusuarios"]["id"] = "god-users"; $sub = array (); $sub['godmode/users/profile_list']['text'] = __('Manage profiles'); - $menu["gusuarios"]["sub"] = $sub; + $menu_godmode["gusuarios"]["sub"] = $sub; } // GIS if (check_acl ($config['id_user'], 0, "IW") and ($config['metaconsole'] == 0)) { if ($config['activate_gis']) { - $menu["godgismaps"]["text"] = __('GIS Maps builder'); - $menu["godgismaps"]["sec2"] = "godmode/gis_maps/index"; + $menu_godmode["godgismaps"]["text"] = __('GIS Maps builder'); + $menu_godmode["godgismaps"]["sec2"] = "godmode/gis_maps/index"; if (!empty($config['refr'])){ - $menu["godgismaps"]["refr"] = $config['refr']; + $menu_godmode["godgismaps"]["refr"] = $config['refr']; } else{ - $menu["godgismaps"]["refr"] = 60; + $menu_godmode["godgismaps"]["refr"] = 60; } - $menu["godgismaps"]["id"] = "god-gismaps"; + $menu_godmode["godgismaps"]["id"] = "god-gismaps"; } } if (check_acl ($config['id_user'], 0, "IW") and ($config['metaconsole'] == 0)) { // Manage events - $menu["geventos"]["text"] = __('Manage events'); - $menu["geventos"]["sec2"] = "godmode/events/events&section=filter"; - $menu["geventos"]["id"] = "god-events"; + $menu_godmode["geventos"]["text"] = __('Manage events'); + $menu_godmode["geventos"]["sec2"] = "godmode/events/events&section=filter"; + $menu_godmode["geventos"]["id"] = "god-events"; // Custom event fields $sub = array (); $sub["godmode/events/events&section=fields"]["text"] = __('Custom events'); - $menu["geventos"]["sub"] = $sub; + $menu_godmode["geventos"]["sub"] = $sub; } if (check_acl ($config['id_user'], 0, "AW") and ($config['metaconsole'] == 0)) { // Servers - $menu["gservers"]["text"] = __('Manage servers'); - $menu["gservers"]["sec2"] = "godmode/servers/modificar_server"; - $menu["gservers"]["id"] = "god-servers"; + $menu_godmode["gservers"]["text"] = __('Manage servers'); + $menu_godmode["gservers"]["sec2"] = "godmode/servers/modificar_server"; + $menu_godmode["gservers"]["id"] = "god-servers"; $sub = array (); $sub["godmode/servers/manage_recontask"]["text"] = __('Manage recontask'); @@ -173,7 +173,7 @@ if (check_acl ($config['id_user'], 0, "AW") and ($config['metaconsole'] == 0)) { enterprise_hook('export_target_submenu'); } - $menu["gservers"]["sub"] = $sub; + $menu_godmode["gservers"]["sub"] = $sub; } if (check_acl ($config['id_user'], 0, "LW") and ($config['metaconsole'] == 0)) { @@ -182,14 +182,14 @@ if (check_acl ($config['id_user'], 0, "LW") and ($config['metaconsole'] == 0)) { if (check_acl ($config['id_user'], 0, "PM")) { // Audit - $menu["glog"]["text"] = __('System audit log'); - $menu["glog"]["sec2"] = "godmode/admin_access_logs"; - $menu["glog"]["id"] = "god-audit"; + $menu_godmode["glog"]["text"] = __('System audit log'); + $menu_godmode["glog"]["sec2"] = "godmode/admin_access_logs"; + $menu_godmode["glog"]["id"] = "god-audit"; // Setup - $menu["gsetup"]["text"] = __('Setup'); - $menu["gsetup"]["sec2"] = "godmode/setup/setup"; - $menu["gsetup"]["id"] = "god-setup"; + $menu_godmode["gsetup"]["text"] = __('Setup'); + $menu_godmode["gsetup"]["sec2"] = "godmode/setup/setup"; + $menu_godmode["gsetup"]["id"] = "god-setup"; $sub = array (); @@ -209,28 +209,28 @@ if (check_acl ($config['id_user'], 0, "PM")) { enterprise_hook ('skins_submenu'); $sub["extras/pandora_diag"]["text"] = __('Diagnostic info'); - $menu["gsetup"]["sub"] = $sub; + $menu_godmode["gsetup"]["sub"] = $sub; } if (check_acl ($config['id_user'], 0, "AW") and ($config['metaconsole'] == 0)) { if ($config['activate_netflow']) { //Netflow - $menu["netf"]["text"] = __('Netflow'); - $menu["netf"]["sec2"] = "godmode/netflow/nf_report"; - $menu["netf"]["id"] = "god-netflow"; + $menu_godmode["netf"]["text"] = __('Netflow'); + $menu_godmode["netf"]["sec2"] = "godmode/netflow/nf_report"; + $menu_godmode["netf"]["id"] = "god-netflow"; $sub = array (); $sub["godmode/netflow/nf_edit"]["text"] = __('Filters'); $sub["godmode/netflow/nf_report"]["text"] = __('Manage reports'); - $menu["netf"]["sub"] = $sub; + $menu_godmode["netf"]["sub"] = $sub; } } if (check_acl ($config['id_user'], 0, "DM") and ($config['metaconsole'] == 0)) { - $menu["gdbman"]["text"] = __('DB maintenance'); - $menu["gdbman"]["sec2"] = "godmode/db/db_main"; - $menu["gdbman"]["id"] = "god-dbmaint"; + $menu_godmode["gdbman"]["text"] = __('DB maintenance'); + $menu_godmode["gdbman"]["sec2"] = "godmode/db/db_main"; + $menu_godmode["gdbman"]["id"] = "god-dbmaint"; $sub = array (); $sub["godmode/db/db_info"]["text"] = __('DB information'); @@ -240,14 +240,14 @@ if (check_acl ($config['id_user'], 0, "DM") and ($config['metaconsole'] == 0)) { $sub["godmode/db/db_event"]["text"] = __('Database event'); $sub["godmode/db/db_sanity"]["text"] = __('Database sanity'); - $menu["gdbman"]["sub"] = $sub; + $menu_godmode["gdbman"]["sub"] = $sub; } if (check_acl ($config['id_user'], 0, "PM")) { if (is_array ($config['extensions'])) { - $menu["gextensions"]["text"] = __('Extensions'); - $menu["gextensions"]["sec2"] = "godmode/extensions"; - $menu["gextensions"]["id"] = "god-extensions"; + $menu_godmode["gextensions"]["text"] = __('Extensions'); + $menu_godmode["gextensions"]["sec2"] = "godmode/extensions"; + $menu_godmode["gextensions"]["id"] = "god-extensions"; $sub = array (); foreach ($config['extensions'] as $extension) { @@ -271,30 +271,30 @@ if (check_acl ($config['id_user'], 0, "PM")) { if (array_key_exists('fatherId',$extmenu)) { // Check that extension father ID exists previously on the menu (only if metaconsole is activated) - if (strlen($extmenu['fatherId']) > 0 and (($config['metaconsole'] == 0) or (array_key_exists($extension_menu['fatherId'], $menu)))) { - $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["text"] = __($extmenu['name']); + if (strlen($extmenu['fatherId']) > 0 and (($config['metaconsole'] == 0) or (array_key_exists($extension_menu['fatherId'], $menu_godmode)))) { + $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["text"] = __($extmenu['name']); if ($extmenu["name"] != 'DB interface'){ if (!empty($config['refr'])){ - $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = $config['refr']; + $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = $config['refr']; } else{ - $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = 60; + $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = 60; } } - $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["icon"] = $extmenu['icon']; - $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["sec"] = 'gextensions'; - $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["extension"] = true; - $menu[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["enterprise"] = $extension['enterprise']; + $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["icon"] = $extmenu['icon']; + $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["sec"] = 'gextensions'; + $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["extension"] = true; + $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["enterprise"] = $extension['enterprise']; - $menu[$extmenu['fatherId']]['hasExtensions'] = true; + $menu_godmode[$extmenu['fatherId']]['hasExtensions'] = true; } } } } - $menu["gextensions"]["sub"] = $sub; + $menu_godmode["gextensions"]["sub"] = $sub; } } -menu_print_menu ($menu); +menu_print_menu ($menu_godmode); ?> diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index d3c4eb96be..fbd76f9da3 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -313,4 +313,100 @@ function menu_print_menu (&$menu) { echo '
  •  
'; } +/** + * Get all the data structure of menu. Operation and Godmode + * + * @return array Menu structure. + */ +function menu_get_full_sec() { + global $menu_operation; + global $menu_godmode; + + if($menu_godmode == null || $menu_operation == null) { + return array(); + } + else { + $menu = $menu_operation + $menu_godmode; + } + + unset($menu['class']); + + return $menu; +} + +/** + * Get the sec list built in menu + * + * @return array Sections list + */ +function menu_get_sec() { + $menu = menu_get_full_sec(); + unset($menu['class']); + + foreach($menu as $k => $v) { + $sec_array[$k] = $v['text']; + } + + return $sec_array; +} + +/** + * Get the pages in a section + * + * @param string sec code + * @param string menu hash. All the menu structure (For example + * returned by menu_get_full_sec(), json encoded and after that + * base64 encoded. If this value is false this data is obtained from + * menu_get_full_sec(); + * + * @return array Sections list + */ +function menu_get_sec_pages($sec,$menu_hash = false) { + if($menu_hash === false) { + $menu = menu_get_full_sec(); + } + else { + $menu = json_decode(base64_decode($menu_hash),true); + } + + foreach($menu[$sec]['sub'] as $k => $v) { + // Avoid special cases of standalone windows + if(preg_match('/^javascript:/',$k) || preg_match('/\.php/',$k)) { + continue; + } + + // If this value has various parameters, we only get the first + $k = explode('&',$k); + $k = $k[0]; + + $sec2_array[$k] = $v['text']; + } + + return $sec2_array; +} + +/** + * Check if a page (sec2) is in a section (sec) + * + * @param string section (sec) code + * @param string page (sec2)code + * + * @return true if the page is in section, false otherwise + */ +function menu_sec2_in_sec($sec,$sec2) { + if($sec != 'estado') return false; + + $sec2_array = menu_get_sec_pages($sec); + + // If this value has various parameters, we only get the first + $sec2 = explode('&',$sec2); + $sec2 = $sec2[0]; + + if($sec2_array != null && in_array($sec2,array_keys($sec2_array))) { + return true; + } + + return false; +} + ?> diff --git a/pandora_console/index.php b/pandora_console/index.php index b32c8deae0..c0600eb4bf 100644 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -427,7 +427,7 @@ else { if ($page != "") { $page .= '.php'; // Enterprise ACL check - if (enterprise_hook ('enterprise_acl', array ($config['id_user'], $sec, $sec2)) == false) { + if (enterprise_hook ('enterprise_acl', array ($config['id_user'], $sec, $sec2, true)) == false) { require ("general/noaccess.php"); } elseif (file_exists ($page)) { diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index 0dcfdb28d3..ee0fa6d3c6 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -22,8 +22,8 @@ require_once ('include/functions_menu.php'); enterprise_include ('operation/menu.php'); -$menu = array (); -$menu['class'] = 'operation'; +$menu_operation = array (); +$menu_operation['class'] = 'operation'; // Agent read, Server read if (check_acl ($config['id_user'], 0, "AR")) { @@ -32,10 +32,10 @@ if (check_acl ($config['id_user'], 0, "AR")) { if ($config['metaconsole'] == 0) { //View agents - $menu["estado"]["text"] = __('Monitoring'); - $menu["estado"]["sec2"] = "operation/agentes/tactical"; - $menu["estado"]["refr"] = 0; - $menu["estado"]["id"] = "oper-agents"; + $menu_operation["estado"]["text"] = __('Monitoring'); + $menu_operation["estado"]["sec2"] = "operation/agentes/tactical"; + $menu_operation["estado"]["refr"] = 0; + $menu_operation["estado"]["id"] = "oper-agents"; $sub = array (); $sub["operation/agentes/tactical"]["text"] = __('Tactical view'); @@ -85,17 +85,17 @@ if (check_acl ($config['id_user'], 0, "AR")) { $sub['operation/tree']['text'] = __('Tree view'); $sub["operation/tree"]["refr"] = 0; - $menu["estado"]["sub"] = $sub; + $menu_operation["estado"]["sub"] = $sub; //End of view agents } if ($config['metaconsole'] == 0) { //Start network view - $menu["network"]["text"] = __('Network View'); - $menu["network"]["sec2"] = "operation/agentes/networkmap_list"; - $menu["network"]["refr"] = 0; - $menu["network"]["id"] = "oper-networkconsole"; + $menu_operation["network"]["text"] = __('Network View'); + $menu_operation["network"]["sec2"] = "operation/agentes/networkmap_list"; + $menu_operation["network"]["refr"] = 0; + $menu_operation["network"]["id"] = "oper-networkconsole"; $sub = array(); @@ -104,15 +104,15 @@ if (check_acl ($config['id_user'], 0, "AR")) { enterprise_hook ('networkmap_console'); - $menu["network"]["sub"] = $sub; + $menu_operation["network"]["sub"] = $sub; //End networkview } // Reporting - $menu["reporting"]["text"] = __('Reporting'); - $menu["reporting"]["sec2"] = "godmode/reporting/reporting_builder"; - $menu["reporting"]["id"] = "oper-reporting"; - $menu["reporting"]["refr"] = 60; + $menu_operation["reporting"]["text"] = __('Reporting'); + $menu_operation["reporting"]["sec2"] = "godmode/reporting/reporting_builder"; + $menu_operation["reporting"]["id"] = "oper-reporting"; + $menu_operation["reporting"]["refr"] = 60; $sub = array (); @@ -192,16 +192,16 @@ if (check_acl ($config['id_user'], 0, "AR")) { enterprise_hook ('reporting_godmenu'); } - $menu["reporting"]["sub"] = $sub; + $menu_operation["reporting"]["sub"] = $sub; //End reporting //INI GIS Maps if ($config['activate_gis'] and ($config['metaconsole'] == 0)) { - $menu["gismaps"]["text"] = __('GIS Maps'); - $menu["gismaps"]["sec2"] = "operation/gis_maps/index"; - $menu["gismaps"]["refr"] = 0; - $menu["gismaps"]["id"] = "oper-gismaps"; + $menu_operation["gismaps"]["text"] = __('GIS Maps'); + $menu_operation["gismaps"]["sec2"] = "operation/gis_maps/index"; + $menu_operation["gismaps"]["refr"] = 0; + $menu_operation["gismaps"]["id"] = "oper-gismaps"; $sub = array (); @@ -230,7 +230,7 @@ if (check_acl ($config['id_user'], 0, "AR")) { $sub["operation/gis_maps/render_view&map_id=".$gisMap["id_tgis_map"]]["refr"] = 0; } - $menu["gismaps"]["sub"] = $sub; + $menu_operation["gismaps"]["sub"] = $sub; } //END GIS Maps } @@ -238,10 +238,10 @@ if (check_acl ($config['id_user'], 0, "AR")) { // Rest of options, all with AR privilege (or should events be with incidents?) if (check_acl ($config['id_user'], 0, "AR") and ($config['metaconsole'] == 0)) { // Events - $menu["eventos"]["text"] = __('View events'); - $menu["eventos"]["refr"] = 0; - $menu["eventos"]["sec2"] = "operation/events/events"; - $menu["eventos"]["id"] = "oper-events"; + $menu_operation["eventos"]["text"] = __('View events'); + $menu_operation["eventos"]["refr"] = 0; + $menu_operation["eventos"]["sec2"] = "operation/events/events"; + $menu_operation["eventos"]["id"] = "oper-events"; $sub = array (); $sub["operation/events/event_statistics"]["text"] = __('Statistics'); @@ -281,13 +281,13 @@ if (check_acl ($config['id_user'], 0, "AR") and ($config['metaconsole'] == 0)) { 0) and (($config['metaconsole'] == 0) or (array_key_exists($extension_menu['fatherId'], $menu)))) { - $menu[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["text"] = __($extension_menu['name']); - $menu[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["refr"] = 0; - $menu[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["icon"] = $extension_menu['icon']; - $menu[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["sec"] = 'extensions'; - $menu[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["extension"] = true; - $menu[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["enterprise"] = $extension['enterprise']; - $menu[$extension_menu['fatherId']]['hasExtensions'] = true; + if ((strlen($extension_menu['fatherId']) > 0) and (($config['metaconsole'] == 0) or (array_key_exists($extension_menu['fatherId'], $menu_operation)))) { + $menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["text"] = __($extension_menu['name']); + $menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["refr"] = 0; + $menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["icon"] = $extension_menu['icon']; + $menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["sec"] = 'extensions'; + $menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["extension"] = true; + $menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["enterprise"] = $extension['enterprise']; + $menu_operation[$extension_menu['fatherId']]['hasExtensions'] = true; } } } } - $menu["extensions"]["sub"] = $sub; + $menu_operation["extensions"]["sub"] = $sub; } } // Save operation menu array to use in operation/extensions.php view -$operation_menu_array = $menu; +$operation_menu_array = $menu_operation; -menu_print_menu ($menu, true); +menu_print_menu ($menu_operation, true); ?>