From 578874e9a23f00efe1b9094088517a7dc37798a9 Mon Sep 17 00:00:00 2001
From: esanchezm <noreply@pandorafms.org>
Date: Thu, 22 Feb 2007 16:45:10 +0000
Subject: [PATCH] 2007-02-22  Esteban Sanchez  <estebans@artica.es>

        * pandoradb.sql: Changed a 'utimestamp' field from mediumint to
        integer.


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@382 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
---
 pandora_console/ChangeLog                           | 5 +++++
 pandora_console/include/functions_db.php            | 7 +++----
 pandora_console/operation/agentes/estado_agente.php | 5 +++--
 pandora_console/pandoradb.sql                       | 2 +-
 4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog
index aa938d78de..eee6f4fa65 100644
--- a/pandora_console/ChangeLog
+++ b/pandora_console/ChangeLog
@@ -1,3 +1,8 @@
+2007-02-22  Esteban Sanchez  <estebans@artica.es>
+
+	* pandoradb.sql: Changed a 'utimestamp' field from mediumint to
+	integer.
+
 2007-02-22  Sancho Lerena  <slerena@artica.es>
 
 	* pandoradb.sql: Fixed some problems in last commit.
diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php
index cf7278a369..d36c9dea01 100644
--- a/pandora_console/include/functions_db.php
+++ b/pandora_console/include/functions_db.php
@@ -592,17 +592,16 @@ function give_agentmodule_flag($id_agent_module){
 // Returns a combo with the groups and defines an array 
 // to put all groups with Agent Read permission
 // ----------------------------------------------------------------------
-
 function list_group ($id_user){
-	$mis_grupos[]=""; // Define array mis_grupos to put here all groups with Agent Read permission
+	$mis_grupos=array (); // Define array mis_grupos to put here all groups with Agent Read permission
 	$sql='SELECT id_grupo FROM tgrupo';
 	$result=mysql_query($sql);
 	while ($row=mysql_fetch_array($result)){
 		if ($row["id_grupo"] != 1){
 			if (give_acl($id_user,$row["id_grupo"], "AR") == 1){
+				array_push ($mis_grupos, $row["id_grupo"]); //Put in  an array all the groups the user belongs
 				echo "<option value='".$row["id_grupo"]."'>".
 				dame_nombre_grupo($row["id_grupo"])."</option>";
-				$mis_grupos[]=$row["id_grupo"]; //Put in  an array all the groups the user belongs
 			}
 		}
 	}
@@ -656,4 +655,4 @@ function show_icon_type($id_tipo){
 	return $pro;
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php
index db69630cb8..1bab642b22 100644
--- a/pandora_console/operation/agentes/estado_agente.php
+++ b/pandora_console/operation/agentes/estado_agente.php
@@ -64,6 +64,7 @@ if (comprueba_login() == 0) {
 	}
 	echo "<option value=1>".dame_nombre_grupo(1)."</option>"; // Group all is always active 
 	$mis_grupos=list_group ($id_user); //Print combo for groups and set an array with all groups
+
 	echo "</select>";
 	echo "<td valign='middle'>
 	<noscript>
@@ -133,7 +134,7 @@ if (comprueba_login() == 0) {
 				$monitor_ok = 0; 
 				$monitor_down=0; 
 				$numero_datamodules=0;
-				$estado_cambio=0; // Oops, I forgot initialize this fucking var... many problems due it
+				$estado_cambio=0;
 				$ahora=date("Y/m/d H:i:s");
 				// Calculate module/monitor totals  for this agent
 				while ($row_t=mysql_fetch_array($result_t)){
@@ -282,4 +283,4 @@ if (comprueba_login() == 0) {
 		require ("general/noaccess.php");
 }
 }
-?>
\ No newline at end of file
+?>
diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql
index aa0e968b48..1a06616886 100644
--- a/pandora_console/pandoradb.sql
+++ b/pandora_console/pandoradb.sql
@@ -11,7 +11,7 @@ CREATE TABLE `tagent_access` (
   `id_ac` bigint(20) unsigned NOT NULL auto_increment,
   `id_agent` int(8) unsigned NOT NULL default '0',
   `timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
-  `utimestamp` mediumint(12) unsigned NOT NULL default '0',
+  `utimestamp` integer unsigned NOT NULL default '0',
   PRIMARY KEY  (`id_ac`),
   KEY `agent_index` (`id_agent`)
 ) TYPE=InnoDB;