diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index c39dd34822..d9b3144d87 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2010-06-28 Sergio Martin + + * include/functions_db.php: Fixed the get_agent_modules + function to avoid return the pending delete modules + 2010-06-25 Sergio Martin * include/functions_ui.php: Adding a parameter to diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index 07fcb5d323..700ae6d30d 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -506,19 +506,22 @@ $modules = get_agent_modules ($id_agent, '*', 'disabled = 0 AND history_data = 0 */ function get_agent_modules ($id_agent, $details = false, $filter = false, $indexed = true) { $id_agent = safe_int ($id_agent, 1); - + $where = ''; if (! empty ($id_agent)) { $where = sprintf (' WHERE id_agente IN (%s)', implode (",", (array) $id_agent)); } + if ($where != '') { + $where .= ' AND '; + } else { + $where .= ' WHERE '; + } + + $where .= 'delete_pending = 0 '; + if (! empty ($filter)) { - if ($where != '') { - $where .= ' AND '; - } else { - $where .= ' WHERE '; - } - + $where .= ' AND '; if (is_array ($filter)) { $fields = array (); foreach ($filter as $field => $value) {