diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 7ae033dca7..9c575fb1eb 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -1041,7 +1041,7 @@ function ui_format_alert_row( $styleDisabled = ''; } - if (empty($alert)) { + if (empty($alert) === true) { if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { 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']); if (metaconsole_connect($server) == NOERR) { @@ -1087,7 +1087,7 @@ function ui_format_alert_row( $data = []; // Validate checkbox. - if (!defined('METACONSOLE')) { + if (is_metaconsole() === false) { if (check_acl($config['id_user'], $id_group, 'LW') || check_acl($config['id_user'], $id_group, 'LM') ) { @@ -1106,7 +1106,7 @@ function ui_format_alert_row( } 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']); if (metaconsole_load_external_db($node) !== NOERR) { // Restore the default connection. @@ -1121,14 +1121,14 @@ function ui_format_alert_row( $data[$index['policy']] = ''; } else { $img = 'images/policies_mc.png'; - if (!is_metaconsole()) { + if (is_metaconsole() === false) { $data[$index['policy']] = ''.html_print_image($img, true, ['title' => $policyInfo['name']]).''; } else { $data[$index['policy']] = ''.html_print_image($img, true, ['title' => $policyInfo['name']]).''; } } - if (is_metaconsole()) { + if (is_metaconsole() === true) { 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')]); } - if (!defined('METACONSOLE')) { + if (is_metaconsole() === false) { // Force alert execution. if (check_acl($config['id_user'], $id_group, 'AW') || check_acl($config['id_user'], $id_group, 'LM')) { if ($alert['force_execution'] == 0) { @@ -1154,7 +1154,7 @@ function ui_format_alert_row( 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, '[…]', ''); } else { - if (defined('METACONSOLE')) { + if (is_metaconsole() === true) { $agent_name = $alert['agent_name']; $id_agent = $alert['id_agent']; } else { @@ -1162,7 +1162,7 @@ function ui_format_alert_row( $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, '[…]', ''); } else { if ($agent_style !== false) { @@ -1179,7 +1179,7 @@ function ui_format_alert_row( $data[$index['description']] = ''; - if (defined('METACONSOLE')) { + if (is_metaconsole() === true) { $data[$index['template']] .= ''; } else { $data[$index['template']] .= ''; @@ -1196,7 +1196,7 @@ function ui_format_alert_row( $actions = alerts_get_alert_agent_module_actions($alert['id'], false, $alert['server_data']['id']); - if (!empty($actions)) { + if (empty($actions) === false) { $actionText = '