Merge branch 'ent-7426-fallo-de-reglas-de-eventos-en-metaconsola' into 'develop'

Migrate old rules

See merge request artica/pandorafms!4093
This commit is contained in:
Daniel Rodriguez 2021-04-30 13:35:56 +00:00
commit 50c61b2f9f
2 changed files with 15 additions and 2 deletions

View File

@ -20,12 +20,17 @@ ALTER TABLE `tevent_rule` MODIFY COLUMN `group_recursion` TEXT;
ALTER TABLE `tevent_rule` MODIFY COLUMN `log_content` TEXT;
ALTER TABLE `tevent_rule` MODIFY COLUMN `log_source` TEXT;
ALTER TABLE `tevent_rule` MODIFY COLUMN `log_agent` TEXT;
ALTER TABLE tevent_filter ADD COLUMN `server_id` int(10) NOT NULL default 0;
UPDATE `talert_commands` SET `fields_descriptions` = '[\"Event name\",\"Event type\",\"Source\",\"Agent name or _agent_\",\"Event severity\",\"ID extra\",\"Tags separated by commas\",\"Comments\",\"\",\"\"]' WHERE `name` = "Monitoring Event";
UPDATE `tskin` SET `name` = 'Default theme' , `relative_path` = 'pandora.css' WHERE `id` = 1;
UPDATE `tskin` SET `name` = 'Black theme' , `relative_path` = 'Black theme' , `description` = 'Black theme' WHERE `id` = 2;
ALTER TABLE tevent_filter ADD COLUMN `server_id` int(10) NOT NULL default 0;
UPDATE `tevent_rule` SET `criticity` = NULL, `operator_criticity` = NULL WHERE `criticity` = 99;
UPDATE `tevent_rule` SET `id_grupo` = NULL, `operator_id_grupo` = NULL WHERE `id_grupo` = 0;
UPDATE `tevent_rule` SET `id_tag` = NULL, `operator_id_tag` = NULL WHERE `id_tag` = 0;
UPDATE `tevent_rule` SET `operator_criticity` = '==' WHERE `criticity` != 99 AND `criticity` IS NOT NULL AND `criticity` != '';
UPDATE `tevent_rule` SET `operator_id_grupo` = '==' WHERE `id_grupo` != 0 AND `id_grupo` IS NOT NULL AND `id_grupo` != '';
UPDATE `tevent_rule` SET `operator_id_tag` = '==' WHERE `id_tag` != 0 AND `id_tag` IS NOT NULL AND `id_tag` != '';
COMMIT;

View File

@ -577,6 +577,14 @@ function groups_get_groups_tree_recursive($groups, $trash=0, $trash2=0)
$group['parent'] = 0;
}
if (is_array($tree[$group['parent']]) === false) {
$str = $tree[$group['parent']];
$tree[$group['parent']] = [
'nombre' => $tree[$group['parent']],
'id_grupo' => $group['parent'],
];
}
$tree[$group['parent']]['hash_branch'] = 1;
$tree[$group['parent']]['branch'][$key] = &$tree[$key];
}