diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 2dc22407fc..310f1be287 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2013-05-16 Miguel de Dios + + * include/functions_networkmap.php, include/functions_reporting.php, + include/functions_users.php: cleaned source code style. + + * operation/search_agents.getdata.php: fixed notice messages PHP. + 2013-05-16 Miguel de Dios * include/functions_incidents.php, include/api.php, diff --git a/pandora_console/include/functions_networkmap.php b/pandora_console/include/functions_networkmap.php index fd5d72a148..e553115030 100644 --- a/pandora_console/include/functions_networkmap.php +++ b/pandora_console/include/functions_networkmap.php @@ -919,7 +919,7 @@ function networkmap_get_networkmap ($id_networkmap, $filter = false, $fields = f $filter['id_networkmap'] = $id_networkmap; - if($check_user) { + if ($check_user) { //If hte user has admin flag don't filter by user $user_info = users_get_user_by_id($config['id_user']); @@ -945,12 +945,12 @@ function networkmap_get_networkmap ($id_networkmap, $filter = false, $fields = f function networkmap_get_networkmaps ($id_user = '', $type = '', $optgrouped = true) { global $config; - if($id_user == '') { + if ($id_user == '') { $id_user = $config['id_user']; } $type_cond = ''; - if($type != '') { + if ($type != '') { switch ($config["dbtype"]) { case "mysql": $type_cond = ' AND type = "'.$type.'"'; @@ -972,13 +972,13 @@ function networkmap_get_networkmaps ($id_user = '', $type = '', $optgrouped = tr break; } - if($networkmaps_raw === false){ + if ($networkmaps_raw === false){ return false; } - + $networkmaps = array(); - foreach($networkmaps_raw as $key => $networkmapitem) { - if($optgrouped) { + foreach ($networkmaps_raw as $key => $networkmapitem) { + if ($optgrouped) { $networkmaps[$networkmapitem['id_networkmap']] = array('name' => $networkmapitem['name'], 'optgroup' => $networkmapitem['type']); @@ -1071,13 +1071,13 @@ function networkmap_get_filter_types () { ?> diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 2bc8cc0b53..7145b981dc 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -1448,7 +1448,7 @@ function reporting_get_group_stats ($id_group = 0, $access = 'AR') { // Add id of this group to create the clause // If the group is quering previously, we ingore it - if(!in_array($group,$covered_groups)){ + if (!in_array($group,$covered_groups)){ array_push($covered_groups, $group); array_push($group_array, $group); } @@ -1475,7 +1475,7 @@ function reporting_get_group_stats ($id_group = 0, $access = 'AR') { } */ - if(!empty($group_array)) { + if (!empty($group_array)) { // Get unknown agents by using the status code in modules $data["agents_unknown"] += groups_agent_unknown ($group_array); @@ -5776,7 +5776,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f $data = array (); $table->colspan[1][0] = 2; $table->colspan[2][0] = 2; - if($description != '') { + if ($description != '') { $data[0] = $description; array_push ($table->data, $data); } diff --git a/pandora_console/include/functions_users.php b/pandora_console/include/functions_users.php index 8dae940afe..d901b653c7 100644 --- a/pandora_console/include/functions_users.php +++ b/pandora_console/include/functions_users.php @@ -49,7 +49,8 @@ function users_get_info ($order = "fullname", $info = "fullname") { * @return int sucess return */ function users_disable ($user_id, $new_disabled_value) { - return db_process_sql_update('tusuario', array('disabled' => $new_disabled_value), array('id_user' => $user_id)); + return db_process_sql_update('tusuario', + array('disabled' => $new_disabled_value), array('id_user' => $user_id)); } /** @@ -795,7 +796,7 @@ function users_check_users() { function users_can_manage_group_all($id_group = 0) { global $config; - if($id_group != 0) { + if ($id_group != 0) { return true; } diff --git a/pandora_console/operation/search_agents.getdata.php b/pandora_console/operation/search_agents.getdata.php index 1938aeb252..a25cbd690d 100644 --- a/pandora_console/operation/search_agents.getdata.php +++ b/pandora_console/operation/search_agents.getdata.php @@ -108,6 +108,8 @@ switch ($sortField) { break; } +$totalAgents = 0; + $agents = false; if ($searchAgents) { $userGroups = users_get_groups($config['id_user'], 'AR', false);