mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Fixed forget metaconsole alerts
This commit is contained in:
parent
a2ef804cec
commit
bb743cb87f
@ -1041,7 +1041,7 @@ function ui_format_alert_row(
|
|||||||
$styleDisabled = '';
|
$styleDisabled = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($alert)) {
|
if (empty($alert) === true) {
|
||||||
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
|
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
|
||||||
return [
|
return [
|
||||||
'',
|
'',
|
||||||
@ -1066,7 +1066,7 @@ function ui_format_alert_row(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined('METACONSOLE')) {
|
if (is_metaconsole() === true) {
|
||||||
$server = db_get_row('tmetaconsole_setup', 'id', $alert['server_data']['id']);
|
$server = db_get_row('tmetaconsole_setup', 'id', $alert['server_data']['id']);
|
||||||
|
|
||||||
if (metaconsole_connect($server) == NOERR) {
|
if (metaconsole_connect($server) == NOERR) {
|
||||||
@ -1087,7 +1087,7 @@ function ui_format_alert_row(
|
|||||||
$data = [];
|
$data = [];
|
||||||
|
|
||||||
// Validate checkbox.
|
// Validate checkbox.
|
||||||
if (!defined('METACONSOLE')) {
|
if (is_metaconsole() === false) {
|
||||||
if (check_acl($config['id_user'], $id_group, 'LW')
|
if (check_acl($config['id_user'], $id_group, 'LW')
|
||||||
|| check_acl($config['id_user'], $id_group, 'LM')
|
|| check_acl($config['id_user'], $id_group, 'LM')
|
||||||
) {
|
) {
|
||||||
@ -1106,7 +1106,7 @@ function ui_format_alert_row(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
|
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
|
||||||
if (is_metaconsole()) {
|
if (is_metaconsole() === true && (int) $alert['server_data']['id'] !== 0) {
|
||||||
$node = metaconsole_get_connection_by_id($alert['server_data']['id']);
|
$node = metaconsole_get_connection_by_id($alert['server_data']['id']);
|
||||||
if (metaconsole_load_external_db($node) !== NOERR) {
|
if (metaconsole_load_external_db($node) !== NOERR) {
|
||||||
// Restore the default connection.
|
// Restore the default connection.
|
||||||
@ -1121,14 +1121,14 @@ function ui_format_alert_row(
|
|||||||
$data[$index['policy']] = '';
|
$data[$index['policy']] = '';
|
||||||
} else {
|
} else {
|
||||||
$img = 'images/policies_mc.png';
|
$img = 'images/policies_mc.png';
|
||||||
if (!is_metaconsole()) {
|
if (is_metaconsole() === false) {
|
||||||
$data[$index['policy']] = '<a href="?sec=gmodules&sec2=enterprise/godmode/policies/policies&id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name']]).'</a>';
|
$data[$index['policy']] = '<a href="?sec=gmodules&sec2=enterprise/godmode/policies/policies&id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name']]).'</a>';
|
||||||
} else {
|
} else {
|
||||||
$data[$index['policy']] = '<a href="?sec=gmodules&sec2=advanced/policymanager&id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name']]).'</a>';
|
$data[$index['policy']] = '<a href="?sec=gmodules&sec2=advanced/policymanager&id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name']]).'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_metaconsole()) {
|
if (is_metaconsole() === true) {
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1139,7 +1139,7 @@ function ui_format_alert_row(
|
|||||||
$data[$index['standby']] = html_print_image('images/bell_pause.png', true, ['title' => __('Standby on')]);
|
$data[$index['standby']] = html_print_image('images/bell_pause.png', true, ['title' => __('Standby on')]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!defined('METACONSOLE')) {
|
if (is_metaconsole() === false) {
|
||||||
// Force alert execution.
|
// Force alert execution.
|
||||||
if (check_acl($config['id_user'], $id_group, 'AW') || check_acl($config['id_user'], $id_group, 'LM')) {
|
if (check_acl($config['id_user'], $id_group, 'AW') || check_acl($config['id_user'], $id_group, 'LM')) {
|
||||||
if ($alert['force_execution'] == 0) {
|
if ($alert['force_execution'] == 0) {
|
||||||
@ -1154,7 +1154,7 @@ function ui_format_alert_row(
|
|||||||
if ($agent == 0) {
|
if ($agent == 0) {
|
||||||
$data[$index['module_name']] .= ui_print_truncate_text(isset($alert['agent_module_name']) ? $alert['agent_module_name'] : modules_get_agentmodule_name($alert['id_agent_module']), 'module_small', false, true, true, '[…]', '');
|
$data[$index['module_name']] .= ui_print_truncate_text(isset($alert['agent_module_name']) ? $alert['agent_module_name'] : modules_get_agentmodule_name($alert['id_agent_module']), 'module_small', false, true, true, '[…]', '');
|
||||||
} else {
|
} else {
|
||||||
if (defined('METACONSOLE')) {
|
if (is_metaconsole() === true) {
|
||||||
$agent_name = $alert['agent_name'];
|
$agent_name = $alert['agent_name'];
|
||||||
$id_agent = $alert['id_agent'];
|
$id_agent = $alert['id_agent'];
|
||||||
} else {
|
} else {
|
||||||
@ -1162,7 +1162,7 @@ function ui_format_alert_row(
|
|||||||
$id_agent = modules_get_agentmodule_agent($alert['id_agent_module']);
|
$id_agent = modules_get_agentmodule_agent($alert['id_agent_module']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined('METACONSOLE') || !can_user_access_node()) {
|
if (is_metaconsole() === true || !can_user_access_node()) {
|
||||||
$data[$index['agent_name']] = ui_print_truncate_text($agent_name, 'agent_small', false, true, true, '[…]', '');
|
$data[$index['agent_name']] = ui_print_truncate_text($agent_name, 'agent_small', false, true, true, '[…]', '');
|
||||||
} else {
|
} else {
|
||||||
if ($agent_style !== false) {
|
if ($agent_style !== false) {
|
||||||
@ -1179,7 +1179,7 @@ function ui_format_alert_row(
|
|||||||
|
|
||||||
$data[$index['description']] = '';
|
$data[$index['description']] = '';
|
||||||
|
|
||||||
if (defined('METACONSOLE')) {
|
if (is_metaconsole() === true) {
|
||||||
$data[$index['template']] .= '<a class="template_details" href="'.ui_get_full_url('/', false, false, false).'/ajax.php?page=enterprise/meta/include/ajax/tree_view.ajax&action=get_template_tooltip&id_template='.$template['id'].'&server_name='.$alert['server_data']['server_name'].'">';
|
$data[$index['template']] .= '<a class="template_details" href="'.ui_get_full_url('/', false, false, false).'/ajax.php?page=enterprise/meta/include/ajax/tree_view.ajax&action=get_template_tooltip&id_template='.$template['id'].'&server_name='.$alert['server_data']['server_name'].'">';
|
||||||
} else {
|
} else {
|
||||||
$data[$index['template']] .= '<a class="template_details" href="ajax.php?page=godmode/alerts/alert_templates&get_template_tooltip=1&id_template='.$template['id'].'">';
|
$data[$index['template']] .= '<a class="template_details" href="ajax.php?page=godmode/alerts/alert_templates&get_template_tooltip=1&id_template='.$template['id'].'">';
|
||||||
@ -1196,7 +1196,7 @@ function ui_format_alert_row(
|
|||||||
|
|
||||||
$actions = alerts_get_alert_agent_module_actions($alert['id'], false, $alert['server_data']['id']);
|
$actions = alerts_get_alert_agent_module_actions($alert['id'], false, $alert['server_data']['id']);
|
||||||
|
|
||||||
if (!empty($actions)) {
|
if (empty($actions) === false) {
|
||||||
$actionText = '<div><ul class="action_list">';
|
$actionText = '<div><ul class="action_list">';
|
||||||
foreach ($actions as $action) {
|
foreach ($actions as $action) {
|
||||||
$actionText .= '<div class="mrgn_btn_5px" ><span class="action_name"><li>'.$action['name'];
|
$actionText .= '<div class="mrgn_btn_5px" ><span class="action_name"><li>'.$action['name'];
|
||||||
|
@ -416,7 +416,7 @@ if ($filter_standby == 'standby_on') {
|
|||||||
$filter_alert['disabled'] = $filter;
|
$filter_alert['disabled'] = $filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_metaconsole()) {
|
if (is_metaconsole() === true) {
|
||||||
include_once $config['homedir'].'/enterprise/meta/include/functions_alerts_meta.php';
|
include_once $config['homedir'].'/enterprise/meta/include/functions_alerts_meta.php';
|
||||||
if ($idAgent != 0) {
|
if ($idAgent != 0) {
|
||||||
$alerts['alerts_simple'] = alerts_meta_get_alerts($agents, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user);
|
$alerts['alerts_simple'] = alerts_meta_get_alerts($agents, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user