2009-06-29 Miguel de Dios <miguel.dedios@artica.es>

* reporting/pChart/pData.class: fix lost var ($url) in
	function grafico_eventos_grupo and at constants.
	* reporting/fgraph.php: fix, it's assumed that the arrays was numerical
	indexes.
	Fixes: #2805807



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1774 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2009-06-29 11:01:21 +00:00
parent 41d1d4496f
commit 588d673fcd
3 changed files with 17 additions and 4 deletions

View File

@ -1,3 +1,11 @@
2009-06-29 Miguel de Dios <miguel.dedios@artica.es>
* reporting/pChart/pData.class: fix lost var ($url) in
function grafico_eventos_grupo and at constants.
* reporting/fgraph.php: fix, it's assumed that the arrays was numerical
indexes.
Fixes: #2805807
2009-06-25 Manuel Arostegui <marostegui@artica.es> 2009-06-25 Manuel Arostegui <marostegui@artica.es>
* pandora_console.spec: RPM spec file for 3.0 version. * pandora_console.spec: RPM spec file for 3.0 version.

View File

@ -668,6 +668,7 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "") {
$url = html_entity_decode (rawurldecode ($url), ENT_QUOTES); //It was urlencoded, so we urldecode it $url = html_entity_decode (rawurldecode ($url), ENT_QUOTES); //It was urlencoded, so we urldecode it
$data = array (); $data = array ();
$loop = 0; $loop = 0;
define (NUM_PIECES_PIE, 6);
$badstrings = array (";", "SELECT ", "DELETE ", "UPDATE ", "INSERT ", "EXEC"); $badstrings = array (";", "SELECT ", "DELETE ", "UPDATE ", "INSERT ", "EXEC");
//remove bad strings from the query so queries like ; DELETE FROM don't pass //remove bad strings from the query so queries like ; DELETE FROM don't pass
@ -679,6 +680,7 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "") {
$sql = sprintf ('SELECT DISTINCT(id_agente) AS id_agente, id_grupo, COUNT(id_agente) AS count $sql = sprintf ('SELECT DISTINCT(id_agente) AS id_agente, id_grupo, COUNT(id_agente) AS count
FROM tevento WHERE 1=1 %s FROM tevento WHERE 1=1 %s
GROUP BY id_agente ORDER BY count DESC', $url); GROUP BY id_agente ORDER BY count DESC', $url);
$result = get_db_all_rows_sql ($sql); $result = get_db_all_rows_sql ($sql);
if ($result === false) { if ($result === false) {
$result = array(); $result = array();
@ -688,7 +690,7 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "") {
if (!give_acl ($config["id_user"], $row["id_grupo"], "AR") == 1) if (!give_acl ($config["id_user"], $row["id_grupo"], "AR") == 1)
continue; continue;
if ($loop > 5) { if ($loop >= NUM_PIECES_PIE) {
if (!isset ($data[__('Other')])) if (!isset ($data[__('Other')]))
$data[__('Other')] = 0; $data[__('Other')] = 0;
$data[__('Other')] += $row["count"]; $data[__('Other')] += $row["count"];
@ -702,6 +704,7 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "") {
} }
$loop++; $loop++;
} }
error_reporting (0); error_reporting (0);
generic_pie_graph ($width, $height, $data, array ('show_legend' => false)); generic_pie_graph ($width, $height, $data, array ('show_legend' => false));
} }
@ -1080,6 +1083,7 @@ $stacked = get_parameter ("stacked", 0);
$date = get_parameter ("date"); $date = get_parameter ("date");
$graphic_type = (string) get_parameter ('tipo'); $graphic_type = (string) get_parameter ('tipo');
$mode = get_parameter ("mode", 1); $mode = get_parameter ("mode", 1);
$url = get_parameter ("url");
if ($graphic_type) { if ($graphic_type) {
switch ($graphic_type) { switch ($graphic_type) {
@ -1116,7 +1120,7 @@ if ($graphic_type) {
break; break;
case "group_events": case "group_events":
grafico_eventos_grupo ($width, $height); grafico_eventos_grupo ($width, $height,$url);
break; break;
case "user_events": case "user_events":

View File

@ -118,9 +118,10 @@
} }
function AddPoint($Value,$Serie="Serie1",$Description="") function AddPoint($Value,$Serie="Serie1",$Description="")
{ {//echo "#$Serie#";print_r($Value);
if (is_array($Value) && count($Value) == 1) if (is_array($Value) && count($Value) == 1)
$Value = $Value[0]; $Value = reset($Value); //In previous releases has a bug, because it's
//assumed that array have a numerical indexes, now take the first simply.
$ID = 0; $ID = 0;
for($i=0;$i<=count($this->Data);$i++) for($i=0;$i<=count($this->Data);$i++)