Fixed problems with ACL permmisions. Internal Tiquet: #3912
This commit is contained in:
parent
ab1055bb23
commit
2db19c539f
|
@ -44,7 +44,7 @@ function extension_db_status() {
|
|||
"images/extensions.png", false, "", true, "");
|
||||
|
||||
|
||||
if (! check_acl ($config['id_user'], 0, "PM")) {
|
||||
if (! check_acl ($config['id_user'], 0, "DM")) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access db status");
|
||||
require ("general/noaccess.php");
|
||||
|
@ -362,5 +362,5 @@ function extension_db_status_execute_sql_file($url, $connection) {
|
|||
}
|
||||
|
||||
extensions_add_godmode_function('extension_db_status');
|
||||
extensions_add_godmode_menu_option(__('DB Status'), 'PM', 'gextensions', null, "v1r1", 'gdbman');
|
||||
extensions_add_godmode_menu_option(__('DB Status'), 'DM', 'gextensions', null, "v1r1", 'gdbman');
|
||||
?>
|
|
@ -87,6 +87,6 @@ function extension_uploader_extensions() {
|
|||
echo "</form>";
|
||||
}
|
||||
|
||||
extensions_add_godmode_menu_option(__('Extension uploader'), 'AM', null, null, "v1r1");
|
||||
extensions_add_godmode_menu_option(__('Extension uploader'), 'PM', null, null, "v1r1");
|
||||
extensions_add_godmode_function('extension_uploader_extensions');
|
||||
?>
|
||||
|
|
|
@ -120,12 +120,7 @@ function users_extension_main_god ($god = true) {
|
|||
}
|
||||
}
|
||||
extensions_add_godmode_menu_option (__('Users connected'), 'UM','gusuarios',"users/icon.png", "v1r1");
|
||||
|
||||
if (isset($config["id_user"])) {
|
||||
if (check_acl ($config["id_user"], 0, "UM")) {
|
||||
extensions_add_operation_menu_option(__('Users connected'), 'workspace',"users/icon.png", "v1r1");
|
||||
}
|
||||
}
|
||||
extensions_add_operation_menu_option(__('Users connected'), 'workspace',"users/icon.png", "v1r1", '', "UM");
|
||||
|
||||
extensions_add_godmode_function('users_extension_main_god');
|
||||
extensions_add_main_function('users_extension_main');
|
||||
|
|
|
@ -83,7 +83,7 @@ echo '<div style="float:left; width: 250px;">';
|
|||
echo '<b>'.__('Source agent').'</b><br /><br />';
|
||||
|
||||
$agent_selected = get_parameter_post ("origen", 0);
|
||||
$agents = agents_get_group_agents (array_keys (users_get_groups ($config["id_user"], "AW")));
|
||||
$agents = agents_get_group_agents (array_keys (users_get_groups ($config["id_user"], "DM")));
|
||||
|
||||
html_print_select ($agents, "origen", $agent_selected, 'javascript:this.form.update_agent.click();', __('No agent selected'), '0', false, false, false, '', false, 'max-width:300px !important;');
|
||||
|
||||
|
|
|
@ -88,11 +88,6 @@ if (check_acl ($config['id_user'], 0, "UM")) {
|
|||
$menu_godmode["gusuarios"]["sub"] = $sub;
|
||||
}
|
||||
|
||||
|
||||
$menu_godmode["gmodules"]["text"] = __('Configuration');
|
||||
$menu_godmode["gmodules"]["sec2"] = "godmode/modules/manage_network_templates";
|
||||
$menu_godmode["gmodules"]["id"] = "god-configuration";
|
||||
|
||||
$sub = array ();
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
$sub["godmode/modules/manage_network_components"]["text"] = __('Network components');
|
||||
|
@ -126,7 +121,12 @@ if (check_acl ($config['id_user'], 0, "AW")) {
|
|||
$sub["gmassive"]["sub2"] = $sub2;
|
||||
}
|
||||
|
||||
$menu_godmode["gmodules"]["sub"] = $sub;
|
||||
if (!empty($sub)) {
|
||||
$menu_godmode["gmodules"]["text"] = __('Configuration');
|
||||
$menu_godmode["gmodules"]["sec2"] = "godmode/modules/manage_network_templates";
|
||||
$menu_godmode["gmodules"]["id"] = "god-configuration";
|
||||
$menu_godmode["gmodules"]["sub"] = $sub;
|
||||
}
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "LM") || check_acl ($config['id_user'], 0, "AD")) {
|
||||
$menu_godmode["galertas"]["text"] = __('Alerts');
|
||||
|
@ -275,27 +275,33 @@ if (check_acl ($config['id_user'], 0, "PM")) {
|
|||
$menu_godmode["gsetup"]["sub"] = $sub;
|
||||
}
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
if (check_acl ($config['id_user'], 0, "PM") || check_acl ($config['id_user'], 0, "DM")) {
|
||||
$menu_godmode["gextensions"]["text"] = __('Admin tools');
|
||||
$menu_godmode["gextensions"]["sec2"] = "godmode/extensions";
|
||||
$menu_godmode["gextensions"]["id"] = "god-extensions";
|
||||
|
||||
$sub = array ();
|
||||
// Audit //meter en extensiones
|
||||
$sub["godmode/admin_access_logs"]["text"] = __('System audit log');
|
||||
$sub["godmode/admin_access_logs"]["id"] = 'System audit log';
|
||||
$sub["godmode/setup/links"]["text"] = __('Links');
|
||||
$sub["godmode/setup/links"]["id"] = 'Links';
|
||||
|
||||
|
||||
$sub["godmode/extensions"]["sub2"] = $sub2;
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
// Audit //meter en extensiones
|
||||
$sub["godmode/admin_access_logs"]["text"] = __('System audit log');
|
||||
$sub["godmode/admin_access_logs"]["id"] = 'System audit log';
|
||||
$sub["godmode/setup/links"]["text"] = __('Links');
|
||||
$sub["godmode/setup/links"]["id"] = 'Links';
|
||||
$sub["extras/pandora_diag"]["text"] = __('Diagnostic info');
|
||||
$sub["extras/pandora_diag"]["id"] = 'Diagnostic info';
|
||||
$sub["godmode/setup/news"]["text"] = __('Site news');
|
||||
$sub["godmode/setup/news"]["id"] = 'Site news';
|
||||
$sub["godmode/setup/file_manager"]["text"] = __('File manager');
|
||||
$sub["godmode/setup/file_manager"]["id"] = 'File manager';
|
||||
}
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "DM")) {
|
||||
$sub["gdbman"]["text"] = __('DB maintenance');
|
||||
$sub["gdbman"]["id"] = 'DB maintenance';
|
||||
$sub["gdbman"]["type"] = "direct";
|
||||
$sub["gdbman"]["subtype"] = "nolink";
|
||||
|
||||
$sub2 = array ();
|
||||
$sub2["godmode/db/db_info"]["text"] = __('DB information');
|
||||
$sub2["godmode/db/db_purge"]["text"] = __('Database purge');
|
||||
|
@ -305,103 +311,88 @@ if (check_acl ($config['id_user'], 0, "PM")) {
|
|||
|
||||
$sub["gdbman"]["sub2"] = $sub2;
|
||||
}
|
||||
$sub["extras/pandora_diag"]["text"] = __('Diagnostic info');
|
||||
$sub["extras/pandora_diag"]["id"] = 'Diagnostic info';
|
||||
|
||||
$sub["godmode/setup/news"]["text"] = __('Site news');
|
||||
$sub["godmode/setup/news"]["id"] = 'Site news';
|
||||
|
||||
$sub["godmode/setup/file_manager"]["text"] = __('File manager');
|
||||
$sub["godmode/setup/file_manager"]["id"] = 'File manager';
|
||||
|
||||
$sub["godmode/setup/snmp_wizard"]["text"] = __('SNMP Wizard');
|
||||
$sub["godmode/setup/snmp_wizard"]["id"] = 'SNMP Wizard';
|
||||
|
||||
$menu_godmode["gextensions"]["sub"] = $sub;
|
||||
}
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
|
||||
if (is_array ($config['extensions'])) {
|
||||
if (is_array ($config['extensions'])) {
|
||||
|
||||
$sub = array ();
|
||||
$sub2 = array ();
|
||||
|
||||
foreach ($config['extensions'] as $extension) {
|
||||
//If no godmode_menu is a operation extension
|
||||
if ($extension['godmode_menu'] == '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$sub = array ();
|
||||
$sub["godmode/extensions"]["text"] = __('Extension manager');
|
||||
$sub["godmode/extensions"]["id"] = 'Extension manager';
|
||||
$extmenu = $extension['godmode_menu'];
|
||||
|
||||
if ($extmenu["name"] == 'DB interface' && !check_acl ($config['id_user'], 0, "DM")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$sub2 = array ();
|
||||
//Check the ACL for this user
|
||||
if (! check_acl ($config['id_user'], 0, $extmenu['acl'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($config['extensions'] as $extension) {
|
||||
//If no godmode_menu is a operation extension
|
||||
if ($extension['godmode_menu'] == '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$extmenu = $extension['godmode_menu'];
|
||||
|
||||
if ($extmenu["name"] == 'DB interface' && !check_acl ($config['id_user'], 0, "DM")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//Check the ACL for this user
|
||||
if (! check_acl ($config['id_user'], 0, $extmenu['acl'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//Check if was displayed inside other menu
|
||||
if ($extension['godmode_menu']["fatherId"] == '') {
|
||||
$sub2[$extmenu["sec2"]]["text"] = __($extmenu["name"]);
|
||||
$sub2[$extmenu["sec2"]]["id"] = $extmenu["name"];
|
||||
$sub2[$extmenu["sec2"]]["refr"] = 0;
|
||||
}
|
||||
else {
|
||||
if (array_key_exists('fatherId',$extmenu)) {
|
||||
if (strlen($extmenu['fatherId']) > 0) {
|
||||
if (array_key_exists('subfatherId',$extmenu)) {
|
||||
if (strlen($extmenu['subfatherId']) > 0) {
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["text"] = __($extmenu['name']);
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["id"] = $extmenu['name'];
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["refr"] = 0;
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["icon"] = $extmenu['icon'];
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["sec"] = 'extensions';
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["extension"] = true;
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["enterprise"] = $extension['enterprise'];
|
||||
$menu_godmode[$extmenu['fatherId']]['hasExtensions'] = true;
|
||||
}
|
||||
else {
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["text"] = __($extmenu['name']);
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["id"] = $extmenu['name'];
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = 0;
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["icon"] = $extmenu['icon'];
|
||||
if ($extmenu["name"] == 'Cron jobs')
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["sec"] = 'extensions';
|
||||
else
|
||||
$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_godmode[$extmenu['fatherId']]['hasExtensions'] = true;
|
||||
}
|
||||
//Check if was displayed inside other menu
|
||||
if ($extension['godmode_menu']["fatherId"] == '') {
|
||||
$sub2[$extmenu["sec2"]]["text"] = __($extmenu["name"]);
|
||||
$sub2[$extmenu["sec2"]]["id"] = $extmenu["name"];
|
||||
$sub2[$extmenu["sec2"]]["refr"] = 0;
|
||||
}
|
||||
else {
|
||||
if (array_key_exists('fatherId',$extmenu)) {
|
||||
if (strlen($extmenu['fatherId']) > 0) {
|
||||
if (array_key_exists('subfatherId',$extmenu)) {
|
||||
if (strlen($extmenu['subfatherId']) > 0) {
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["text"] = __($extmenu['name']);
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["id"] = $extmenu['name'];
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["refr"] = 0;
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["icon"] = $extmenu['icon'];
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["sec"] = 'extensions';
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["extension"] = true;
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["enterprise"] = $extension['enterprise'];
|
||||
$menu_godmode[$extmenu['fatherId']]['hasExtensions'] = true;
|
||||
}
|
||||
else {
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["text"] = __($extmenu['name']);
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["id"] = $extmenu['name'];
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = 0;
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["icon"] = $extmenu['icon'];
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["sec"] = 'gextensions';
|
||||
if ($extmenu["name"] == 'Cron jobs')
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["sec"] = 'extensions';
|
||||
else
|
||||
$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_godmode[$extmenu['fatherId']]['hasExtensions'] = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["text"] = __($extmenu['name']);
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["id"] = $extmenu['name'];
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = 0;
|
||||
$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_godmode[$extmenu['fatherId']]['hasExtensions'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (!empty($sub2))
|
||||
$sub["godmode/extensions"]["sub2"] = $sub2;
|
||||
|
||||
|
||||
|
||||
if (!empty($sub)) {
|
||||
$sub["godmode/extensions"]["text"] = __('Extension manager');
|
||||
$sub["godmode/extensions"]["id"] = 'Extension manager';
|
||||
$submenu = array_merge($menu_godmode["gextensions"]["sub"],$sub);
|
||||
$menu_godmode["gextensions"]["sub"] = $submenu;
|
||||
}
|
||||
|
@ -452,7 +443,6 @@ if (check_acl ($config['id_user'], 0, "PM")) {
|
|||
$sub["godmode/update_manager/update_manager&tab=messages"]["id"] = 'Messages';
|
||||
|
||||
}
|
||||
|
||||
$menu_godmode["messages"]["sub"] = $sub;
|
||||
}
|
||||
|
||||
|
|
|
@ -351,7 +351,7 @@ function extensions_load_extensions ($process_login) {
|
|||
* @param string subfatherId Id of the parent submenu item for the current extension
|
||||
* @param string icon Path to the icon image (18x18 px). If this parameter is blank then predefined icon will be used
|
||||
*/
|
||||
function extensions_add_operation_menu_option ($name, $fatherId = null, $icon = null, $version="N/A", $subfatherId = null) {
|
||||
function extensions_add_operation_menu_option ($name, $fatherId = null, $icon = null, $version="N/A", $subfatherId = null, $acl = 'AR') {
|
||||
global $config;
|
||||
global $extension_file;
|
||||
|
||||
|
@ -361,7 +361,7 @@ function extensions_add_operation_menu_option ($name, $fatherId = null, $icon =
|
|||
call, we are sure it will be set.
|
||||
*/
|
||||
$option_menu['name'] = $name;
|
||||
|
||||
$option_menu['acl'] = $acl;
|
||||
$extension = &$config['extensions'][$extension_file];
|
||||
|
||||
$option_menu['sec2'] = $extension['dir'] . '/' . mb_substr ($extension_file, 0, -4);
|
||||
|
|
|
@ -204,9 +204,6 @@ li:hover ul { display: block; }
|
|||
#subicon_god-setup {
|
||||
top: -140px;
|
||||
}
|
||||
#subicon_god-extensions {
|
||||
top: -262px;
|
||||
}
|
||||
#subBulk_operations {
|
||||
top: -210px;
|
||||
}
|
||||
|
|
|
@ -65,14 +65,11 @@ if (check_acl ($config['id_user'], 0, "AR")) {
|
|||
$sub["view"]["sub2"] = $sub2;
|
||||
|
||||
enterprise_hook ('inventory_menu');
|
||||
|
||||
// Fix: Netflow interfaces have to check RR ACL
|
||||
if (check_acl ($config['id_user'], 0, "RR")) {
|
||||
if ($config['activate_netflow']) {
|
||||
$sub["operation/netflow/nf_live_view"]["text"] = __('Netflow Live View');
|
||||
$sub["operation/netflow/nf_live_view"]["id"] = 'Netflow Live View';
|
||||
$sub["operation/netflow/nf_live_view"]["refr"] = 0;
|
||||
}
|
||||
|
||||
if ($config['activate_netflow']) {
|
||||
$sub["operation/netflow/nf_live_view"]["text"] = __('Netflow Live View');
|
||||
$sub["operation/netflow/nf_live_view"]["id"] = 'Netflow Live View';
|
||||
$sub["operation/netflow/nf_live_view"]["refr"] = 0;
|
||||
}
|
||||
|
||||
if ($config['log_collector'] == 1) {
|
||||
|
@ -88,7 +85,10 @@ if (check_acl ($config['id_user'], 0, "AR")) {
|
|||
$sub2 = array();
|
||||
$sub2["operation/snmpconsole/snmp_view"]["text"] = __("SNMP console");
|
||||
$sub2["operation/snmpconsole/snmp_browser"]["text"] = __("SNMP browser");
|
||||
$sub2["operation/snmpconsole/snmp_mib_uploader"]["text"] = __("MIB uploader");
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "PM"))
|
||||
$sub2["operation/snmpconsole/snmp_mib_uploader"]["text"] = __("MIB uploader");
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "LW")) {
|
||||
$sub2["godmode/snmpconsole/snmp_filters"]["text"] = __("SNMP filters");
|
||||
$sub2["godmode/snmpconsole/snmp_trap_generator"]["text"] = __("SNMP trap generator");
|
||||
|
@ -102,18 +102,16 @@ if (check_acl ($config['id_user'], 0, "AR")) {
|
|||
|
||||
}
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "AR")) {
|
||||
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "AR") || check_acl ($config['id_user'], 0, "MR")) {
|
||||
//Start network view
|
||||
|
||||
$menu_operation["network"]["text"] = __('Topology maps');
|
||||
$menu_operation["network"]["sec2"] = "operation/agentes/networkmap_list";
|
||||
$menu_operation["network"]["refr"] = 0;
|
||||
$menu_operation["network"]["id"] = "oper-networkconsole";
|
||||
|
||||
$sub = array();
|
||||
|
||||
}
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "MR")) {
|
||||
$sub["operation/agentes/networkmap_list"]["text"] = __('Network map');
|
||||
$sub["operation/agentes/networkmap_list"]["id"] = 'Network map';
|
||||
$sub["operation/agentes/networkmap_list"]["refr"] = 0;
|
||||
|
@ -129,11 +127,13 @@ if (check_acl ($config['id_user'], 0, "AR")) {
|
|||
$sub["operation/maps/networkmap_list"]["pages"] = array(
|
||||
"operation/maps/networkmap"
|
||||
);
|
||||
|
||||
enterprise_hook ('networkmap_console');
|
||||
|
||||
enterprise_hook ('services_menu');
|
||||
|
||||
}
|
||||
|
||||
enterprise_hook ('networkmap_console');
|
||||
|
||||
enterprise_hook ('services_menu');
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "VR")) {
|
||||
//Visual console
|
||||
$sub["godmode/reporting/map_builder"]["text"] = __('Visual console');
|
||||
$sub["godmode/reporting/map_builder"]["id"] = 'Visual console';
|
||||
|
@ -144,7 +144,7 @@ if (check_acl ($config['id_user'], 0, "AR")) {
|
|||
|
||||
$layouts = db_get_all_rows_in_table ('tlayout', 'name');
|
||||
$sub2 = array ();
|
||||
|
||||
|
||||
if ($layouts === false) {
|
||||
$layouts = array ();
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ if (check_acl ($config['id_user'], 0, "AR")) {
|
|||
if (!empty($sub2))
|
||||
$sub["godmode/reporting/map_builder"]["sub2"] = $sub2;
|
||||
}
|
||||
|
||||
}
|
||||
// Agent read, Server read
|
||||
if (check_acl ($config['id_user'], 0, "AR")) {
|
||||
|
||||
|
@ -234,6 +234,10 @@ if (check_acl ($config['id_user'], 0, "AR")) {
|
|||
|
||||
}
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "AR") || check_acl ($config['id_user'], 0, "MR"))
|
||||
$menu_operation["network"]["sub"] = $sub;
|
||||
//End networkview
|
||||
|
||||
// Reports read
|
||||
if (check_acl ($config['id_user'], 0, "RR")) {
|
||||
// Reporting
|
||||
|
@ -261,13 +265,14 @@ if (check_acl ($config['id_user'], 0, "RR")) {
|
|||
enterprise_hook ('dashboard_menu');
|
||||
enterprise_hook ('reporting_godmenu');
|
||||
|
||||
|
||||
$menu_operation["reporting"]["sub"] = $sub;
|
||||
//End reporting
|
||||
}
|
||||
|
||||
// Events reading
|
||||
if (check_acl ($config['id_user'], 0, "ER")) {
|
||||
if (check_acl ($config['id_user'], 0, "ER")
|
||||
|| check_acl ($config['id_user'], 0, "EW")
|
||||
|| check_acl ($config['id_user'], 0, "EM")) {
|
||||
// Events
|
||||
$menu_operation["eventos"]["text"] = __('Events');
|
||||
$menu_operation["eventos"]["refr"] = 0;
|
||||
|
@ -345,7 +350,7 @@ $sub["operation/users/webchat"]["refr"] = 0;
|
|||
|
||||
|
||||
//Incidents
|
||||
if (check_acl ($config['id_user'], 0, "IR") == 1) {
|
||||
if (check_acl ($config['id_user'], 0, "IR")) {
|
||||
$temp_sec2 = $sec2;
|
||||
if($config['integria_enabled']) {
|
||||
$sec2 = "incident";
|
||||
|
@ -366,7 +371,7 @@ if (check_acl ($config['id_user'], 0, "IR") == 1) {
|
|||
"operation/integria_incidents");
|
||||
|
||||
$sub2 = array ();
|
||||
$sub2['operation/incidents/incident']["text"] = _("List of Incidents");
|
||||
$sub2['operation/incidents/incident']["text"] = __("List of Incidents");
|
||||
$sub2[$sec2sub]["text"] = __('Statistics');
|
||||
|
||||
$sub[$sec2]["sub2"] = $sub2;
|
||||
|
@ -392,72 +397,73 @@ $menu_operation["workspace"]["sub"] = $sub;
|
|||
|
||||
|
||||
// Rest of options, all with AR privilege (or should events be with incidents?)
|
||||
if (check_acl ($config['id_user'], 0, "AR")) {
|
||||
|
||||
// Extensions menu additions
|
||||
if (is_array ($config['extensions'])) {
|
||||
$menu_operation["extensions"]["text"] = __('Tools');
|
||||
$menu_operation["extensions"]["sec2"] = "operation/extensions";
|
||||
$menu_operation["extensions"]["id"] = "oper-extensions";
|
||||
|
||||
$sub = array ();
|
||||
$sub2 = array ();
|
||||
|
||||
//~ if (check_acl ($config['id_user'], 0, "AR")) {
|
||||
|
||||
// Extensions menu additions
|
||||
if (is_array ($config['extensions'])) {
|
||||
|
||||
|
||||
$sub = array ();
|
||||
$sub2 = array ();
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "RR")) {
|
||||
$sub["operation/agentes/exportdata"]["text"] = __('Export data');
|
||||
$sub["operation/agentes/exportdata"]["id"] = 'Export data';
|
||||
$sub["operation/agentes/exportdata"]["subsecs"] = array("operation/agentes/exportdata");
|
||||
|
||||
}
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "AR") || check_acl ($config['id_user'], 0, "AD")) {
|
||||
$sub["godmode/agentes/planned_downtime.list"]["text"] = __('Scheduled downtime');
|
||||
$sub["godmode/agentes/planned_downtime.list"]["id"] = 'Scheduled downtime';
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
$sub["operation/servers/recon_view"]["text"] = __('Recon view');
|
||||
$sub["operation/servers/recon_view"]["id"] = 'Recon view';
|
||||
$sub["operation/servers/recon_view"]["refr"] = 0;
|
||||
}
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
$sub["operation/servers/recon_view"]["text"] = __('Recon view');
|
||||
$sub["operation/servers/recon_view"]["id"] = 'Recon view';
|
||||
$sub["operation/servers/recon_view"]["refr"] = 0;
|
||||
}
|
||||
|
||||
foreach ($config["extensions"] as $extension) {
|
||||
//If no operation_menu is a godmode extension
|
||||
if ($extension["operation_menu"] == '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($config["extensions"] as $extension) {
|
||||
//If no operation_menu is a godmode extension
|
||||
if ($extension["operation_menu"] == '') {
|
||||
//Check the ACL for this user
|
||||
if (! check_acl ($config['id_user'], 0, $extension['operation_menu']['acl'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$extension_menu = $extension["operation_menu"];
|
||||
if ($extension["operation_menu"]["name"] == 'Matrix' &&
|
||||
( !check_acl ($config['id_user'], 0, "ER") ||
|
||||
!check_acl ($config['id_user'], 0, "EW") ||
|
||||
!check_acl ($config['id_user'], 0, "EM") )) {
|
||||
continue;
|
||||
}
|
||||
//Check if was displayed inside other menu
|
||||
if ($extension["operation_menu"]["fatherId"] == '') {
|
||||
if ($extension_menu['name'] == 'Update manager') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$extension_menu = $extension["operation_menu"];
|
||||
|
||||
//Check if was displayed inside other menu
|
||||
if ($extension["operation_menu"]["fatherId"] == '') {
|
||||
if ($extension_menu['name'] == 'Update manager') {
|
||||
continue;
|
||||
}
|
||||
$sub[$extension_menu["sec2"]]["text"] = $extension_menu["name"];
|
||||
$sub[$extension_menu["sec2"]]["id"] = $extension_menu["name"];
|
||||
$sub[$extension_menu["sec2"]]["refr"] = 0;
|
||||
}
|
||||
else {
|
||||
if (array_key_exists('fatherId',$extension_menu)) {
|
||||
// Check that extension father ID exists previously on the menu
|
||||
if ((strlen($extension_menu['fatherId']) > 0)) {
|
||||
if (array_key_exists('subfatherId',$extension_menu)) {
|
||||
if ((strlen($extension_menu['subfatherId']) > 0)) {
|
||||
$menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['subfatherId']]['sub2'][$extension_menu['sec2']]["text"] = __($extension_menu['name']);
|
||||
$menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['subfatherId']]['sub2'][$extension_menu['sec2']]["id"] = $extension_menu['name'];
|
||||
$menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['subfatherId']]['sub2'][$extension_menu['sec2']]["refr"] = 0;
|
||||
$menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['subfatherId']]['sub2'][$extension_menu['sec2']]["icon"] = $extension_menu['icon'];
|
||||
$menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['subfatherId']]['sub2'][$extension_menu['sec2']]["sec"] = 'extensions';
|
||||
$menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['subfatherId']]['sub2'][$extension_menu['sec2']]["extension"] = true;
|
||||
$menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['subfatherId']]['sub2'][$extension_menu['sec2']]["enterprise"] = $extension['enterprise'];
|
||||
$menu_operation[$extension_menu['fatherId']]['hasExtensions'] = true;
|
||||
}
|
||||
else {
|
||||
$menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["text"] = __($extension_menu['name']);
|
||||
$menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["id"] = $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;
|
||||
}
|
||||
$sub[$extension_menu["sec2"]]["text"] = $extension_menu["name"];
|
||||
$sub[$extension_menu["sec2"]]["id"] = $extension_menu["name"];
|
||||
$sub[$extension_menu["sec2"]]["refr"] = 0;
|
||||
}
|
||||
else {
|
||||
if (array_key_exists('fatherId',$extension_menu)) {
|
||||
// Check that extension father ID exists previously on the menu
|
||||
if ((strlen($extension_menu['fatherId']) > 0)) {
|
||||
if (array_key_exists('subfatherId',$extension_menu)) {
|
||||
if ((strlen($extension_menu['subfatherId']) > 0)) {
|
||||
$menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['subfatherId']]['sub2'][$extension_menu['sec2']]["text"] = __($extension_menu['name']);
|
||||
$menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['subfatherId']]['sub2'][$extension_menu['sec2']]["id"] = $extension_menu['name'];
|
||||
$menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['subfatherId']]['sub2'][$extension_menu['sec2']]["refr"] = 0;
|
||||
$menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['subfatherId']]['sub2'][$extension_menu['sec2']]["icon"] = $extension_menu['icon'];
|
||||
$menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['subfatherId']]['sub2'][$extension_menu['sec2']]["sec"] = 'extensions';
|
||||
$menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['subfatherId']]['sub2'][$extension_menu['sec2']]["extension"] = true;
|
||||
$menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['subfatherId']]['sub2'][$extension_menu['sec2']]["enterprise"] = $extension['enterprise'];
|
||||
$menu_operation[$extension_menu['fatherId']]['hasExtensions'] = true;
|
||||
}
|
||||
else {
|
||||
$menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["text"] = __($extension_menu['name']);
|
||||
|
@ -470,13 +476,31 @@ if (check_acl ($config['id_user'], 0, "AR")) {
|
|||
$menu_operation[$extension_menu['fatherId']]['hasExtensions'] = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["text"] = __($extension_menu['name']);
|
||||
$menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["id"] = $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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (!empty($sub)) {
|
||||
$menu_operation["extensions"]["text"] = __('Tools');
|
||||
$menu_operation["extensions"]["sec2"] = "operation/extensions";
|
||||
$menu_operation["extensions"]["id"] = "oper-extensions";
|
||||
$menu_operation["extensions"]["sub"] = $sub;
|
||||
|
||||
}
|
||||
}
|
||||
//~ }
|
||||
|
||||
// Save operation menu array to use in operation/extensions.php view
|
||||
$operation_menu_array = $menu_operation;
|
||||
|
|
Loading…
Reference in New Issue