2010-12-21 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_reporting.php, include/fgraph.php,
	include/functions_db.php, images/image_problem.opaque.png: fixed the bug
	because this bug was two things the access to graph with not login in the
	same machine to generate, and the transparent png that not crash with the
	pdf library.
	
	Fixes: #3139079



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3674 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2010-12-21 19:12:51 +00:00
parent 81f338d24a
commit 1a6e5dc031
4 changed files with 166 additions and 143 deletions

View File

@ -1,3 +1,13 @@
2010-12-21 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php, include/fgraph.php,
include/functions_db.php, images/image_problem.opaque.png: fixed the bug
because this bug was two things the access to graph with not login in the
same machine to generate, and the transparent png that not crash with the
pdf library.
Fixes: #3139079
2010-12-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/reporting_builder.php: fixed the action to sort up or

View File

@ -18,8 +18,8 @@
* @subpackage Graphs
*/
if (isset($config)) {
/**#@+
* If is set global var $config include this files
*/
@ -28,8 +28,10 @@ if (isset($config)) {
require_once ($config['homedir'].'/include/functions_fsgraph.php');
require_once ($config['homedir'].'/include/functions_reporting.php');
/**#@-*/
}
else {
/**#@+
* If is not set global var $config include this files
*/
@ -37,7 +39,9 @@ else {
require_once ($config['homedir'].'/include/pandora_graph.php');
require_once ($config['homedir'].'/include/functions_reporting.php');
/**#@-*/
}
enterprise_include ('include/functions_reporting.php');
set_time_limit (0);
@ -54,9 +58,8 @@ if (! isset ($config["id_user"])) {
require_once('../mobile/include/user.class.php');
session_start ();
session_write_close ();
$user = $_SESSION['user'];
if(!empty($user)) {
$config["id_user"] = $user->getIdUser();
if (isset ($_SESSION['user'])) {
$config["id_user"] = $_SESSION['user']->getIdUser();
}
}
}
@ -73,13 +76,17 @@ if (($_SERVER['SERVER_ADDR'] != $_SERVER['REMOTE_ADDR'])
*
* @param string image File that show when has a problem.
*/
function graphic_error ($image = 'image_problem.png') {
function graphic_error ($image = 'image_problem.opaque.png') {
global $config;
Header ('Content-type: image/png');
$img = imagecreatefromPng ($config['homedir'].'/images/'.$image);
imagealphablending ($img, true);
imagesavealpha ($img, true);
$image_file = $config['homedir'].'/images/'.$image;
$img = imagecreatefromPng ($image_file);
//imagealphablending ($img, true);
//imagesavealpha ($img, true);
imagepng ($img);
exit;
}
@ -2328,7 +2335,6 @@ function myErrorHandler($errno, $errstr, $errfile, $errline)
// Generic parameter handling
// **************************
$id_agent = (int) get_parameter ('id_agent');
$tipo = (string) get_parameter ('tipo');
$pure = (bool) get_parameter ('pure');

View File

@ -50,13 +50,14 @@ function check_login () {
require_once($config["homedir"].'/mobile/include/user.class.php');
session_start ();
session_write_close ();
if (isset($_SESSION['user'])) {
$user = $_SESSION['user'];
$id_user = $user->getIdUser();
if (is_user ($id_user)) {
return 0;
}
}
}
pandora_audit("No session", "Trying to access without a valid session", "N/A");
include ($config["homedir"]."/general/noaccess.php");
exit;

View File

@ -178,11 +178,17 @@ function get_agentmodule_data_max ($id_agent_module, $period, $date = 0) {
}
// Set initial conditions
if (empty($iterval_data)) {
$max = 0;
}
else {
if ($uncompressed_module || $interval_data[0]['utimestamp'] == $datelimit) {
$max = $interval_data[0]['datos'];
} else {
}
else {
$max = 0;
}
}
foreach ($interval_data as $data) {
if ($data['datos'] > $max) {