From b7bf265cb463401f1db8c71c4505c830b4a065b6 Mon Sep 17 00:00:00 2001 From: Marcos Alconada Date: Wed, 3 Feb 2021 11:09:38 +0100 Subject: [PATCH] changed ssl/tls to ssl --- .../godmode/setup/setup_general.php | 518 +++++++++++++++--- 1 file changed, 427 insertions(+), 91 deletions(-) diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index 004f31ccad..c90a97a60e 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -110,56 +110,147 @@ $table->data[$i++][1] = html_print_select_from_sql( ); $table->data[$i][0] = __('Remote config directory'); -$table->data[$i++][1] = html_print_input_text('remote_config', io_safe_output($config['remote_config']), '', 30, 100, true); +$table->data[$i++][1] = html_print_input_text( + 'remote_config', + io_safe_output($config['remote_config']), + '', + 30, + 100, + true +); $table->data[$i][0] = __('Phantomjs bin directory'); -$table->data[$i++][1] = html_print_input_text('phantomjs_bin', io_safe_output($config['phantomjs_bin']), '', 30, 100, true); +$table->data[$i++][1] = html_print_input_text( + 'phantomjs_bin', + io_safe_output( + $config['phantomjs_bin'] + ), + '', + 30, + 100, + true +); $table->data[$i][0] = __('Auto login (hash) password'); -$table->data[$i][1] = html_print_input_password('loginhash_pwd', io_output_password($config['loginhash_pwd']), '', 15, 15, true); -$table->data[$i++][1] .= ui_print_reveal_password('loginhash_pwd', true); +$table->data[$i][1] = html_print_input_password( + 'loginhash_pwd', + io_output_password($config['loginhash_pwd']), + '', + 15, + 15, + true +); +$table->data[$i++][1] .= ui_print_reveal_password( + 'loginhash_pwd', + true +); $table->data[$i][0] = __('Time source'); $sources['system'] = __('System'); $sources['sql'] = __('Database'); -$table->data[$i++][1] = html_print_select($sources, 'timesource', $config['timesource'], '', '', '', true); +$table->data[$i++][1] = html_print_select( + $sources, + 'timesource', + $config['timesource'], + '', + '', + '', + true +); $table->data[$i][0] = __('Automatic check for updates'); -$table->data[$i++][1] = html_print_checkbox_switch('autoupdate', 1, $config['autoupdate'], true); +$table->data[$i++][1] = html_print_checkbox_switch( + 'autoupdate', + 1, + $config['autoupdate'], + true +); echo "'; $table->data[$i][0] = __('Enforce https'); -$table->data[$i++][1] = html_print_checkbox_switch_extended('https', 1, $config['https'], false, '', '', true); +$table->data[$i++][1] = html_print_checkbox_switch_extended( + 'https', + 1, + $config['https'], + false, + '', + '', + true +); $table->data[$i][0] = __('Use cert of SSL'); -$table->data[$i++][1] = html_print_checkbox_switch_extended('use_cert', 1, $config['use_cert'], false, '', '', true); +$table->data[$i++][1] = html_print_checkbox_switch_extended( + 'use_cert', + 1, + $config['use_cert'], + false, + '', + '', + true +); $table->rowstyle[$i] = 'display: none;'; $table->rowid[$i] = 'ssl-path-tr'; $table->data[$i][0] = __('Path of SSL Cert.'); -$table->data[$i++][1] = html_print_input_text('cert_path', io_safe_output($config['cert_path']), '', 50, 255, true); +$table->data[$i++][1] = html_print_input_text( + 'cert_path', + io_safe_output($config['cert_path']), + '', + 50, + 255, + true +); $table->data[$i][0] = __('Attachment store'); -$table->data[$i++][1] = html_print_input_text('attachment_store', io_safe_output($config['attachment_store']), '', 50, 255, true); +$table->data[$i++][1] = html_print_input_text( + 'attachment_store', + io_safe_output($config['attachment_store']), + '', + 50, + 255, + true +); $table->data[$i][0] = __('IP list with API access'); if (isset($_POST['list_ACL_IPs_for_API'])) { $list_ACL_IPs_for_API = get_parameter_post('list_ACL_IPs_for_API'); } else { - $list_ACL_IPs_for_API = get_parameter_get('list_ACL_IPs_for_API', implode("\n", $config['list_ACL_IPs_for_API'])); + $list_ACL_IPs_for_API = get_parameter_get( + 'list_ACL_IPs_for_API', + implode("\n", $config['list_ACL_IPs_for_API']) + ); } -$table->data[$i++][1] = html_print_textarea('list_ACL_IPs_for_API', 2, 25, $list_ACL_IPs_for_API, 'style="height: 50px; width: 300px"', true); +$table->data[$i++][1] = html_print_textarea( + 'list_ACL_IPs_for_API', + 2, + 25, + $list_ACL_IPs_for_API, + 'style="height: 50px; width: 300px"', + true +); $table->data[$i][0] = __('API password'); -$table->data[$i][1] = html_print_input_password('api_password', io_output_password($config['api_password']), '', 25, 255, true); +$table->data[$i][1] = html_print_input_password( + 'api_password', + io_output_password($config['api_password']), + '', + 25, + 255, + true +); $table->data[$i++][1] .= ui_print_reveal_password('api_password', true); $table->data[$i][0] = __('Enable GIS features'); -$table->data[$i++][1] = html_print_checkbox_switch('activate_gis', 1, $config['activate_gis'], true); +$table->data[$i++][1] = html_print_checkbox_switch( + 'activate_gis', + 1, + $config['activate_gis'], + true +); $table->data[$i][0] = __('Enable Netflow'); $rbt_disabled = false; @@ -167,7 +258,15 @@ if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { $rbt_disabled = true; } -$table->data[$i++][1] = html_print_checkbox_switch_extended('activate_netflow', 1, $config['activate_netflow'], $rbt_disabled, '', '', true); +$table->data[$i++][1] = html_print_checkbox_switch_extended( + 'activate_netflow', + 1, + $config['activate_netflow'], + $rbt_disabled, + '', + '', + true +); $table->data[$i][0] = __('Enable Network Traffic Analyzer'); $table->data[$i++][1] = html_print_switch( @@ -222,28 +321,106 @@ $table->data[$i][1] = html_print_input_text_extended( 'readonly', true ); -$table->data[$i][1] .= ''.html_print_image('images/pencil.png', true, ['title' => __('Change timezone')]).''; -$table->data[$i][1] .= '  '.html_print_select($zone_name, 'zone', $zone_selected, 'show_timezone();', '', '', true); -$table->data[$i++][1] .= '  '.html_print_select($timezone_n, 'timezone', $config['timezone'], '', '', '', true); +$table->data[$i][1] .= ''.html_print_image( + 'images/pencil.png', + true, + ['title' => __('Change timezone')] +).''; +$table->data[$i][1] .= '  '.html_print_select( + $zone_name, + 'zone', + $zone_selected, + 'show_timezone();', + '', + '', + true +); +$table->data[$i++][1] .= '  '.html_print_select( + $timezone_n, + 'timezone', + $config['timezone'], + '', + '', + '', + true +); $sounds = get_sounds(); $table->data[$i][0] = __('Sound for Alert fired'); -$table->data[$i][1] = html_print_select($sounds, 'sound_alert', $config['sound_alert'], 'replaySound(\'alert\');', '', '', true); -$table->data[$i][1] .= ' '.html_print_image('images/control_play_col.png', true, ['id' => 'button_sound_alert', 'style' => 'vertical-align: middle;', 'width' => '16', 'title' => __('Play sound')]).''; +$table->data[$i][1] = html_print_select( + $sounds, + 'sound_alert', + $config['sound_alert'], + 'replaySound(\'alert\');', + '', + '', + true +); +$table->data[$i][1] .= ' '.html_print_image( + 'images/control_play_col.png', + true, + [ + 'id' => 'button_sound_alert', + 'style' => 'vertical-align: middle;', + 'width' => '16', + 'title' => __('Play sound'), + ] +).''; $table->data[$i++][1] .= '
'; $table->data[$i][0] = __('Sound for Monitor critical'); -$table->data[$i][1] = html_print_select($sounds, 'sound_critical', $config['sound_critical'], 'replaySound(\'critical\');', '', '', true); -$table->data[$i][1] .= ' '.html_print_image('images/control_play_col.png', true, ['id' => 'button_sound_critical', 'style' => 'vertical-align: middle;', 'width' => '16', 'title' => __('Play sound')]).''; +$table->data[$i][1] = html_print_select( + $sounds, + 'sound_critical', + $config['sound_critical'], + 'replaySound(\'critical\');', + '', + '', + true +); +$table->data[$i][1] .= ' '.html_print_image( + 'images/control_play_col.png', + true, + [ + 'id' => 'button_sound_critical', + 'style' => 'vertical-align: middle;', + 'width' => '16', + 'title' => __('Play sound'), + ] +).''; $table->data[$i++][1] .= '
'; $table->data[$i][0] = __('Sound for Monitor warning'); -$table->data[$i][1] = html_print_select($sounds, 'sound_warning', $config['sound_warning'], 'replaySound(\'warning\');', '', '', true); -$table->data[$i][1] .= ' '.html_print_image('images/control_play_col.png', true, ['id' => 'button_sound_warning', 'style' => 'vertical-align: middle;', 'width' => '16', 'title' => __('Play sound')]).''; +$table->data[$i][1] = html_print_select( + $sounds, + 'sound_warning', + $config['sound_warning'], + 'replaySound(\'warning\');', + '', + '', + true +); +$table->data[$i][1] .= ' '.html_print_image( + 'images/control_play_col.png', + true, + [ + 'id' => 'button_sound_warning', + 'style' => 'vertical-align: middle;', + 'width' => '16', + 'title' => __('Play sound'), + ] +).''; $table->data[$i++][1] .= '
'; $table->data[$i][0] = __('Public URL'); -$table->data[$i++][1] = html_print_input_text('public_url', $config['public_url'], '', 40, 255, true); +$table->data[$i++][1] = html_print_input_text( + 'public_url', + $config['public_url'], + '', + 40, + 255, + true +); $table->data[$i][0] = __('Force use Public URL'); $table->data[$i++][1] = html_print_switch( @@ -253,25 +430,54 @@ $table->data[$i++][1] = html_print_switch( ] ); -echo "