From ab6e790b4e848916640d6c40b8f856522e8dd4bc Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 7 Nov 2019 14:20:29 +0100 Subject: [PATCH] minor-fix qs_admin interface --- pandora_console/extensions/quick_shell.php | 117 +++++++++++---------- 1 file changed, 63 insertions(+), 54 deletions(-) diff --git a/pandora_console/extensions/quick_shell.php b/pandora_console/extensions/quick_shell.php index 9946c120ef..9d5d2b8851 100644 --- a/pandora_console/extensions/quick_shell.php +++ b/pandora_console/extensions/quick_shell.php @@ -312,69 +312,71 @@ function quickShellSettings() } // Parser. - // Gotty settings. Internal communication (WS). - $gotty = get_parameter( - 'gotty', - '' - ); - $gotty_host = get_parameter( - 'gotty_host', - $config['gotty_host'] - ); - $gotty_ssh_port = get_parameter( - 'gotty_ssh_port', - $config['gotty_ssh_port'] - ); - $gotty_telnet_port = get_parameter( - 'gotty_telnet_port', - $config['gotty_telnet_port'] - ); + if (get_parameter('qs_update', false) !== false) { + // Gotty settings. Internal communication (WS). + $gotty = get_parameter( + 'gotty', + '' + ); + $gotty_host = get_parameter( + 'gotty_host', + $config['gotty_host'] + ); + $gotty_ssh_port = get_parameter( + 'gotty_ssh_port', + $config['gotty_ssh_port'] + ); + $gotty_telnet_port = get_parameter( + 'gotty_telnet_port', + $config['gotty_telnet_port'] + ); - $gotty_user = get_parameter( - 'gotty_user', - $config['gotty_user'] - ); + $gotty_user = get_parameter( + 'gotty_user', + $config['gotty_user'] + ); - $gotty_pass = get_parameter( - 'gotty_pass', - io_output_password($config['gotty_pass']) - ); + $gotty_pass = get_parameter( + 'gotty_pass', + io_output_password($config['gotty_pass']) + ); - $gotty_pass = io_input_password($gotty_pass); + $gotty_pass = io_input_password($gotty_pass); - $changes = 0; - $critical = 0; - if ($config['gotty'] != $gotty) { - config_update_value('gotty', $gotty); - $changes++; - $critical++; - } + $changes = 0; + $critical = 0; + if ($config['gotty'] != $gotty) { + config_update_value('gotty', $gotty); + $changes++; + $critical++; + } - if ($config['gotty_host'] != $gotty_host) { - config_update_value('gotty_host', $gotty_host); - $changes++; - } + if ($config['gotty_host'] != $gotty_host) { + config_update_value('gotty_host', $gotty_host); + $changes++; + } - if ($config['gotty_telnet_port'] != $gotty_telnet_port) { - config_update_value('gotty_telnet_port', $gotty_telnet_port); - $changes++; - } + if ($config['gotty_telnet_port'] != $gotty_telnet_port) { + config_update_value('gotty_telnet_port', $gotty_telnet_port); + $changes++; + } - if ($config['gotty_ssh_port'] != $gotty_ssh_port) { - config_update_value('gotty_ssh_port', $gotty_ssh_port); - $changes++; - } + if ($config['gotty_ssh_port'] != $gotty_ssh_port) { + config_update_value('gotty_ssh_port', $gotty_ssh_port); + $changes++; + } - if ($config['gotty_user'] != $gotty_user) { - config_update_value('gotty_user', $gotty_user); - $changes++; - $critical++; - } + if ($config['gotty_user'] != $gotty_user) { + config_update_value('gotty_user', $gotty_user); + $changes++; + $critical++; + } - if ($config['gotty_pass'] != $gotty_pass) { - config_update_value('gotty_pass', $gotty_pass); - $changes++; - $critical++; + if ($config['gotty_pass'] != $gotty_pass) { + config_update_value('gotty_pass', $gotty_pass); + $changes++; + $critical++; + } } // Interface. @@ -460,6 +462,13 @@ function quickShellSettings() 'value' => io_output_password($config['gotty_pass']), ], ], + [ + 'arguments' => [ + 'type' => 'hidden', + 'name' => 'qs_update', + 'value' => 1, + ], + ], [ 'arguments' => [ 'type' => 'submit',