From 28028ec08061681dc9940213f988318b6000590b Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Mon, 28 Jun 2010 11:49:07 +0000 Subject: [PATCH] 2010-06-28 Sergio Martin * include/functions_db.php: Fixed the get_agent_modules function to avoid return the pending delete modules git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2929 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/functions_db.php | 17 ++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) 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) {