#13061 toekn lts message no show to individual users

This commit is contained in:
Jonathan 2024-03-25 08:32:56 +01:00
parent 0dd0927633
commit 8a29e03b58
5 changed files with 20 additions and 9 deletions

View File

@ -0,0 +1,6 @@
START TRANSACTION;
ALTER TABLE `tusuario`
ADD COLUMN `stop_lts_modal` TINYINT NOT NULL DEFAULT 0 AFTER `session_max_time_expire`;
COMMIT;

View File

@ -43,9 +43,11 @@ if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user
if (is_ajax()) {
$stopShowingModal = get_parameter('stopShowingModal', 0);
if ($stopShowingModal === '1') {
config_update_value('stop_lts_modal', 1);
} else {
config_update_value('stop_lts_modal', 0);
db_process_sql_update(
'tusuario',
['stop_lts_modal' => '1'],
['id_user' => $config['id_user']],
);
}
return;
@ -95,7 +97,8 @@ if ($php_version_array[0] < 7) {
</div>
</div>
<?php
if ($config['stop_lts_modal'] === '0') {
$stop_lts_modal = db_get_value('stop_lts_modal', 'tusuario', 'id_user', $config['id_user']);
if ($stop_lts_modal === '0') {
?>
<script type="text/javascript">
$(document).ready(function() {

View File

@ -243,7 +243,11 @@ if (!$action_update_url_update_manager) {
}
if ($result && $lts_updates === 1) {
config_update_value('stop_lts_modal', '0');
db_process_sql_update(
'tusuario',
['stop_lts_modal' => '0'],
['id_user' => $config['id_user']],
);
}
ui_print_result_message(

View File

@ -3143,10 +3143,6 @@ function config_process_config()
config_update_value('default_assign_tags', '');
}
if (!isset($config['stop_lts_modal'])) {
config_update_value('stop_lts_modal', 0);
}
if (!isset($config['default_no_hierarchy'])) {
config_update_value('default_no_hierarchy', 0);
}

View File

@ -1326,6 +1326,8 @@ CREATE TABLE IF NOT EXISTS `tusuario` (
`allowed_ip_list` TEXT,
`auth_token_secret` VARCHAR(45) DEFAULT NULL,
`session_max_time_expire` INT NOT NULL DEFAULT 0,
`stop_lts_modal` TINYINT NOT NULL DEFAULT 0;
CONSTRAINT `fk_filter_id` FOREIGN KEY (`id_filter`) REFERENCES tevent_filter (`id_filter`) ON DELETE SET NULL,
UNIQUE KEY `id_user` (`id_user`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;