2012-03-31 Junichi Satoh <junichi@rworks.jp>

* extensions/users_connected.php, extensions/module_groups.php: Fixed
	SQL error with PostgreSQL.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5857 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
jsatoh 2012-03-31 07:12:20 +00:00
parent 3d97ab3afa
commit 698710a581
3 changed files with 17 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2012-03-31 Junichi Satoh <junichi@rworks.jp>
* extensions/users_connected.php, extensions/module_groups.php: Fixed
SQL error with PostgreSQL.
2012-03-31 Junichi Satoh <junichi@rworks.jp> 2012-03-31 Junichi Satoh <junichi@rworks.jp>
* include/functions_graph.php: Fixed SQL error with PostgreSQL. * include/functions_graph.php: Fixed SQL error with PostgreSQL.

View File

@ -101,7 +101,6 @@ function mainModuleGroups() {
//The big query //The big query
switch ($config["dbtype"]) { switch ($config["dbtype"]) {
case "mysql": case "mysql":
case "postgresql":
$sql = "SELECT COUNT(id_agente) AS count, estado $sql = "SELECT COUNT(id_agente) AS count, estado
FROM tagente_estado FROM tagente_estado
WHERE utimestamp != 0 AND id_agente IN WHERE utimestamp != 0 AND id_agente IN
@ -112,6 +111,17 @@ function mainModuleGroups() {
WHERE id_module_group = %d AND disabled IS FALSE AND delete_pending IS FALSE) WHERE id_module_group = %d AND disabled IS FALSE AND delete_pending IS FALSE)
GROUP BY estado"; GROUP BY estado";
break; break;
case "postgresql":
$sql = "SELECT COUNT(id_agente) AS count, estado
FROM tagente_estado
WHERE utimestamp != 0 AND id_agente IN
(SELECT id_agente FROM tagente WHERE id_grupo = %d AND disabled = 0)
AND id_agente_modulo IN
(SELECT id_agente_modulo
FROM tagente_modulo
WHERE id_module_group = %d AND disabled = 0 AND delete_pending = 0)
GROUP BY estado";
break;
case "oracle": case "oracle":
$sql = "SELECT COUNT(id_agente) AS count, estado $sql = "SELECT COUNT(id_agente) AS count, estado
FROM tagente_estado FROM tagente_estado

View File

@ -39,7 +39,7 @@ function users_extension_main_god ($god = true) {
case "postgresql": case "postgresql":
$sql = "SELECT id_usuario, ip_origen, fecha, accion $sql = "SELECT id_usuario, ip_origen, fecha, accion
FROM tsesion FROM tsesion
WHERE descripcion = '" . io_safe_input('Logged in') . "' AND utimestamp > (ceil(date_part('epoch', CURRENT_TIMESTAMP)) - 3600) GROUP BY id_usuario, ip_origen, accion"; WHERE descripcion = '" . io_safe_input('Logged in') . "' AND utimestamp > (ceil(date_part('epoch', CURRENT_TIMESTAMP)) - 3600) GROUP BY id_usuario, ip_origen, fecha, accion";
break; break;
case "oracle": case "oracle":
$sql = "SELECT id_usuario, ip_origen, fecha, accion $sql = "SELECT id_usuario, ip_origen, fecha, accion