diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index c65259fb9a..35eaddd2c3 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -1,5 +1,4 @@ '; echo ''.__('General options').''; -html_print_input_hidden('update_config', 1); -html_print_table($table); + html_print_input_hidden('update_config', 1); + html_print_table($table); $encryption = [ 'ssl' => 'SSL', @@ -529,301 +528,292 @@ echo ''; echo '
'; echo ''.__('Mail configuration').''; -$table_mail_conf->data[0][0] = ui_print_warning_message( - __( - 'Please notice that some providers like Gmail or Office365 need to setup/enable manually external connections using SMTP and you need to use STARTTLS on port 587. + $table_mail_conf->data[0][0] = ui_print_warning_message( + __( + 'Please notice that some providers like Gmail or Office365 need to setup/enable manually external connections using SMTP and you need to use STARTTLS on port 587. If you have manual settings in your pandora_server.conf, please note these settings will ignore this console setup.' - ) -); + ) + ); -$table_mail_conf->data[1][0] = __('From address'); -$table_mail_conf->data[1][1] = html_print_input_text( - 'email_from_dir', - $config['email_from_dir'], - '', - 30, - 100, - true -); - -$table_mail_conf->data[2][0] = __('From name'); -$table_mail_conf->data[2][1] = html_print_input_text( - 'email_from_name', - $config['email_from_name'], - '', - 30, - 100, - true -); - -$table_mail_conf->data[3][0] = __('SMTP Server'); -$table_mail_conf->data[3][1] = html_print_input_text( - 'email_smtpServer', - $config['email_smtpServer'], - '', - 30, - 100, - true -); - -$table_mail_conf->data[4][0] = __('SMTP Port'); -$table_mail_conf->data[4][1] = html_print_input_text( - 'email_smtpPort', - $config['email_smtpPort'], - '', - 30, - 100, - true -); - -$table_mail_conf->data[5][0] = __('Encryption'); -$table_mail_conf->data[5][1] = html_print_select( - $encryption, - 'email_encryption', - $config['email_encryption'], - '', - __('none'), - 0, - true -); - -$table_mail_conf->data[6][0] = __('Email user'); -$table_mail_conf->data[6][1] = html_print_input_text( - 'email_username', - $config['email_username'], - '', - 30, - 100, - true -); - -$table_mail_conf->data[7][0] = __('Email password'); -$table_mail_conf->data[7][1] = html_print_input_password( - 'email_password', - io_output_password( - $config['email_password'] - ), - '', - 30, - 100, - true -); -$table_mail_conf->data[7][1] .= ui_print_reveal_password( - 'email_password', - true -); - -$uniqid = uniqid(); - -$table_mail_conf->data[8][0] = html_print_button( - __('Email test'), - 'email_test_dialog', - false, - "show_email_test('".$uniqid."');", - 'class="sub next"', - true -); - -print_email_test_modal_window($uniqid); - -html_print_input_hidden('update_config', 1); -html_print_table($table_mail_conf); - - -echo '
'; - -echo '
'; - -echo '
'; -html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"'); -echo '
'; -echo ''; - - -/** - * Print the modal window for the summary of each alerts group - * - * @param string $id Id. - * - * @return void - */ -function print_email_test_modal_window($id) -{ - // Email config table. - $table_mail_test = new stdClass(); - $table_mail_test->width = '100%'; - $table_mail_test->class = 'databox filters'; - $table_mail_test->data = []; - $table_mail_test->style[0] = 'font-weight: bold;'; - $table_mail_test->style[1] = 'font-weight: bold;display: flex;height: 54px;align-items: center;padding-left: 15px;'; - - $table_mail_test->data[0][0] = __('Address'); - $table_mail_test->data[0][1] = html_print_input_text( - 'email_test_address', + $table_mail_conf->data[1][0] = __('From address'); + $table_mail_conf->data[1][1] = html_print_input_text( + 'email_from_dir', + $config['email_from_dir'], '', - '', - 35, + 30, 100, true ); - $table_mail_test->data[1][0] = html_print_button( - __('Send'), - 'email_test', - false, + $table_mail_conf->data[2][0] = __('From name'); + $table_mail_conf->data[2][1] = html_print_input_text( + 'email_from_name', + $config['email_from_name'], '', + 30, + 100, + true + ); + + $table_mail_conf->data[3][0] = __('SMTP Server'); + $table_mail_conf->data[3][1] = html_print_input_text( + 'email_smtpServer', + $config['email_smtpServer'], + '', + 30, + 100, + true + ); + + $table_mail_conf->data[4][0] = __('SMTP Port'); + $table_mail_conf->data[4][1] = html_print_input_text( + 'email_smtpPort', + $config['email_smtpPort'], + '', + 30, + 100, + true + ); + + $table_mail_conf->data[5][0] = __('Encryption'); + $table_mail_conf->data[5][1] = html_print_select( + $encryption, + 'email_encryption', + $config['email_encryption'], + '', + __('none'), + 0, + true + ); + + $table_mail_conf->data[6][0] = __('Email user'); + $table_mail_conf->data[6][1] = html_print_input_text( + 'email_username', + $config['email_username'], + '', + 30, + 100, + true + ); + + $table_mail_conf->data[7][0] = __('Email password'); + $table_mail_conf->data[7][1] = html_print_input_password( + 'email_password', + io_output_password( + $config['email_password'] + ), + '', + 30, + 100, + true + ); + $table_mail_conf->data[7][1] .= ui_print_reveal_password( + 'email_password', + true + ); + + $uniqid = uniqid(); + + $table_mail_conf->data[8][0] = html_print_button( + __('Email test'), + 'email_test_dialog', + false, + "show_email_test('".$uniqid."');", 'class="sub next"', true ); - $table_mail_test->data[1][1] = '  Email could not be sent'; + print_email_test_modal_window($uniqid); - echo ''; + html_print_input_hidden('update_config', 1); + html_print_table($table_mail_conf); + + + echo '
'; + + echo '
'; + + echo '
'; + html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"'); + echo '
'; + echo ''; + + + /** + * Print the modal window for the summary of each alerts group + * + * @param string $id Id. + * + * @return void + */ + function print_email_test_modal_window($id) + { + // Email config table. + $table_mail_test = new stdClass(); + $table_mail_test->width = '100%'; + $table_mail_test->class = 'databox filters'; + $table_mail_test->data = []; + $table_mail_test->style[0] = 'font-weight: bold;'; + $table_mail_test->style[1] = 'font-weight: bold;display: flex;height: 54px;align-items: center;padding-left: 15px;'; + + $table_mail_test->data[0][0] = __('Address'); + $table_mail_test->data[0][1] = html_print_input_text( + 'email_test_address', + '', + '', + 35, + 100, + true + ); + + $table_mail_test->data[1][0] = html_print_button( + __('Send'), + 'email_test', + false, + '', + 'class="sub next"', + true + ); + + $table_mail_test->data[1][1] = '  Email could not be sent'; + + echo ''; + } + + + ?> +