diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 67b2d3d577..f741c2c28e 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2011-03-07 Miguel de Dios + + * general/logon_ok.php: change the SQL in postgreSQL and some parts of + source code to use the colummns with the case sensitive. + 2011-03-07 Miguel de Dios * include/functions_events.php, include/functions_reporting.php, diff --git a/pandora_console/general/logon_ok.php b/pandora_console/general/logon_ok.php index f27c28ded0..a4cc55a07e 100644 --- a/pandora_console/general/logon_ok.php +++ b/pandora_console/general/logon_ok.php @@ -160,10 +160,10 @@ switch ($config["dbtype"]) { AND `id_usuario` = '%s' ORDER BY `utimestamp` DESC LIMIT 10", $config["id_user"]); break; case "postgresql": - $sql = sprintf ("SELECT id_usuario,accion,fecha,ip_origen,descripcion + $sql = sprintf ("SELECT \"ID_usuario\", accion, fecha, \"IP_origen\", descripcion FROM tsesion WHERE (\"utimestamp\" > ceil(date_part('epoch', CURRENT_TIMESTAMP)) - 604800) - AND \"id_usuario\" = '%s' ORDER BY \"utimestamp\" DESC LIMIT 10", $config["id_user"]); + AND \"ID_usuario\" = '%s' ORDER BY \"utimestamp\" DESC LIMIT 10", $config["id_user"]); break; } @@ -175,10 +175,22 @@ if ($sessions === false) foreach ($sessions as $session) { $data = array (); - $data[0] = ''.$session['id_usuario'].''; + switch ($config["dbtype"]) { + case "mysql": + $session_id_usuario = $session['id_usuario']; + $session_ip_origen = $session['ip_origen']; + break; + case "postgresql": + $session_id_usuario = $session['ID_usuario']; + $session_ip_origen = $session['IP_origen']; + break; + } + + + $data[0] = '' . $session_id_usuario . ''; $data[1] = $session['accion']; $data[2] = $session['fecha']; - $data[3] = $session['ip_origen']; + $data[3] = $session_ip_origen; $data[4] = safe_output ($session['descripcion']); array_push ($table->data, $data);