2010-10-25 Miguel de Dios <miguel.dedios@artica.es>

* 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
This commit is contained in:
mdtrooper 2010-10-25 15:58:28 +00:00
parent 13dd0e4ae5
commit 3c7fe22f1a
2 changed files with 14 additions and 4 deletions

View File

@ -1,3 +1,7 @@
2010-10-25 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_agents.php: clean source style.
2010-10-25 Miguel de Dios <miguel.dedios@artica.es> 2010-10-25 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_agents.php, godmode/agentes/modificar_agente.php, * include/functions_agents.php, godmode/agentes/modificar_agente.php,

View File

@ -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 * @return array All simple alerts defined for an agent. Empty array if no
* alerts found. * 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)) { if (is_array($filter)) {
$disabled = $filter['disabled']; $disabled = $filter['disabled'];
$filter = ' AND talert_template_modules.standby = "'.$filter['standby'].'"'; $filter = ' AND talert_template_modules.standby = "'.$filter['standby'].'"';
}else { }
else {
$filter = ''; $filter = '';
$disabled = $filter; $disabled = $filter;
} }
@ -227,6 +230,7 @@ function get_agent_alerts_compound ($id_agent = false, $filter = '', $options =
break; break;
default: default:
$filter = ''; $filter = '';
break;
} }
if (is_array ($options)) { 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 no group specified, get all user groups
if (empty ($filter['id_grupo'])) { if (empty ($filter['id_grupo'])) {
$filter['id_grupo'] = $groups; $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 group is specified but not allowed, return false
if (! in_array ($filter['id_grupo'], $groups)) { if (! in_array ($filter['id_grupo'], $groups)) {
return false; return false;
} }
$filter['id_grupo'] = (array) $filter['id_grupo']; //Make an array $filter['id_grupo'] = (array) $filter['id_grupo']; //Make an array
} else { }
else {
//Check each group specified to the user groups, remove unwanted groups //Check each group specified to the user groups, remove unwanted groups
foreach ($filter['id_grupo'] as $key => $id_group) { foreach ($filter['id_grupo'] as $key => $id_group) {
if (! in_array ($id_group, $groups)) { if (! in_array ($id_group, $groups)) {