From de4ef7ced06c535d2ba94788fab3e0b70e7411fa Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 7 Mar 2011 12:38:49 +0000 Subject: [PATCH] 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. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4061 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/general/logon_ok.php | 20 ++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) 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);