__('Bulk alert add'), 'delete_alerts' => __('Bulk alert delete'), 'add_action_alerts' => __('Bulk alert actions add'), 'delete_action_alerts' => __('Bulk alert actions delete'), 'enable_disable_alerts' => __('Bulk alert enable/disable'), 'standby_alerts' => __('Bulk alert setting standby'), ]; $options_agents = [ 'edit_agents' => __('Bulk agent edit'), 'delete_agents' => __('Bulk agent delete'), ]; if (check_acl($config['id_user'], 0, 'UM')) { if (is_metaconsole() === false) { $options_users = [ 'add_profiles' => __('Bulk profile add'), 'delete_profiles' => __('Bulk profile delete'), ]; } if (users_is_admin() === true) { $options_users['edit_users'] = __('Edit users in bulk'); } } else { $options_users = []; } $options_modules = [ 'edit_modules' => __('Bulk module edit'), 'copy_modules' => __('Bulk module copy'), 'delete_modules' => __('Bulk module delete'), ]; $options_plugins = [ 'edit_plugins' => __('Bulk plugin edit'), ]; if (! check_acl($config['id_user'], 0, 'AW')) { unset($options_modules['edit_modules']); } $options_policies = []; $policies_options = enterprise_hook('massive_policies_options'); if ($policies_options != ENTERPRISE_NOT_HOOK) { $policies_options = array_unique($policies_options); $options_policies = array_merge($options_policies, $policies_options); } $options_snmp = []; $snmp_options = enterprise_hook('massive_snmp_options'); if ($snmp_options != ENTERPRISE_NOT_HOOK) { $snmp_options = array_reverse($snmp_options); $options_snmp = array_merge($options_snmp, $snmp_options); } $options_satellite = []; $satellite_options = enterprise_hook('massive_satellite_options'); if ($satellite_options != ENTERPRISE_NOT_HOOK) { $options_satellite = array_merge($options_satellite, $satellite_options); } if (in_array($option, array_keys($options_alerts)) === true) { $tab = 'massive_alerts'; } else if (in_array($option, array_keys($options_agents)) === true) { $tab = 'massive_agents'; } else if (in_array($option, array_keys($options_users)) === true) { $tab = 'massive_users'; } else if (in_array($option, array_keys($options_modules)) === true) { $tab = 'massive_modules'; } else if (in_array($option, array_keys($options_policies)) === true) { $tab = 'massive_policies'; } else if (in_array($option, array_keys($options_snmp)) === true) { $tab = 'massive_snmp'; } else if (in_array($option, array_keys($options_satellite)) === true) { $tab = 'massive_satellite'; } else if (in_array($option, array_keys($options_plugins)) === true) { $tab = 'massive_plugins'; } if ($tab === 'massive_agents' && empty($option) === true) { $option = 'edit_agents'; if (is_metaconsole() === true) { $option = 'delete_agents'; } } if ($tab == 'massive_modules' && $option == '') { $option = 'edit_modules'; } if ($tab == 'massive_policies' && $option == '') { $option = 'edit_policy_modules'; } switch ($option) { case 'edit_agents': $help_header = 'massive_agents_tab'; break; case 'edit_modules': $help_header = 'massive_modules_tab'; break; case 'edit_policy_modules': $help_header = 'massive_policies_tab'; break; default: $help_header = ''; break; } switch ($tab) { case 'massive_alerts': $options = $options_alerts; break; case 'massive_agents': $options = $options_agents; break; case 'massive_modules': $options = $options_modules; break; case 'massive_users': $options = $options_users; break; case 'massive_policies': $options = $options_policies; break; case 'massive_snmp': $options = $options_snmp; break; case 'massive_satellite': $options = $options_satellite; break; case 'massive_plugins': $options = $options_plugins; break; default: // Default. break; } // Set the default option of the category. if ($option == '') { $option = array_shift(array_keys($options)); } $alertstab = [ 'text' => ''.html_print_image( 'images/alert@svg.svg', true, [ 'title' => __('Alerts operations'), 'class' => 'invert_filter main_menu_icon', ] ).'', 'active' => $tab == 'massive_alerts', ]; $userstab = [ 'text' => ''.html_print_image( 'images/user.svg', true, [ 'title' => __('Users operations'), 'class' => 'invert_filter main_menu_icon', ] ).'', 'active' => $tab == 'massive_users', ]; $agentstab = [ 'text' => ''.html_print_image( 'images/agents@svg.svg', true, [ 'title' => __('Agents operations'), 'class' => 'invert_filter main_menu_icon', ] ).'', 'active' => $tab == 'massive_agents', ]; $modulestab = [ 'text' => ''.html_print_image( 'images/modules@svg.svg', true, [ 'title' => __('Modules operations'), 'class' => 'invert_filter main_menu_icon', ] ).'', 'active' => $tab == 'massive_modules', ]; $pluginstab = [ 'text' => ''.html_print_image( 'images/plugins@svg.svg', true, [ 'title' => __('Plugins operations'), 'class' => 'invert_filter main_menu_icon', ] ).'', 'active' => $tab == 'massive_plugins', ]; $policiestab = enterprise_hook('massive_policies_tab'); if ($policiestab == ENTERPRISE_NOT_HOOK) { $policiestab = ''; } $snmptab = enterprise_hook('massive_snmp_tab'); if ($snmptab == ENTERPRISE_NOT_HOOK) { $snmptab = ''; } $satellitetab = enterprise_hook('massive_satellite_tab'); if ($satellitetab == ENTERPRISE_NOT_HOOK) { $satellitetab = ''; } $onheader = []; $onheader['massive_agents'] = $agentstab; $onheader['massive_modules'] = $modulestab; $onheader['massive_plugins'] = $pluginstab; if (check_acl($config['id_user'], 0, 'UM')) { $onheader['user_agents'] = $userstab; } $onheader['massive_alerts'] = $alertstab; $onheader['policies'] = $policiestab; $onheader['snmp'] = $snmptab; $onheader['satellite'] = $satellitetab; $onheader['services'] = $servicestab; // Header. if (is_metaconsole() === false) { ui_print_standard_header( __('Bulk operations').' - '.$options[$option], 'images/gm_massive_operations.png', false, $help_header, false, [ $agentstab, $modulestab, $pluginstab, $userstab, $alertstab, $policiestab, $snmptab, $satellitetab, $servicestab, ], [ [ 'link' => '', 'label' => __('Configuration'), ], [ 'link' => '', 'label' => __('Bulk operations'), ], ] ); } else { ui_print_standard_header( __('Bulk operations').' - '.$options[$option], 'images/gm_massive_operations.png', false, $help_header, false, [ $userstab, $agentstab, ], [ [ 'link' => '', 'label' => __('Configuration'), ], [ 'link' => '', 'label' => __('Bulk operations'), ], ] ); } // Checks if the PHP configuration is correctly. if ((get_cfg_var('max_execution_time') != 0) || (get_cfg_var('max_input_time') != -1) ) { echo '