2011-02-18 Sancho Lerena <slerena@artica.es>

* operation/agentes/gis_view.php: Fixed ACL Problems in operation
        view (Was looking for PM instead AR!). Fixed search by date in data
        view for GIS data.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3914 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2011-02-17 23:50:57 +00:00
parent 1ef03ea5b1
commit 1760658573
2 changed files with 16 additions and 7 deletions

View File

@ -1,3 +1,12 @@
2011-02-18 Sancho Lerena <slerena@artica.es>
Merged bugfix from trunk.
* operation/agentes/gis_view.php: Fixed ACL Problems in operation
view (Was looking for PM instead AR!). Fixed search by date in data
view for GIS data.
2011-02-17 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_reports.php

View File

@ -2,7 +2,7 @@
/**
* Pandora FMS- http://pandorafms.com
* ==================================================
* Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
* Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -18,10 +18,10 @@ global $config;
check_login ();
if (! give_acl ($config['id_user'], 0, "PM") && ! is_user_admin ($config['id_user'])) {
pandora_audit("ACL Violation", "Trying to access Visual Setup Management");
require ("general/noaccess.php");
return;
if (! give_acl ($config['id_user'], 0, "AR") && ! is_user_admin ($config['id_user'])) {
pandora_audit("ACL Violation", "Trying to access GIS Agent view");
require ("general/noaccess.php");
return;
}
require_once ('include/functions_gis.php');
@ -87,12 +87,12 @@ echo "</form>";
echo "<h3>" . __("Positional data from the last") . " " . human_time_description ($period) ."</h3>";
/* Get the total number of Elements for the pagination */
$sqlCount = sprintf ("SELECT COUNT(*) FROM tgis_data_history WHERE tagente_id_agente = %d AND end_timestamp > %d ORDER BY end_timestamp DESC", $agentId, get_system_time () - $period);
$sqlCount = sprintf ("SELECT COUNT(*) FROM tgis_data_history WHERE tagente_id_agente = %d AND end_timestamp > FROM_UNIXTIME(%d) ORDER BY end_timestamp DESC", $agentId, get_system_time () - $period);
$countData = get_db_value_sql($sqlCount);
/* Get the elements to present in this page */
$sql = sprintf ("SELECT longitude, latitude, altitude, start_timestamp, end_timestamp, description, number_of_packages, manual_placement
FROM tgis_data_history
WHERE tagente_id_agente = %d AND end_timestamp > %d
WHERE tagente_id_agente = %d AND end_timestamp > FROM_UNIXTIME(%d)
ORDER BY end_timestamp DESC
LIMIT %d OFFSET %d", $agentId, get_system_time () - $period, $config['block_size'], get_parameter ('offset'));