2013-05-16 Miguel de Dios <miguel.dedios@artica.es>

* 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.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8142 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-05-16 10:16:16 +00:00
parent 0fd149893e
commit c999a888b9
5 changed files with 30 additions and 20 deletions

View File

@ -1,3 +1,10 @@
2013-05-16 Miguel de Dios <miguel.dedios@artica.es>
* 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 <miguel.dedios@artica.es> 2013-05-16 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_incidents.php, include/api.php, * include/functions_incidents.php, include/api.php,

View File

@ -919,7 +919,7 @@ function networkmap_get_networkmap ($id_networkmap, $filter = false, $fields = f
$filter['id_networkmap'] = $id_networkmap; $filter['id_networkmap'] = $id_networkmap;
if($check_user) { if ($check_user) {
//If hte user has admin flag don't filter by user //If hte user has admin flag don't filter by user
$user_info = users_get_user_by_id($config['id_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) { function networkmap_get_networkmaps ($id_user = '', $type = '', $optgrouped = true) {
global $config; global $config;
if($id_user == '') { if ($id_user == '') {
$id_user = $config['id_user']; $id_user = $config['id_user'];
} }
$type_cond = ''; $type_cond = '';
if($type != '') { if ($type != '') {
switch ($config["dbtype"]) { switch ($config["dbtype"]) {
case "mysql": case "mysql":
$type_cond = ' AND type = "'.$type.'"'; $type_cond = ' AND type = "'.$type.'"';
@ -972,13 +972,13 @@ function networkmap_get_networkmaps ($id_user = '', $type = '', $optgrouped = tr
break; break;
} }
if($networkmaps_raw === false){ if ($networkmaps_raw === false){
return false; return false;
} }
$networkmaps = array(); $networkmaps = array();
foreach($networkmaps_raw as $key => $networkmapitem) { foreach ($networkmaps_raw as $key => $networkmapitem) {
if($optgrouped) { if ($optgrouped) {
$networkmaps[$networkmapitem['id_networkmap']] = $networkmaps[$networkmapitem['id_networkmap']] =
array('name' => $networkmapitem['name'], array('name' => $networkmapitem['name'],
'optgroup' => $networkmapitem['type']); 'optgroup' => $networkmapitem['type']);
@ -1071,13 +1071,13 @@ function networkmap_get_filter_types () {
?> ?>
<script language="javascript" type="text/javascript"> <script language="javascript" type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
$(document).ready (function () { $(document).ready (function () {
$("area[title!='<?php echo 'Pandora FMS'; ?>']").cluetip ({ $("area[title!='<?php echo 'Pandora FMS'; ?>']").cluetip ({
arrows: true, arrows: true,
attribute: 'title', attribute: 'title',
cluetipClass: 'default' cluetipClass: 'default'
}); });
}); });
/* ]]> */ /* ]]> */
</script> </script>

View File

@ -1448,7 +1448,7 @@ function reporting_get_group_stats ($id_group = 0, $access = 'AR') {
// Add id of this group to create the clause // Add id of this group to create the clause
// If the group is quering previously, we ingore it // 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($covered_groups, $group);
array_push($group_array, $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 // Get unknown agents by using the status code in modules
$data["agents_unknown"] += groups_agent_unknown ($group_array); $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 (); $data = array ();
$table->colspan[1][0] = 2; $table->colspan[1][0] = 2;
$table->colspan[2][0] = 2; $table->colspan[2][0] = 2;
if($description != '') { if ($description != '') {
$data[0] = $description; $data[0] = $description;
array_push ($table->data, $data); array_push ($table->data, $data);
} }

View File

@ -49,7 +49,8 @@ function users_get_info ($order = "fullname", $info = "fullname") {
* @return int sucess return * @return int sucess return
*/ */
function users_disable ($user_id, $new_disabled_value) { 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) { function users_can_manage_group_all($id_group = 0) {
global $config; global $config;
if($id_group != 0) { if ($id_group != 0) {
return true; return true;
} }

View File

@ -108,6 +108,8 @@ switch ($sortField) {
break; break;
} }
$totalAgents = 0;
$agents = false; $agents = false;
if ($searchAgents) { if ($searchAgents) {
$userGroups = users_get_groups($config['id_user'], 'AR', false); $userGroups = users_get_groups($config['id_user'], 'AR', false);