From c56fbc43c8b013f097874a35a8e17b848cb4f3dc Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 25 Oct 2010 15:58:28 +0000 Subject: [PATCH] 2010-10-25 Miguel de Dios * include/functions_agents.php: clean source style. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3460 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 4 ++++ pandora_console/include/functions_agents.php | 14 ++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 2e646e7c7a..7dabf5e01d 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,7 @@ +2010-10-25 Miguel de Dios + + * include/functions_agents.php: clean source style. + 2010-10-25 Miguel de Dios * include/functions_agents.php, godmode/agentes/modificar_agente.php, diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 4f3840160f..1b34e8a60f 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -109,11 +109,14 @@ function create_agent ($name, $id_group, $interval, $ip_address, $values = false * @return array All simple alerts defined for an agent. Empty array if no * alerts found. */ -function get_agent_alerts_simple ($id_agent = false, $filter = '', $options = false, $where = '', $allModules = false, $orderby = false, $idGroup = false, $count = false) { +function get_agent_alerts_simple ($id_agent = false, $filter = '', $options = false, $where = '', + $allModules = false, $orderby = false, $idGroup = false, $count = false) { + if (is_array($filter)) { $disabled = $filter['disabled']; $filter = ' AND talert_template_modules.standby = "'.$filter['standby'].'"'; - }else { + } + else { $filter = ''; $disabled = $filter; } @@ -227,6 +230,7 @@ function get_agent_alerts_compound ($id_agent = false, $filter = '', $options = break; default: $filter = ''; + break; } if (is_array ($options)) { @@ -299,13 +303,15 @@ function get_agents ($filter = false, $fields = false, $access = 'AR', $order = //If no group specified, get all user groups if (empty ($filter['id_grupo'])) { $filter['id_grupo'] = $groups; - } elseif (! is_array ($filter['id_grupo'])) { + } + elseif (! is_array ($filter['id_grupo'])) { //If group is specified but not allowed, return false if (! in_array ($filter['id_grupo'], $groups)) { return false; } $filter['id_grupo'] = (array) $filter['id_grupo']; //Make an array - } else { + } + else { //Check each group specified to the user groups, remove unwanted groups foreach ($filter['id_grupo'] as $key => $id_group) { if (! in_array ($id_group, $groups)) {