From be3a5204887d6f9c38bc8e0d44207890f7560761 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Fri, 26 Aug 2016 12:41:34 +0200 Subject: [PATCH] Add if use ssl cert and path of this cert. #5 --- .../godmode/setup/setup_general.php | 20 ++++++++++++++++++- pandora_console/include/functions_config.php | 12 +++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index 4e547143d5..b0267c724b 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -20,6 +20,7 @@ check_login (); $table = new StdClass(); $table->class = 'databox filters'; +$table->id = 'setup_general'; $table->width = '100%'; $table->data = array (); $table->size = array(); @@ -74,6 +75,14 @@ $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 Pandora FMS Console. Do you want to continue?') . "')) return false", '', true) .'  '; $table->data[11][1] .= __('No').'   '.html_print_radio_button ('https', 0, '', $config["https"], 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->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); +$table->data[13][1] = html_print_input_text ('cert_path', io_safe_output($config["cert_path"]), '', 50, 255, true); + $table->data[14][0] = __('Attachment store') . ui_print_help_tip (__("Directory where temporary data is stored."), true); $table->data[14][1] = html_print_input_text ('attachment_store', io_safe_output($config["attachment_store"]), '', 50, 255, true); @@ -285,7 +294,6 @@ $table->data[36][0] = __('audit log directory') . ui_print_help_tip (__("Directory where audit log is stored."), true); $table->data[36][1] = html_print_input_text ('auditdir', io_safe_output($config["auditdir"]), '', 30, 100, true); - echo '
'; echo "
"; @@ -358,6 +366,16 @@ $(document).ready (function () { $("#zone").attr("hidden", false); $("#timezone").attr("hidden", false); }); + $("input[name=use_cert]").change(function () { + if( $(this).is(":checked") ){ + var val = $(this).val(); + if (val == 1) { + $('#setup_general-13').show(); + } + else + $('#setup_general-13').hide(); + } + }); });