re-sort traps if history enabled

This commit is contained in:
alejandro.campos@artica.es 2022-11-02 14:27:08 +01:00
parent 930da6c58f
commit d7808f6dc3
1 changed files with 9 additions and 2 deletions

View File

@ -302,8 +302,15 @@ if (empty($all_address_agents)) {
switch ($config['dbtype']) {
case 'mysql':
$sql = 'SELECT *
FROM ttrap
ORDER BY timestamp DESC';
FROM ttrap
WHERE (
`source` IN ('.implode(',', $address_by_user_groups).") OR
`source`='' OR
`source` NOT IN (".implode(',', $all_address_agents).')
)
%s
ORDER BY timestamp DESC
LIMIT %d,%d';
break;
case 'postgresql':