Skip to content

Commit

Permalink
Show system events in the metaconsole.
Browse files Browse the repository at this point in the history
  • Loading branch information
nramon committed Jun 30, 2015
1 parent 91ffd58 commit a9f2171
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions pandora_console/operation/events/events.build_query.php
Expand Up @@ -213,25 +213,30 @@

// Metaconsole fitlers
if ($meta) {
$enabled_nodes = db_get_all_rows_sql('
SELECT id
FROM tmetaconsole_setup
WHERE disabled = 0');

if (empty($enabled_nodes)) {
$sql_post .= ' AND 1 = 0';
}
else {
$enabled_nodes_id = array();
foreach ($enabled_nodes as $en) {
$enabled_nodes_id[] = $en['id'];
}
$sql_post .= ' AND server_id IN (' .
implode(',',$enabled_nodes_id) . ')';
}

if ($server_id) {
$sql_post .= " AND server_id = " . $server_id;
} else {
$enabled_nodes = db_get_all_rows_sql('
SELECT id
FROM tmetaconsole_setup
WHERE disabled = 0');

if (empty($enabled_nodes)) {
$sql_post .= ' AND 1 = 0';
}
else {
if ($strict_user == 1) {
$enabled_nodes_id = array();
} else {
$enabled_nodes_id = array(0);
}
foreach ($enabled_nodes as $en) {
$enabled_nodes_id[] = $en['id'];
}
$sql_post .= ' AND server_id IN (' .
implode(',',$enabled_nodes_id) . ')';
}
}
}
?>

0 comments on commit a9f2171

Please sign in to comment.