minor-fix qs_admin interface

This commit is contained in:
fbsanchez 2019-11-07 14:20:29 +01:00
parent 664017aa38
commit ab6e790b4e

View File

@ -312,69 +312,71 @@ function quickShellSettings()
} }
// Parser. // Parser.
// Gotty settings. Internal communication (WS). if (get_parameter('qs_update', false) !== false) {
$gotty = get_parameter( // Gotty settings. Internal communication (WS).
'gotty', $gotty = get_parameter(
'' 'gotty',
); ''
$gotty_host = get_parameter( );
'gotty_host', $gotty_host = get_parameter(
$config['gotty_host'] 'gotty_host',
); $config['gotty_host']
$gotty_ssh_port = get_parameter( );
'gotty_ssh_port', $gotty_ssh_port = get_parameter(
$config['gotty_ssh_port'] 'gotty_ssh_port',
); $config['gotty_ssh_port']
$gotty_telnet_port = get_parameter( );
'gotty_telnet_port', $gotty_telnet_port = get_parameter(
$config['gotty_telnet_port'] 'gotty_telnet_port',
); $config['gotty_telnet_port']
);
$gotty_user = get_parameter( $gotty_user = get_parameter(
'gotty_user', 'gotty_user',
$config['gotty_user'] $config['gotty_user']
); );
$gotty_pass = get_parameter( $gotty_pass = get_parameter(
'gotty_pass', 'gotty_pass',
io_output_password($config['gotty_pass']) io_output_password($config['gotty_pass'])
); );
$gotty_pass = io_input_password($gotty_pass); $gotty_pass = io_input_password($gotty_pass);
$changes = 0; $changes = 0;
$critical = 0; $critical = 0;
if ($config['gotty'] != $gotty) { if ($config['gotty'] != $gotty) {
config_update_value('gotty', $gotty); config_update_value('gotty', $gotty);
$changes++; $changes++;
$critical++; $critical++;
} }
if ($config['gotty_host'] != $gotty_host) { if ($config['gotty_host'] != $gotty_host) {
config_update_value('gotty_host', $gotty_host); config_update_value('gotty_host', $gotty_host);
$changes++; $changes++;
} }
if ($config['gotty_telnet_port'] != $gotty_telnet_port) { if ($config['gotty_telnet_port'] != $gotty_telnet_port) {
config_update_value('gotty_telnet_port', $gotty_telnet_port); config_update_value('gotty_telnet_port', $gotty_telnet_port);
$changes++; $changes++;
} }
if ($config['gotty_ssh_port'] != $gotty_ssh_port) { if ($config['gotty_ssh_port'] != $gotty_ssh_port) {
config_update_value('gotty_ssh_port', $gotty_ssh_port); config_update_value('gotty_ssh_port', $gotty_ssh_port);
$changes++; $changes++;
} }
if ($config['gotty_user'] != $gotty_user) { if ($config['gotty_user'] != $gotty_user) {
config_update_value('gotty_user', $gotty_user); config_update_value('gotty_user', $gotty_user);
$changes++; $changes++;
$critical++; $critical++;
} }
if ($config['gotty_pass'] != $gotty_pass) { if ($config['gotty_pass'] != $gotty_pass) {
config_update_value('gotty_pass', $gotty_pass); config_update_value('gotty_pass', $gotty_pass);
$changes++; $changes++;
$critical++; $critical++;
}
} }
// Interface. // Interface.
@ -460,6 +462,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',