Merge branch 'ent-12516-cambio-de-modelo-en-actualizaciones-solo-LTS-por-defecto-mostrar-informacion-sobre-versiones-en-warp-update' into 'develop'

Ent 12516 cambio de modelo en actualizaciones solo lts por defecto mostrar informacion sobre versiones en warp update

See merge request artica/pandorafms!6715
This commit is contained in:
Rafael Ameijeiras 2023-12-01 09:27:45 +00:00
commit 0ed2a6f946
6 changed files with 124 additions and 2 deletions

View File

@ -32,6 +32,9 @@ INSERT IGNORE INTO `tdiscovery_apps_tasks_macros` (`id_task`, `macro`, `type`, `
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros` (`id_task`, `macro`, `type`, `value`, `temp_conf`) SELECT id_rt, '_clientPath_', 'custom', '', 0 FROM `trecon_task` WHERE `id_app` = @id_app;
UPDATE `trecon_task` SET `setup_complete` = 1 WHERE `id_app` = @id_app;
-- Update lts updates
UPDATE tconfig SET value='1' WHERE token='lts_updates';
ALTER TABLE `tdashboard`
ADD COLUMN `date_range` TINYINT NOT NULL DEFAULT 0 AFTER `cells_slideshow`,
ADD COLUMN `date_from` INT NOT NULL DEFAULT 0 AFTER `date_range`,

View File

@ -61,7 +61,7 @@ $license = db_get_value(
);
if (isset($config['lts_updates']) === false) {
$config['lts_updates'] = false;
$config['lts_updates'] = true;
}
if (empty($license) === true) {

View File

@ -0,0 +1,111 @@
<?php
/**
* Modal LTS versions update manager.
*
* @category Update Manager
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2023 Pandora FMS
* Please see https://pandorafms.com/community/ for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
check_login();
// The ajax is in include/ajax/update_manager.php.
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Setup Management'
);
include 'general/noaccess.php';
return;
}
require_once $config['homedir'].'/vendor/autoload.php';
$php_version = phpversion();
$php_version_array = explode('.', $php_version);
if ($php_version_array[0] < 7) {
include_once 'general/php_message.php';
}
?>
<!-- Lts Updates. -->
<div id="lts-updates" title="
<?php echo __('LTS versions'); ?>
" class="invisible">
<div style="display: flex; justify-content: space-between">
<div style="width: 250px; padding: 36px">
<?php
echo html_print_image(
'images/info-warning.svg',
true,
[ 'style' => 'padding-top: 30px' ]
);
?>
</div>
<div style="padding: 5px 90px 5px 5px;">
<p class="lato font_10pt bolder">
<?php
echo __('There are two types of versions in Pandora FMS: the LTS versions (Long-Term Support), e.g: 772 LTS, and the RRR (Regular Rolling Release) versions, e.g: 771, 773, 774, 775.');
?>
</p>
<p class="lato font_10pt bolder">
<?php
echo __('LTS versions have frequent, periodic updates (fixes), correcting both security problems and critical bugs detected in the tool. These are the versions we recommend to use in production environments.');
?>
</p>
<p class="lato font_10pt bolder">
<?php
echo __('RRR versions incorporate new features in each version, as well as bug fixes, but due to their dynamic nature, errors are more likely.');
?>
</p>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
// Lts Updates.
$("#lts-updates").dialog({
resizable: true,
draggable: true,
modal: true,
width: 740,
overlay: {
opacity: 0.5,
background: "black"
},
closeOnEscape: true,
buttons: [{
text: "OK",
click: function() {
$(this).dialog("close");
}
}],
open: function(event, ui) {
$(".ui-dialog-titlebar-close").hide();
}
});
});
</script>

View File

@ -119,11 +119,13 @@ switch ($tab) {
case 'setup':
include $config['homedir'].'/godmode/update_manager/update_manager.setup.php';
include $config['homedir'].'/godmode/update_manager/modal_lts_update.php';
break;
case 'offline':
$mode = \UpdateManager\UI\Manager::MODE_OFFLINE;
include $config['homedir'].'/godmode/um_client/index.php';
include $config['homedir'].'/godmode/update_manager/modal_lts_update.php';
break;
case 'online':
@ -163,5 +165,6 @@ switch ($tab) {
$mode = \UpdateManager\UI\Manager::MODE_ONLINE;
include $config['homedir'].'/godmode/um_client/index.php';
include $config['homedir'].'/godmode/update_manager/modal_lts_update.php';
break;
}

View File

@ -63,6 +63,10 @@ if (users_is_admin()) {
}
}
if (isset($config['lts_updates']) === false) {
config_update_value('lts_updates', 1);
}
if (!$action_update_url_update_manager) {
$url_update_manager = get_parameter(
'url_update_manager',

View File

@ -156,7 +156,8 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('gotty', '/usr/bin/gotty'),
('custom_module_units', '{"bytes":"bytes","entries":"entries","files":"files","hits":"hits","sessions":"sessions","users":"users","ºC":"ºC","ºF":"ºF"}'),
('server_unique_identifier', replace(uuid(),'-','')),
('lts_name', '');
('lts_name', ''),
('lts_updates', 1);
UNLOCK TABLES;
--