allow to remove user/pass from quick_shell configuration

This commit is contained in:
fbsanchez 2019-11-12 13:19:03 +01:00
parent dc565d2575
commit 1a7165f751

View File

@ -298,11 +298,25 @@ function quickShellSettings()
ui_require_css_file('wizard'); ui_require_css_file('wizard');
ui_require_css_file('discovery'); ui_require_css_file('discovery');
// Gotty settings. Internal communication (WS).
if (isset($config['gotty_host']) === false) {
config_update_value('gotty_host', '127.0.0.1');
}
if (isset($config['gotty_telnet_port']) === false) {
config_update_value('gotty_telnet_port', 8082);
}
if (isset($config['gotty_ssh_port']) === false) {
config_update_value('gotty_ssh_port', 8081);
}
// Parser. // Parser.
if (get_parameter('qs_update', false) !== false) {
// Gotty settings. Internal communication (WS). // Gotty settings. Internal communication (WS).
$gotty = get_parameter( $gotty = get_parameter(
'gotty', 'gotty',
$config['gotty'] ''
); );
$gotty_host = get_parameter( $gotty_host = get_parameter(
'gotty_host', 'gotty_host',
@ -319,12 +333,12 @@ function quickShellSettings()
$gotty_user = get_parameter( $gotty_user = get_parameter(
'gotty_user', 'gotty_user',
$config['gotty_user'] ''
); );
$gotty_pass = get_parameter( $gotty_pass = get_parameter(
'gotty_pass', 'gotty_pass',
io_output_password($config['gotty_pass']) ''
); );
$gotty_pass = io_input_password($gotty_pass); $gotty_pass = io_input_password($gotty_pass);
@ -359,10 +373,12 @@ function quickShellSettings()
} }
if ($config['gotty_pass'] != $gotty_pass) { if ($config['gotty_pass'] != $gotty_pass) {
$gotty_pass = io_input_password($gotty_pass);
config_update_value('gotty_pass', $gotty_pass); config_update_value('gotty_pass', $gotty_pass);
$changes++; $changes++;
$critical++; $critical++;
} }
}
// Interface. // Interface.
ui_print_page_header(__('QuickShell settings')); ui_print_page_header(__('QuickShell settings'));
@ -447,6 +463,13 @@ function quickShellSettings()
'value' => io_output_password($config['gotty_pass']), 'value' => io_output_password($config['gotty_pass']),
], ],
], ],
[
'arguments' => [
'type' => 'hidden',
'name' => 'qs_update',
'value' => 1,
],
],
[ [
'arguments' => [ 'arguments' => [
'type' => 'submit', 'type' => 'submit',