diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index b0d91124af..0ee00a8f17 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.731-190208 +Version: 7.0NG.731-190214 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 18b7ecf8d3..9ebfc5d3dc 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.731-190208" +pandora_version="7.0NG.731-190214" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 52420004de..664a9964e3 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.731'; -use constant AGENT_BUILD => '190208'; +use constant AGENT_BUILD => '190214'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 3993a5bd13..5c097c9a07 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.731 -%define release 190208 +%define release 190214 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 442973f4b5..820f5d3ec1 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.731 -%define release 190208 +%define release 190214 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 2120d8b93d..8adeac4f7a 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.731" -PI_BUILD="190208" +PI_BUILD="190214" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 008d448846..3b606d8ec0 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190208} +{190214} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 3b53ff7396..30fff5f13b 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.731(Build 190208)") +#define PANDORA_VERSION ("7.0NG.731(Build 190214)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index e4f02cd597..a34c9905ea 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.731(Build 190208))" + VALUE "ProductVersion", "(7.0NG.731(Build 190214))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 94f0ca1d13..285b64c80f 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.731-190208 +Version: 7.0NG.731-190214 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index ae82ac8e38..02c1b2ed71 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.731-190208" +pandora_version="7.0NG.731-190214" package_pear=0 package_pandora=1 diff --git a/pandora_console/general/main_menu.php b/pandora_console/general/main_menu.php index 612a03aa77..27aa2f69bd 100644 --- a/pandora_console/general/main_menu.php +++ b/pandora_console/general/main_menu.php @@ -320,6 +320,23 @@ $(document).ready( function() { } else { $('div#title_menu').hide(); + if(!click_display){ + $('#menu').mouseenter(function() { + handsInMenu = 1; + openTimeMenu = new Date().getTime(); + $('ul.submenu').css('left', '44px'); + }).mouseleave(function() { + handsInMenu = 0; + setTimeout(function() { + openedMenu = new Date().getTime() - openTimeMenu; + if(openedMenu > 1000 && handsInMenu == 0) { + $('li.menu_icon').removeClass( " no_hidden_menu"); + $('li.menu_icon').find('li').removeClass( " no_hidden_menu" ); + $('ul.submenu').css('left', '44px'); + } + }, 2500); + }); + } } }); /* ]]> */ @@ -332,7 +349,6 @@ $(document).ready( function() { handsIn2 = 0; if(!click_display){ - if (autohidden_menu) { $('.menu_icon').mouseenter(function() { table_hover = $(this); handsIn = 1; @@ -352,7 +368,6 @@ $(document).ready( function() { } }, 2500); }); - } }else{ $(document).ready(function() { if (autohidden_menu) { diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 1ce3b82e53..dfa28988a8 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -945,6 +945,10 @@ if ($update_agent) { $disabled ? '1' : '0', ] ); + // Validate alerts for disabled agents. + if ($disabled) { + alerts_validate_alert_agent($id_agente); + } } if ($tpolicy_group_old) { diff --git a/pandora_console/godmode/agentes/module_manager_editor_wmi.php b/pandora_console/godmode/agentes/module_manager_editor_wmi.php index ba40f75b00..e7f38447cf 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_wmi.php +++ b/pandora_console/godmode/agentes/module_manager_editor_wmi.php @@ -44,8 +44,7 @@ if (empty($update_module_id)) { $data = []; $data[0] = __('Target IP'); $data[1] = html_print_input_text('ip_target', $ip_target, '', 15, 60, true); -$data[2] = __('Namespace'); -$data[2] .= ui_print_help_icon('wminamespace', true); +$data[2] = __('Namespace').ui_print_help_tip(__('Optional. WMI namespace. If unsure leave blank.'), true); $data[3] = html_print_input_text( 'tcp_send', $tcp_send, @@ -110,8 +109,7 @@ $table_simple->colspan['wmi_query'][1] = 3; push_table_simple($data, 'wmi_query'); $data = []; -$data[0] = __('Key string'); -$data[0] .= ui_print_help_icon('wmikey', true); +$data[0] = __('Key string').ui_print_help_tip(__('Optional. Substring to look for in the WQL query result. The module returns 1 if found, 0 if not.'), true); $data[1] = html_print_input_text( 'snmp_community', $snmp_community, @@ -124,8 +122,7 @@ $data[1] = html_print_input_text( '', $classdisabledBecauseInPolicy ); -$data[2] = __('Field number'); -$data[2] .= ui_print_help_icon('wmifield', true); +$data[2] = __('Field number').ui_print_help_tip(__('Column number to retrieve from the WQL query result (starting from zero).'), true); $data[3] = html_print_input_text( 'tcp_port', $tcp_port, diff --git a/pandora_console/godmode/massive/massive_edit_agents.php b/pandora_console/godmode/massive/massive_edit_agents.php index a79e426a3d..2011eec564 100755 --- a/pandora_console/godmode/massive/massive_edit_agents.php +++ b/pandora_console/godmode/massive/massive_edit_agents.php @@ -205,6 +205,10 @@ if ($update_agents) { $values['disabled'], ] ); + // Validate alerts for disabled agents. + if ($values['disabled'] == 1) { + alerts_validate_alert_agent($id_agent); + } } if ($group_old || $result) { diff --git a/pandora_console/godmode/modules/manage_network_components_form.php b/pandora_console/godmode/modules/manage_network_components_form.php index e951b77bf4..3f9a33cb8a 100644 --- a/pandora_console/godmode/modules/manage_network_components_form.php +++ b/pandora_console/godmode/modules/manage_network_components_form.php @@ -47,7 +47,7 @@ if ($create_network_from_module) { $id_module_group = $data_module['id_module_group']; $id_plugin = $data_module['id_plugin']; $plugin_user = $data_module['plugin_user']; - $plugin_pass = $data_module['plugin_pass']; + $plugin_pass = io_output_password($data_module['plugin_pass']); $plugin_parameter = $data_module['plugin_parameter']; $macros = $data_module['macros']; $max_timeout = $data_module['max_timeout']; @@ -104,7 +104,7 @@ if (isset($id)) { $id_group = $component['id_group']; $id_plugin = $component['id_plugin']; $plugin_user = $component['plugin_user']; - $plugin_pass = $component['plugin_pass']; + $plugin_pass = io_output_password($component['plugin_pass']); $plugin_parameter = $component['plugin_parameter']; $macros = $component['macros']; $max_timeout = $component['max_timeout']; @@ -140,10 +140,10 @@ if (isset($id)) { // New support for snmp v3 $snmp_version = $component['tcp_send']; $snmp3_auth_user = $component['plugin_user']; - $snmp3_auth_pass = $component['plugin_pass']; + $snmp3_auth_pass = io_output_password($component['plugin_pass']); $snmp3_auth_method = $component['plugin_parameter']; $snmp3_privacy_method = $component['custom_string_1']; - $snmp3_privacy_pass = $component['custom_string_2']; + $snmp3_privacy_pass = io_output_password($component['custom_string_2']); $snmp3_security_level = $component['custom_string_3']; } } else if (isset($new_component) && $new_component && !$create_network_from_snmp_browser) { diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index 66d288372a..6a20eeb30d 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -42,6 +42,7 @@ if (!$is_metaconsole) { $url_visual_console_favorite = 'index.php?sec=screen&sec2=screens/screens&action=visualmap_favorite'; $url_visual_console_template = 'index.php?sec=screen&sec2=screens/screens&action=visualmap_template'; $url_visual_console_template_wizard = 'index.php?sec=screen&sec2=screens/screens&action=visualmap_wizard'; + $url_visual_console_manager = 'index.php?sec=screen&sec2=enterprise/extensions/visual_console_manager'; } $pure = (int) get_parameter('pure', 0); @@ -70,6 +71,12 @@ if ($is_enterprise && $vconsoles_manage) { 'active' => false, 'text' => ''.html_print_image('images/wand.png', true, ['title' => __('Visual Console Template Wizard')]).'', ]; + if ($is_metaconsole) { + $buttons['visual_console_manager'] = [ + 'active' => false, + 'text' => ''.html_print_image('images/builder.png', true, ['title' => __('Visual Console Manager')]).'', + ]; + } } if (!$is_metaconsole) { diff --git a/pandora_console/godmode/reporting/visual_console_favorite.php b/pandora_console/godmode/reporting/visual_console_favorite.php index df407297be..df13291539 100644 --- a/pandora_console/godmode/reporting/visual_console_favorite.php +++ b/pandora_console/godmode/reporting/visual_console_favorite.php @@ -41,6 +41,7 @@ if (!$is_metaconsole) { $url_visual_console_favorite = 'index.php?sec=screen&sec2=screens/screens&action=visualmap_favorite'; $url_visual_console_template = 'index.php?sec=screen&sec2=screens/screens&action=visualmap_template'; $url_visual_console_template_wizard = 'index.php?sec=screen&sec2=screens/screens&action=visualmap_wizard'; + $url_visual_console_manager = 'index.php?sec=screen&sec2=enterprise/extensions/visual_console_manager'; } $buttons['visual_console'] = [ @@ -63,6 +64,13 @@ if ($is_enterprise && $vconsoles_manage) { 'active' => false, 'text' => ''.html_print_image('images/wand.png', true, ['title' => __('Visual Console Template Wizard')]).'', ]; + + if ($is_metaconsole) { + $buttons['visual_console_manager'] = [ + 'active' => false, + 'text' => ''.html_print_image('images/builder.png', true, ['title' => __('Visual Console Manager')]).'', + ]; + } } if (!$is_metaconsole) { diff --git a/pandora_console/godmode/setup/performance.php b/pandora_console/godmode/setup/performance.php index 4c99c79232..66c99ea57c 100644 --- a/pandora_console/godmode/setup/performance.php +++ b/pandora_console/godmode/setup/performance.php @@ -560,17 +560,9 @@ $table_other->data[3][1] = html_print_input_text( ); $table_other->data[5][0] = __('Use realtime statistics'); -$table_other->data[5][1] = __('Yes').' '.html_print_radio_button( +$table_other->data[5][1] = html_print_checkbox_toogle_switch( 'realtimestats', 1, - '', - $config['realtimestats'], - true -).' '; -$table_other->data[5][1] .= __('No').' '.html_print_radio_button( - 'realtimestats', - 0, - '', $config['realtimestats'], true ); @@ -589,27 +581,8 @@ $table_other->data[6][1] = html_print_input_text( true ); -$table_other->data[7][0] = __('Use agent access graph'); -$table_other->data[7][0] .= ui_print_help_icon( - 'agent_access', - true -); -$table_other->data[7][1] = __('Yes').' '; -$table_other->data[7][1] .= html_print_radio_button( - 'agentaccess', - 1, - '', - $config['agentaccess'], - true -).' '; -$table_other->data[7][1] .= __('No').' '; -$table_other->data[7][1] .= html_print_radio_button( - 'agentaccess', - 0, - '', - $config['agentaccess'], - true -); +$table_other->data[7][0] = __('Use agent access graph').ui_print_help_icon('agent_access', true); +$table_other->data[7][1] = html_print_checkbox_toogle_switch('agentaccess', 1, $config['agentaccess'], true); $table_other->data[8][0] = __('Max. recommended number of files in attachment directory'); $table_other->data[8][0] .= ui_print_help_tip( @@ -626,21 +599,7 @@ $table_other->data[8][1] = html_print_input_text( ); $table_other->data[9][0] = __('Delete not init modules'); -$table_other->data[9][1] = __('Yes').' '; -$table_other->data[9][1] .= html_print_radio_button( - 'delete_notinit', - 1, - '', - $config['delete_notinit'], - true -).' '; -$table_other->data[9][1] .= __('No').' '.html_print_radio_button( - 'delete_notinit', - 0, - '', - $config['delete_notinit'], - true -); +$table_other->data[9][1] = html_print_checkbox_toogle_switch('delete_notinit', 1, $config['delete_notinit'], true); $table_other->data[10][0] = __('Big Operation Step to purge old data'); $table_other->data[10][0] .= ui_print_help_tip( diff --git a/pandora_console/godmode/setup/setup_auth.php b/pandora_console/godmode/setup/setup_auth.php index 925f967622..4d5eeb07ff 100644 --- a/pandora_console/godmode/setup/setup_auth.php +++ b/pandora_console/godmode/setup/setup_auth.php @@ -44,16 +44,14 @@ if (is_ajax()) { // Fallback to local authentication $row = []; $row['name'] = __('Fallback to local authentication').ui_print_help_tip(__('Enable this option if you want to fallback to local authentication when remote (ldap etc...) authentication failed.'), true); - $row['control'] = __('Yes').' '.html_print_radio_button('fallback_local_auth', 1, '', $config['fallback_local_auth'], true).' '; - $row['control'] .= __('No').' '.html_print_radio_button('fallback_local_auth', 0, '', $config['fallback_local_auth'], true); + $row['control'] = html_print_checkbox_toogle_switch('fallback_local_auth', 1, $config['fallback_local_auth'], true); $table->data['fallback_local_auth'] = $row; if (enterprise_installed()) { // Autocreate remote users $row = []; $row['name'] = __('Autocreate remote users'); - $row['control'] = __('Yes').' '.html_print_radio_button_extended('autocreate_remote_users', 1, '', $config['autocreate_remote_users'], false, '', '', true).' '; - $row['control'] .= __('No').' '.html_print_radio_button_extended('autocreate_remote_users', 0, '', $config['autocreate_remote_users'], false, '', '', true); + $row['control'] = html_print_checkbox_toogle_switch_extended('autocreate_remote_users', 1, $config['autocreate_remote_users'], false, '', '', true).' '; $table->data['autocreate_remote_users'] = $row; add_enterprise_auth_autocreate_profiles($table, $type_auth); @@ -91,8 +89,7 @@ if (is_ajax()) { // Start TLS $row = []; $row['name'] = __('Start TLS'); - $row['control'] = __('Yes').' '.html_print_radio_button('ldap_start_tls', 1, '', $config['ldap_start_tls'], true).' '; - $row['control'] .= __('No').' '.html_print_radio_button('ldap_start_tls', 0, '', $config['ldap_start_tls'], true); + $row['control'] = html_print_checkbox_toogle_switch('ldap_start_tls', 1, $config['ldap_start_tls'], true); $table->data['ldap_start_tls'] = $row; // Base DN @@ -137,11 +134,7 @@ if (is_ajax()) { set_unless_defined($config['double_auth_enabled'], false); $row = []; $row['name'] = __('Double authentication').ui_print_help_tip(__('If this option is enabled, the users can use double authentication with their accounts'), true); - $row['control'] = __('Yes').' '; - $row['control'] .= html_print_radio_button('double_auth_enabled', 1, '', $config['double_auth_enabled'], true); - $row['control'] .= ' '; - $row['control'] .= __('No').' '; - $row['control'] .= html_print_radio_button('double_auth_enabled', 0, '', $config['double_auth_enabled'], true); + $row['control'] = html_print_checkbox_toogle_switch('double_auth_enabled', 1, $config['double_auth_enabled'], true); $table->data['double_auth_enabled'] = $row; // Session timeout diff --git a/pandora_console/godmode/setup/setup_ehorus.php b/pandora_console/godmode/setup/setup_ehorus.php index 5ef355b071..f51854a63c 100644 --- a/pandora_console/godmode/setup/setup_ehorus.php +++ b/pandora_console/godmode/setup/setup_ehorus.php @@ -48,8 +48,8 @@ $table_enable->style['name'] = 'font-weight: bold'; // Enable eHorus $row = []; $row['name'] = __('Enable eHorus'); -$row['control'] = __('Yes').' '.html_print_radio_button('ehorus_enabled', 1, '', $config['ehorus_enabled'], true).' '; -$row['control'] .= __('No').' '.html_print_radio_button('ehorus_enabled', 0, '', $config['ehorus_enabled'], true); +$row['control'] = __('Enabled').' '.html_print_radio_button('ehorus_enabled', 1, '', $config['ehorus_enabled'], true).' '; +$row['control'] .= __('Disabled').' '.html_print_radio_button('ehorus_enabled', 0, '', $config['ehorus_enabled'], true); $row['button'] = html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"', true); $table_enable->data['ehorus_enabled'] = $row; diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index ee924c9c27..8196d98873 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -82,16 +82,17 @@ $sources['sql'] = __('Database'); $table->data[9][1] = html_print_select($sources, 'timesource', $config['timesource'], '', '', '', true); $table->data[10][0] = __('Automatic check for updates'); -$table->data[10][1] = __('Yes').' '.html_print_radio_button('autoupdate', 1, '', $config['autoupdate'], true).' '; -$table->data[10][1] .= __('No').' '.html_print_radio_button('autoupdate', 0, '', $config['autoupdate'], true); +$table->data[10][1] = html_print_checkbox_toogle_switch('autoupdate', 1, $config['autoupdate'], true); + +echo "
'; $table->data[11][0] = __('Enforce https'); -$table->data[11][1] = __('Yes').' '.html_print_radio_button_extended('https', 1, '', $config['https'], false, "if (! confirm ('".__('If SSL is not properly configured you will lose access to %s Console. Do you want to continue?', get_product_name())."')) return false", '', true).' '; -$table->data[11][1] .= __('No').' '.html_print_radio_button('https', 0, '', $config['https'], true); +$table->data[11][1] = html_print_checkbox_toogle_switch_extended('https', 1, $config['https'], false, '', '', true); $table->data[12][0] = __('Use cert of SSL'); -$table->data[12][1] = __('Yes').' '.html_print_radio_button_extended('use_cert', 1, '', $config['use_cert'], false, '', '', true).' '; -$table->data[12][1] .= __('No').' '.html_print_radio_button('use_cert', 0, '', $config['use_cert'], true); +$table->data[12][1] = html_print_checkbox_toogle_switch_extended('use_cert', 1, $config['use_cert'], false, '', '', true); $table->rowstyle[13] = 'display: none;'; $table->data[13][0] = __('Path of SSL Cert.').ui_print_help_tip(__('Path where you put your cert and name of this cert. Remember your cert only in .pem extension.'), true); @@ -113,8 +114,7 @@ $table->data[16][0] = __('API password').ui_print_help_tip(__('Please be careful $table->data[16][1] = html_print_input_password('api_password', io_output_password($config['api_password']), '', 25, 255, true); $table->data[17][0] = __('Enable GIS features'); -$table->data[17][1] = __('Yes').' '.html_print_radio_button('activate_gis', 1, '', $config['activate_gis'], true).' '; -$table->data[17][1] .= __('No').' '.html_print_radio_button('activate_gis', 0, '', $config['activate_gis'], true); +$table->data[17][1] = html_print_checkbox_toogle_switch('activate_gis', 1, $config['activate_gis'], true); $table->data[19][0] = __('Enable Netflow'); $rbt_disabled = false; @@ -123,8 +123,8 @@ if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { $table->data[19][0] .= ui_print_help_tip(__('Not supported in Windows systems'), true); } -$table->data[19][1] = __('Yes').' '.html_print_radio_button_extended('activate_netflow', 1, '', $config['activate_netflow'], $rbt_disabled, '', '', true).' '; -$table->data[19][1] .= __('No').' '.html_print_radio_button_extended('activate_netflow', 0, '', $config['activate_netflow'], $rbt_disabled, '', '', true); +$table->data[19][1] = html_print_checkbox_toogle_switch_extended('activate_netflow', 1, $config['activate_netflow'], $rbt_disabled, '', '', true); + $zone_name = [ 'Africa' => __('Africa'), @@ -202,18 +202,15 @@ $table->data[28][1] = html_print_input_text('public_url', $config['public_url'], $table->data[29][0] = __('Referer security'); $table->data[29][0] .= ui_print_help_tip(__("If enabled, actively checks if the user comes from %s's URL", get_product_name()), true); -$table->data[29][1] = __('Yes').' '.html_print_radio_button('referer_security', 1, '', $config['referer_security'], true).' '; -$table->data[29][1] .= __('No').' '.html_print_radio_button('referer_security', 0, '', $config['referer_security'], true); +$table->data[29][1] = html_print_checkbox_toogle_switch('referer_security', 1, $config['referer_security'], true); $table->data[30][0] = __('Event storm protection'); $table->data[30][0] .= ui_print_help_tip(__('If set to yes no events or alerts will be generated, but agents will continue receiving data.'), true); -$table->data[30][1] = __('Yes').' '.html_print_radio_button('event_storm_protection', 1, '', $config['event_storm_protection'], true).' '; -$table->data[30][1] .= __('No').' '.html_print_radio_button('event_storm_protection', 0, '', $config['event_storm_protection'], true); +$table->data[30][1] = html_print_checkbox_toogle_switch('event_storm_protection', 1, $config['event_storm_protection'], true); $table->data[31][0] = __('Command Snapshot').ui_print_help_tip(__('The string modules with several lines show as command output'), true); -$table->data[31][1] = __('Yes').' '.html_print_radio_button('command_snapshot', 1, '', $config['command_snapshot'], true).' '; -$table->data[31][1] .= __('No').' '.html_print_radio_button('command_snapshot', 0, '', $config['command_snapshot'], true); +$table->data[31][1] = html_print_checkbox_toogle_switch('command_snapshot', 1, $config['command_snapshot'], true); $table->data[32][0] = __('Server logs directory').ui_print_help_tip(__('Directory where the server logs are stored.'), true); $table->data[32][1] = html_print_input_text( @@ -253,8 +250,7 @@ $table->data['tutorial_mode'][1] = html_print_select( $config['past_planned_downtimes'] = isset($config['past_planned_downtimes']) ? $config['past_planned_downtimes'] : 1; $table->data[34][0] = __('Allow create planned downtimes in the past').ui_print_help_tip(__('The planned downtimes created in the past will affect the SLA reports'), true); -$table->data[34][1] = __('Yes').' '.html_print_radio_button('past_planned_downtimes', 1, '', $config['past_planned_downtimes'], true).' '; -$table->data[34][1] .= __('No').' '.html_print_radio_button('past_planned_downtimes', 0, '', $config['past_planned_downtimes'], true); +$table->data[34][1] = html_print_checkbox_toogle_switch('past_planned_downtimes', 1, $config['past_planned_downtimes'], true); $table->data[35][0] = __('Limit for bulk operations').ui_print_help_tip(__('Your PHP environment is set to 1000 max_input_vars. This parameter should have the same value or lower.', ini_get('max_input_vars')), true); $table->data[35][1] = html_print_input_text( @@ -267,16 +263,13 @@ $table->data[35][1] = html_print_input_text( ); $table->data[36][0] = __('Include agents manually disabled'); -$table->data[36][1] = __('Yes').' '.html_print_radio_button('include_agents', 1, '', $config['include_agents'], true).' '; -$table->data[36][1] .= __('No').' '.html_print_radio_button('include_agents', 0, '', $config['include_agents'], true); +$table->data[36][1] = html_print_checkbox_toogle_switch('include_agents', 1, $config['include_agents'], true); $table->data[37][0] = __('Audit log directory').ui_print_help_tip(__('Directory where audit log is stored.'), true); $table->data[37][1] = html_print_input_text('auditdir', io_safe_output($config['auditdir']), '', 30, 100, true); $table->data[38][0] = __('Set alias as name by default in agent creation'); -$table->data[38][1] = __('Yes').' '.html_print_radio_button('alias_as_name', 1, '', $config['alias_as_name'], true).' '; -$table->data[38][1] .= __('No').' '.html_print_radio_button('alias_as_name', 0, '', $config['alias_as_name'], true); - +$table->data[38][1] = html_print_checkbox_toogle_switch('alias_as_name', 1, $config['alias_as_name'], true); echo '