This commit is contained in:
fbsanchez 2022-03-28 15:09:21 +02:00
parent b832fd17e4
commit dd798d6f52
2 changed files with 58 additions and 27 deletions

View File

@ -390,12 +390,13 @@ $ui = new Manager(
ui_get_full_url('ajax.php'), ui_get_full_url('ajax.php'),
'godmode/um_client/index', 'godmode/um_client/index',
[ [
'lts' => (bool) $config['lts_updates'],
'url' => $url_update_manager, 'url' => $url_update_manager,
'insecure' => $insecure, 'insecure' => $insecure,
'license' => $license, 'license' => $license,
'limit_count' => ((is_array($license_data) === true) ? $license_data['count_enabled'] : null), 'limit_count' => ((is_array($license_data) === true) ? $license_data['count_enabled'] : null),
'language' => ((is_array($config) === true) ? $config['language'] : null), 'language' => $config['language'],
'timezone' => ((is_array($config) === true) ? $config['timezone'] : null), 'timezone' => $config['timezone'],
'homedir' => $homedir, 'homedir' => $homedir,
'dbconnection' => $dbconnection, 'dbconnection' => $dbconnection,
'historydb' => $dbhHistory, 'historydb' => $dbhHistory,

View File

@ -97,6 +97,10 @@ if (!$action_update_url_update_manager) {
'allow_offline_patches', 'allow_offline_patches',
$config['allow_offline_patches'] $config['allow_offline_patches']
); );
$lts_updates = get_parameter_switch(
'lts_updates',
$config['lts_updates']
);
if ($action_update_url_update_manager) { if ($action_update_url_update_manager) {
$result = config_update_value( $result = config_update_value(
@ -145,6 +149,13 @@ if (!$action_update_url_update_manager) {
); );
} }
if ($result) {
$result = config_update_value(
'lts_updates',
$lts_updates
);
}
if ($result && license_free()) { if ($result && license_free()) {
$result = config_update_value( $result = config_update_value(
'identification_reminder', 'identification_reminder',
@ -166,6 +177,7 @@ if (!$action_update_url_update_manager) {
$update_manager_proxy_user = get_parameter('update_manager_proxy_user', ''); $update_manager_proxy_user = get_parameter('update_manager_proxy_user', '');
$update_manager_proxy_password = get_parameter('update_manager_proxy_password', ''); $update_manager_proxy_password = get_parameter('update_manager_proxy_password', '');
$allow_offline_patches = get_parameter_switch('allow_offline_patches', false); $allow_offline_patches = get_parameter_switch('allow_offline_patches', false);
$lts_updates = get_parameter_switch('lts_updates', false);
if ($action_update_url_update_manager) { if ($action_update_url_update_manager) {
@ -215,6 +227,13 @@ if (!$action_update_url_update_manager) {
); );
} }
if ($result) {
$result = config_update_value(
'lts_updates',
$lts_updates
);
}
if ($result && license_free()) { if ($result && license_free()) {
$result = config_update_value('identification_reminder', $identification_reminder); $result = config_update_value('identification_reminder', $identification_reminder);
} }
@ -244,12 +263,13 @@ $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filters';
$table->style[0] = 'font-weight: bolder;width:250px'; $i = 0;
$table->style[$i] = 'font-weight: bolder;width:250px';
$url_update_manager = update_manager_get_url(); $url_update_manager = update_manager_get_url();
$table->data[0][0] = __('URL update manager:'); $table->data[$i][0] = __('URL update manager:');
$table->data[0][1] = html_print_input_text( $table->data[$i++][1] = html_print_input_text(
'url_update_manager', 'url_update_manager',
$url_update_manager, $url_update_manager,
__('URL update manager'), __('URL update manager'),
@ -258,8 +278,8 @@ $table->data[0][1] = html_print_input_text(
true true
); );
$table->data[1][0] = __('Use secured update manager:'); $table->data[$i][0] = __('Use secured update manager:');
$table->data[1][1] = html_print_input( $table->data[$i++][1] = html_print_input(
[ [
'type' => 'switch', 'type' => 'switch',
'name' => 'secure_update_manager', 'name' => 'secure_update_manager',
@ -267,8 +287,8 @@ $table->data[1][1] = html_print_input(
] ]
); );
$table->data[2][0] = __('Proxy server:'); $table->data[$i][0] = __('Proxy server:');
$table->data[2][1] = html_print_input_text( $table->data[$i++][1] = html_print_input_text(
'update_manager_proxy_server', 'update_manager_proxy_server',
$update_manager_proxy_server, $update_manager_proxy_server,
__('Proxy server'), __('Proxy server'),
@ -277,8 +297,8 @@ $table->data[2][1] = html_print_input_text(
true true
); );
$table->data[3][0] = __('Proxy port:'); $table->data[$i][0] = __('Proxy port:');
$table->data[3][1] = html_print_input_text( $table->data[$i++][1] = html_print_input_text(
'update_manager_proxy_port', 'update_manager_proxy_port',
$update_manager_proxy_port, $update_manager_proxy_port,
__('Proxy port'), __('Proxy port'),
@ -287,8 +307,8 @@ $table->data[3][1] = html_print_input_text(
true true
); );
$table->data[4][0] = __('Proxy user:'); $table->data[$i][0] = __('Proxy user:');
$table->data[4][1] = html_print_input_text( $table->data[$i++][1] = html_print_input_text(
'update_manager_proxy_user', 'update_manager_proxy_user',
$update_manager_proxy_user, $update_manager_proxy_user,
__('Proxy user'), __('Proxy user'),
@ -297,8 +317,8 @@ $table->data[4][1] = html_print_input_text(
true true
); );
$table->data[5][0] = __('Proxy password:'); $table->data[$i][0] = __('Proxy password:');
$table->data[5][1] = html_print_input_password( $table->data[$i++][1] = html_print_input_password(
'update_manager_proxy_password', 'update_manager_proxy_password',
$update_manager_proxy_password, $update_manager_proxy_password,
__('Proxy password'), __('Proxy password'),
@ -307,8 +327,8 @@ $table->data[5][1] = html_print_input_password(
true true
); );
$table->data[6][0] = __('Allow no-consecutive patches:'); $table->data[$i][0] = __('Allow no-consecutive patches:');
$table->data[6][1] = html_print_switch( $table->data[$i++][1] = html_print_switch(
[ [
'name' => 'allow_offline_patches', 'name' => 'allow_offline_patches',
'value' => $allow_offline_patches, 'value' => $allow_offline_patches,
@ -316,30 +336,40 @@ $table->data[6][1] = html_print_switch(
] ]
); );
$table->data[7][0] = __('Registration ID:'); $table->data[$i][0] = __('Limit to LTS updates:');
$table->data[7][1] = '<i>'.$config['pandora_uid'].'</i>'; $table->data[$i++][1] = html_print_switch(
[
'name' => 'lts_updates',
'value' => $lts_updates,
'return' => true,
]
);
$table->data[$i][0] = __('Registration ID:');
$table->data[$i++][1] = '<i>'.$config['pandora_uid'].'</i>';
if (update_manager_verify_registration() === true && users_is_admin()) { if (update_manager_verify_registration() === true && users_is_admin()) {
$table->data[8][0] = __('Cancel registration:'); $table->data[$i][0] = __('Cancel registration:');
$table->data[8][1] = '<a href="'; $table->data[$i][1] = '<a href="';
if ((bool) is_metaconsole() === true) { if ((bool) is_metaconsole() === true) {
$table->data[8][1] .= ui_get_full_url( $table->data[$i][1] .= ui_get_full_url(
'index.php?sec=advanced&sec2=advanced/metasetup&pure=0&tab=update_manager_setup&um_disconnect_console=1' 'index.php?sec=advanced&sec2=advanced/metasetup&pure=0&tab=update_manager_setup&um_disconnect_console=1'
); );
} else { } else {
$table->data[8][1] .= ui_get_full_url( $table->data[$i][1] .= ui_get_full_url(
'index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=setup&um_disconnect_console=1' 'index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=setup&um_disconnect_console=1'
); );
} }
$table->data[8][1] .= '" onclick="if(confirm(\'Are you sure?\')) {return true;} else { return false; }">'.__('Unregister').'</a>'; $table->data[$i++][1] .= '" onclick="if(confirm(\'Are you sure?\')) {return true;} else { return false; }">'.__('Unregister').'</a>';
} }
if (license_free()) { if (license_free()) {
$config['identification_reminder'] = isset($config['identification_reminder']) ? $config['identification_reminder'] : 1; $config['identification_reminder'] = isset($config['identification_reminder']) ? $config['identification_reminder'] : 1;
$table->data[9][0] = __('Pandora FMS community reminder').ui_print_help_tip(__('Every 8 days, a message is displayed to admin users to remember to register this Pandora instance'), true); $table->data[$i][0] = __('Pandora FMS community reminder').ui_print_help_tip(__('Every 8 days, a message is displayed to admin users to remember to register this Pandora instance'), true);
$table->data[9][1] = __('Yes').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button('identification_reminder', 1, '', $config['identification_reminder'], true).'&nbsp;&nbsp;'; $table->data[$i][1] = __('Yes').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button('identification_reminder', 1, '', $config['identification_reminder'], true).'&nbsp;&nbsp;';
$table->data[9][1] .= __('No').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button('identification_reminder', 0, '', $config['identification_reminder'], true); $table->data[$i++][1] .= __('No').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button('identification_reminder', 0, '', $config['identification_reminder'], true);
} }
html_print_input_hidden('action_update_url_update_manager', 1); html_print_input_hidden('action_update_url_update_manager', 1);