mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
2012-04-26 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_db.php, operation/agentes/exportdata.php: cleaned source code style. * include/functions_api.php: fixed prevent the empty string in the status into the search events. MERGED FROM 4.0.2 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6182 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
933282e041
commit
b2dbe16678
@ -1,3 +1,13 @@
|
||||
2012-04-26 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_db.php, operation/agentes/exportdata.php:
|
||||
cleaned source code style.
|
||||
|
||||
* include/functions_api.php: fixed prevent the empty string in the
|
||||
status into the search events.
|
||||
|
||||
MERGED FROM 4.0.2
|
||||
|
||||
2012-04-26 Vanessa Gil <vanessa.gil@artica.es>
|
||||
|
||||
* godmode/reporting/reporting_builder.list_items.php: Added sort column.
|
||||
|
@ -176,7 +176,7 @@ function isInACL($ip) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------DEFINED OPERATIONS FUNCTIONS-------------------------
|
||||
//-------------------------DEFINED OPERATIONS FUNCTIONS-----------------
|
||||
function get_groups($thrash1, $thrash2, $other, $returnType, $user_in_db) {
|
||||
if ($other['type'] == 'string') {
|
||||
if ($other['data'] != '') {
|
||||
@ -3790,7 +3790,11 @@ function otherParameter2Filter($other, $array = false) {
|
||||
$filter['estado'] = $other['data'][8];
|
||||
}
|
||||
else {
|
||||
$filterString .= ' AND estado = ' . $other[8];
|
||||
$estado = (int)$other[8];
|
||||
|
||||
if ($estado >= 0) {
|
||||
$filterString .= ' AND estado = ' . $estado;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4504,7 +4508,8 @@ function get_events__with_user($trash1, $trash2, $other, $returnType, $user_in_d
|
||||
$sql_post .= " AND event_type LIKE '%$event_type%' ";
|
||||
}
|
||||
elseif ($event_type == "not_normal") {
|
||||
$sql_post .= " AND event_type LIKE '%warning%' OR event_type LIKE '%critical%' OR event_type LIKE '%unknown%' ";
|
||||
$sql_post .= " AND event_type LIKE '%warning%'
|
||||
OR event_type LIKE '%critical%' OR event_type LIKE '%unknown%' ";
|
||||
}
|
||||
else {
|
||||
$sql_post .= " AND event_type = '".$event_type."'";
|
||||
@ -4564,10 +4569,8 @@ function get_events__with_user($trash1, $trash2, $other, $returnType, $user_in_d
|
||||
(SELECT t1.nombre FROM tagente AS t1 WHERE t1.id_agente = tevento.id_agente) AS agent_name,
|
||||
(SELECT t2.nombre FROM tgrupo AS t2 WHERE t2.id_grupo = tevento.id_grupo) AS group_name,
|
||||
(SELECT t2.icon FROM tgrupo AS t2 WHERE t2.id_grupo = tevento.id_grupo) AS group_icon
|
||||
FROM tevento" .
|
||||
//FOR THE TEST THE API IN THE ANDROID
|
||||
// " WHERE 1=1 ".$sql_post." ORDER BY id_evento ASC LIMIT ".$offset.",".$pagination;
|
||||
" WHERE 1=1 ".$sql_post." ORDER BY utimestamp DESC LIMIT ".$offset.",".$pagination;
|
||||
FROM tevento
|
||||
WHERE 1=1 ".$sql_post." ORDER BY utimestamp DESC LIMIT ".$offset.",".$pagination;
|
||||
}
|
||||
break;
|
||||
case "postgresql":
|
||||
@ -4599,7 +4602,7 @@ function get_events__with_user($trash1, $trash2, $other, $returnType, $user_in_d
|
||||
case "mysql":
|
||||
db_process_sql ('SET group_concat_max_len = 9999999');
|
||||
$sql = "SELECT *, MAX(id_evento) AS id_evento, GROUP_CONCAT(DISTINCT user_comment SEPARATOR '') AS user_comment,
|
||||
MIN(estado) AS min_estado, MAX(estado) AS max_estado, COUNT(*) AS event_rep, MAX(utimestamp) AS timestamp_rep
|
||||
MIN(estado) AS min_estado, MAX(estado) AS max_estado, COUNT(*) AS event_rep, MAX(utimestamp) AS timestamp_rep
|
||||
FROM tevento
|
||||
WHERE 1=1 ".$sql_post."
|
||||
GROUP BY evento, id_agentmodule
|
||||
@ -4607,7 +4610,7 @@ function get_events__with_user($trash1, $trash2, $other, $returnType, $user_in_d
|
||||
break;
|
||||
case "postgresql":
|
||||
$sql = "SELECT *, MAX(id_evento) AS id_evento, array_to_string(array_agg(DISTINCT user_comment), '') AS user_comment,
|
||||
MIN(estado) AS min_estado, MAX(estado) AS max_estado, COUNT(*) AS event_rep, MAX(utimestamp) AS timestamp_rep
|
||||
MIN(estado) AS min_estado, MAX(estado) AS max_estado, COUNT(*) AS event_rep, MAX(utimestamp) AS timestamp_rep
|
||||
FROM tevento
|
||||
WHERE 1=1 ".$sql_post."
|
||||
GROUP BY evento, id_agentmodule
|
||||
|
@ -24,7 +24,7 @@ include_once($config['homedir'] . "/include/functions_groups.php");
|
||||
include_once($config['homedir'] . "/include/functions_agents.php");
|
||||
include_once($config['homedir'] . "/include/functions_modules.php");
|
||||
include_once($config['homedir'] . "/include/functions_alerts.php");
|
||||
include_once($config['homedir'] . '/include/functions_users.php');
|
||||
include_once($config['homedir'] . "/include/functions_users.php");
|
||||
|
||||
function db_select_engine() {
|
||||
global $config;
|
||||
@ -105,7 +105,6 @@ function db_pandora_audit($accion, $descripcion, $user_id = false, $ip = false,
|
||||
if ($ip !== false) {
|
||||
if (isset($config["remote_addr"])) {
|
||||
$ip = $config["remote_addr"];
|
||||
|
||||
}
|
||||
else {
|
||||
if ($_SERVER['REMOTE_ADDR']) {
|
||||
@ -145,7 +144,8 @@ function db_pandora_audit($accion, $descripcion, $user_id = false, $ip = false,
|
||||
'accion' => $accion,
|
||||
'ip_origen' => $ip,
|
||||
'descripcion' => $descripcion,
|
||||
'fecha' => '#to_date(\'' . date('Y-m-d H:i:s') . '\',\'YYYY-MM-DD HH24:MI:SS\')',
|
||||
'fecha' => '#to_date(\'' . date('Y-m-d H:i:s') .
|
||||
'\',\'YYYY-MM-DD HH24:MI:SS\')',
|
||||
'utimestamp' => time());
|
||||
break;
|
||||
}
|
||||
|
@ -212,7 +212,6 @@ if (!empty ($export_btn) && !empty ($module)) {
|
||||
switch ($export_type) {
|
||||
case "data":
|
||||
case "avg":
|
||||
|
||||
// Show header
|
||||
echo $datastart;
|
||||
|
||||
@ -315,7 +314,6 @@ if (empty($export_btn)) {
|
||||
|
||||
$agents = array ();
|
||||
$rows = agents_get_agents ($filter, false, 'AR');
|
||||
|
||||
if ($rows == null) $rows = array();
|
||||
foreach ($rows as $row) {
|
||||
$agents[$row['id_agente']] = $row['nombre'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user