Index: controlies/Server.py
===================================================================
--- controlies/Server.py	(revision 84)
+++ controlies/Server.py	(revision 85)
@@ -34,8 +34,8 @@
 
 # Start up the web service.     
 Root = MainLoop.ControlIESProtocol() #Resource object
-Root.PageDir='/home/manu/proyectos/controlies/www/'
-#Root.PageDir='/home/chisco/Proyectos/controlies/www'
+#Root.PageDir='/home/manu/proyectos/controlies/www/'
+Root.PageDir='/home/chisco/Proyectos/controlies/www'
 site = server.Site(Root)
 
 #my_server = static.File('/home/chisco/workspace/adminies/www/')
Index: controlies/Plugins/Hosts.py
===================================================================
--- controlies/Plugins/Hosts.py	(revision 84)
+++ controlies/Plugins/Hosts.py	(revision 85)
@@ -34,11 +34,12 @@
     def __init__(self):
 		pass
 	
-    def __init__(self,ldap,name,ip,mac,type):
+    def __init__(self,ldap,name,ip,mac,group,type):
 		self.ldap = ldap
 		self.name = name
 		self.ip = ip
 		self.mac = mac
+		self.group = group 
 		self.type = type
 	
     def getName (self):
@@ -59,6 +60,10 @@
 
 		if self.mac == "":
 			return "mac"
+			
+		if self.type =="thinclient":
+			if self.group == "":
+				return "group"
 
 		if self.type == "":
 			return "type"
@@ -255,48 +260,48 @@
 			return { "page":page, "total":totalPages, "records":len(search), "rows":result }		
 
     def add(self):
-		maxID = str(self.getMaxID())
-		passwd = hashlib.sha1(self.password).hexdigest()
+		#maxID = str(self.getMaxID())
+		#passwd = hashlib.sha1(self.password).hexdigest()
 		
-		attr = [
-		('objectclass', ['top','posixAccount','shadowAccount','person','inetOrgPerson']),
-		('uid', [self.user]),
-		('cn', [self.name] ),
-		('employeenumber', [self.nif] ),		
-		('sn', [self.surname] ),
-		('uidnumber', [maxID] ),
-		('gidnumber', [maxID] ),	
-		('loginshell', ['/bin/bash'] ),
-		('homeDirectory', [self.whatHome() + self.user] ),
+		#attr = [
+		#('objectclass', ['top','posixAccount','shadowAccount','person','inetOrgPerson']),
+		#('uid', [self.user]),
+		#('cn', [self.name] ),
+		#('employeenumber', [self.nif] ),		
+		#('sn', [self.surname] ),
+		#('uidnumber', [maxID] ),
+		#('gidnumber', [maxID] ),	
+		#('loginshell', ['/bin/bash'] ),
+		#('homeDirectory', [self.whatHome() + self.user] ),
 		#('jpegPhoto', ['jpegPhoto'] ),		
-		('userpassword', [passwd])
-		]
+		#('userpassword', [passwd])
+		#]
 
-		self.ldap.add("uid="+self.user+",ou=People", attr)
+		#self.ldap.add("uid="+self.user+",ou=People", attr)
 
 		# Add private group
-		attr = [
-		('objectclass', ['top','posixGroup','lisGroup']),
-		('grouptype', ['private']),	
-		('gidnumber', [maxID] ),	
-		('cn', [self.user] ),
-		('description', [self.name+' personal group'] )
-		]
+		#attr = [
+		#('objectclass', ['top','posixGroup','lisGroup']),
+		#('grouptype', ['private']),	
+		#('gidnumber', [maxID] ),	
+		#('cn', [self.user] ),
+		#('description', [self.name+' personal group'] )
+		#]
 
-		self.ldap.add("cn="+self.user+",ou=Group", attr)
+		#self.ldap.add("cn="+self.user+",ou=Group", attr)
 		
 		
 		# Add selected groups	
-		attr = [
-		(ldap.MOD_ADD, 'member', ['uid='+self.user+',ou=People,dc=instituto,dc=extremadura,dc=es'] ),
-		(ldap.MOD_ADD, 'memberUid', [self.user] )
-		]
+		#attr = [
+		#(ldap.MOD_ADD, 'member', ['uid='+self.user+',ou=People,dc=instituto,dc=extremadura,dc=es'] ),
+		#(ldap.MOD_ADD, 'memberUid', [self.user] )
+		#]
 
-		for n in self.departments:
-			self.ldap.modify('cn='+ n +',ou=Group', attr)
+		#for n in self.departments:
+		#	self.ldap.modify('cn='+ n +',ou=Group', attr)
 
-		for n in self.classrooms:
-			self.ldap.modify('cn='+ n +',ou=Group', attr)
+		#for n in self.classrooms:
+		#	self.ldap.modify('cn='+ n +',ou=Group', attr)
 						
 		return "OK"
 		
Index: controlies/www/thinclients/index.html
===================================================================
--- controlies/www/thinclients/index.html	(revision 84)
+++ controlies/www/thinclients/index.html	(revision 85)
@@ -124,23 +124,42 @@
 				}).dialog('open');
 			}
 			
+			function loadGroups () {
+				
+			}
+
+
 			function addRecord(){
 
 				$("#dialog-form").html("");
 				$("#dialog-form").load("thinclients/form.html", function() {
 					$("#form_data #action").val("add");
-					$("#form_data #messageForm").html("Todos los campos son obligatorios");					
-				});
+					$("#form_data #messageForm").html("Todos los campos son obligatorios");		
+					
+					$.post('hosts','action=getThinclientGroups', function(data) {
+						var result = $.parseJSON(data);
 
-				x = ($(window).width()-250)/2;
-				y = ($(window).height()-400)/2;
+						var selectGrupos = document.getElementById("group");				
 
-				$("#dialog-form").dialog({
-					resizable: false,
-					position: top,
-					modal: true,
-					title: "Añadir Cliente Ligero"
-				}).dialog('option', 'position', [x, y]);
+						for (i=0;i<result.response.groups.length;i++) {
+							var optn = document.createElement("option");
+							optn.text = result.response.groups[i];
+							optn.value = result.response.groups[i];
+				
+							selectGrupos.options.add (optn);
+						}
+					});
+					
+					x = ($(window).width()-250)/2;
+					y = ($(window).height()-400)/2;
+
+					$("#dialog-form").dialog({
+						resizable: false,
+						position: top,
+						modal: true,
+						title: "Añadir Cliente Ligero"
+					}).dialog('option', 'position', [x, y]);								
+				});
 			}							
 		</script>
 
Index: controlies/MainLoop.py
===================================================================
--- controlies/MainLoop.py	(revision 84)
+++ controlies/MainLoop.py	(revision 85)
@@ -178,9 +178,9 @@
 			# Gestion de Grupos
         if command == "hosts":
         	from Plugins.Hosts import Hosts
-        	
+        	import pdb
         	if request.args['action'][0] == "list":
-				h = Hosts (l,"","","","")
+				h = Hosts (l,"","","","","")
 				response = h.list(request.args)
 
 				#prueba para encender un equipo
@@ -190,7 +190,7 @@
 				return json.dumps(response)
 				
         	elif request.args['action'][0] == "getThinclientGroups":
-				h = Hosts (l,"","","","")
+				h = Hosts (l,"","","","","")
 				response = h.getThinclientGroups ()
 				return json.dumps({"response" : response})				
         	else:
@@ -198,7 +198,8 @@
 					ip = ""
 				else:
 					ip = request.args ['ip'][0]
-				h = Hosts(l,request.args['name'][0],ip,request.args['mac'][0],request.args['type'][0])
+				pdb.set_trace()
+				h = Hosts(l,request.args['name'][0],ip,request.args['mac'][0],request.args['group'][0],request.args['type'][0])
 				response = h.process(request.args['action'][0])
 				return json.dumps({"response" : response})
 				
