Merge branch 'ent-10819-guardia-15316-alertas-en-vista-de-alertas-tienen-icono-de-politica-sin-estar-en-ellas' into 'develop'

Ent 10819 guardia 15316 alertas en vista de alertas tienen icono de politica sin estar en ellas

See merge request artica/pandorafms!5633
This commit is contained in:
Matias Didier 2023-03-29 12:32:44 +00:00
commit 4297481c35
2 changed files with 11 additions and 7 deletions

View File

@ -967,17 +967,19 @@ foreach ($simple_alerts as $alert) {
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
$policyInfo = policies_is_alert_in_policy2($alert['id'], false);
$module_linked = policies_is_module_linked($alert['id_agent_module']);
if (is_array($policyInfo) === false && $module_linked === false) {
if ((is_array($policyInfo) === false && $module_linked === false)
|| (is_array($policyInfo) === false && $module_linked === '1')
) {
$data[$index['policy']] = '';
} else {
$module_linked = policies_is_module_linked($alert['id_agent_module']);
if ($module_linked === '0') {
$img = 'images/unlinkpolicy.png';
} else {
$img = 'images/policies_mc.png';
$img = 'images/policy@svg.svg';
}
$data[1] .= '&nbsp;&nbsp;<a href="?sec=gmodules&sec2=enterprise/godmode/policies/policies&pure='.$pure.'&id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name']]).'</a>';
$data[1] .= '&nbsp;&nbsp;<a href="?sec=gmodules&sec2=enterprise/godmode/policies/policies&pure='.$pure.'&id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name'], 'class' => 'invert_filter main_menu_icon']).'</a>';
}
}
}

View File

@ -1246,20 +1246,22 @@ function ui_format_alert_row(
$policyInfo = policies_is_alert_in_policy2($alert['id'], false);
$module_linked = policies_is_module_linked($alert['id_agent_module']);
if (is_array($policyInfo) === false && $module_linked === false) {
if ((is_array($policyInfo) === false && $module_linked === false)
|| (is_array($policyInfo) === false && $module_linked === '1')
) {
$data[$index['policy']] = '';
} else {
$module_linked = policies_is_module_linked($alert['id_agent_module']);
if ($module_linked === '0') {
$img = 'images/unlinkpolicy.png';
} else {
$img = 'images/policies_mc.png';
$img = 'images/policy@svg.svg';
}
if (is_metaconsole() === false) {
$data[$index['policy']] = '<a href="?sec=gmodules&amp;sec2=enterprise/godmode/policies/policies&amp;id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name']]).'</a>';
$data[$index['policy']] = '<a href="?sec=gmodules&amp;sec2=enterprise/godmode/policies/policies&amp;id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name'], 'class' => 'invert_filter main_menu_icon']).'</a>';
} else {
$data[$index['policy']] = '<a href="?sec=gmodules&amp;sec2=advanced/policymanager&amp;id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name']]).'</a>';
$data[$index['policy']] = '<a href="?sec=gmodules&amp;sec2=advanced/policymanager&amp;id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name'], 'class' => 'invert_filter main_menu_icon']).'</a>';
}
}