fixed bug in macros of plugin modules

This commit is contained in:
alejandro-campos 2019-05-22 19:14:01 +02:00
parent ba9edc0378
commit 0728c73844
2 changed files with 13 additions and 4 deletions

View File

@ -1220,6 +1220,7 @@ if ($update_module || $create_module) {
// Get macros.
$macros = (string) get_parameter('macros');
$macros_names = (array) get_parameter('macro_name', []);
if (!empty($macros)) {
$macros = json_decode(base64_decode($macros), true);
@ -1230,10 +1231,18 @@ if ($update_module || $create_module) {
$m_hide = $m['hide'];
}
if ($m_hide == '1') {
$macros[$k]['value'] = io_input_password(get_parameter($m['macro'], ''));
if ($update_module) {
if ($m_hide == '1') {
$macros[$k]['value'] = io_input_password(get_parameter($m['macro'], ''));
} else {
$macros[$k]['value'] = get_parameter($m['macro'], '');
}
} else {
$macros[$k]['value'] = get_parameter($m['macro'], '');
if ($m_hide == '1') {
$macros[$k]['value'] = io_input_password($macros_names[$k]);
} else {
$macros[$k]['value'] = $macros_names[$k];
}
}
}

View File

@ -79,7 +79,7 @@ push_table_simple($data, 'plugin_1');
$data = [];
$data[0] = 'macro_desc';
$data[0] .= ui_print_help_tip('macro_help', true);
$data[1] = html_print_input_text('macro_name', 'macro_value', '', 100, 1024, true);
$data[1] = html_print_input_text('macro_name[]', 'macro_value', '', 100, 1024, true);
$table_simple->colspan['macro_field'][1] = 3;
$table_simple->rowstyle['macro_field'] = 'display:none';