Index: controlies/Plugins/Groups.py
===================================================================
--- controlies/Plugins/Groups.py	(revision 76)
+++ controlies/Plugins/Groups.py	(revision 77)
@@ -43,9 +43,8 @@
 						
     def validation(self,action):
 
-		if action == "add":
-			if self.type == "none":
-				return "type"
+		if self.type == "none":
+			return "type"
 				
 		if self.name == "":
 			return "name"
@@ -187,17 +186,19 @@
 
 			
     def modify(self):
-		print "llego"
+
+		members = []
+		for m in self.users.split(','):
+			members.append("uid=" + m + ",ou=People,dc=instituto,dc=extremadura,dc=es")
+			
 		mod_attrs = [
-		(ldap.MOD_REPLACE, 'memberuid', 'Author of New Organon'),
-		(ldap.MOD_REPLACE, 'member', 'British empiricist') 
+		(ldap.MOD_REPLACE, 'memberuid', self.users.split(',')),
+		(ldap.MOD_REPLACE, 'member', members) 
 		]
-		
-		#self.ldap.modify_s('uid='+ self.name +',ou=Group', mod_attrs)
+		print mod_attrs
+		self.ldap.modify('cn='+ self.name +',ou=Group', mod_attrs)
 
-		currentUsers = self.getGroupUsers()
-		print currentUsers
-		
+		return "OK"
 
     def delete(self):
 		self.ldap.delete('cn='+ self.name +',ou=Group')
@@ -222,7 +223,18 @@
 
 		return maxID
 
+    def getGroupData(self):
 
+		result = self.ldap.search("ou=Group","cn="+self.name,["cn","grouptype","memberuid"])
+
+		dataGroup = {
+			"name":result[0][0][1]["cn"][0],
+			"type":result[0][0][1]["groupType"][0],
+			"memberuid":result[0][0][1]["memberUid"]
+		 }
+		 
+		return dataGroup
+
     def getGroupUsers(self):
 		result = self.ldap.search("ou=Group","cn="+self.name,["cn","memberUid"])
 		
Index: controlies/www/groups/index.html
===================================================================
--- controlies/www/groups/index.html	(revision 76)
+++ controlies/www/groups/index.html	(revision 77)
@@ -113,7 +113,9 @@
 					title: "Añadir Grupo"
 				}).dialog('option', 'position', [x, y]);
 			}
-
+			
+			var autoComplete;
+			
 			function modifyRecord(){
 				var uid;
 				
@@ -126,38 +128,23 @@
 					
 					$("#form_data #action").val("modify");
 					// Autocomplete with poll the server as you type
-					var autoComplete = new $.TextboxList('#users', {unique: true, plugins: {autocomplete: {
+					autoComplete = new $.TextboxList('#users', {unique: true, plugins: {autocomplete: {
 						minLength: 2,
 						queryRemote: true,
 						remote: {url: 'users?action=getAllUsers'}
 					}}});
-					
-					$.post('users', 'action=getUserData&user='+uid, function(data) {
+		
+					$.post('groups', 'action=getGroupData&name='+uid, function(data) {
 						var result = $.parseJSON(data);
 
-						if(result.response['type']=="teacher")
-							var textType = "Profesor";
-						else
-							var textType = "Alumno";
-							
-						var dep = Array(result.response['groups']['departments']);
-
-						$("#form_data #type").replaceWith(textType+"<input type='hidden' id='type' name='type' value='"+result.response['type']+"'/>");
+						//$("#form_data #type").replaceWith(textType+"<input type='hidden' id='type' name='type' value='"+result.response['type']+"'/>");
 						$("#form_data #name").val(result.response['name']);
-						$("#form_data #nif").val(result.response['nif']);		
-						$("#form_data #user").val(result.response['user']);
-						$("#form_data #surname").val(result.response['surname']);
+						$("#form_data #type").val(result.response['type']);
 
-						$.each(result.response['groups']['departments'], function(i, l){
-							$('#form_data input:checkbox[value='+l+']').attr('checked', true);							
-						});
-
-						$.each(result.response['groups']['classrooms'], function(i, l){
-							$('#form_data input:checkbox[value='+l+']').attr('checked', true);							
-						});						
-					});	
-					//t5.add('John Doe').add('Jane Roe');	
-						  
+						$.each(result.response['memberuid'], function(i, l){
+							autoComplete.add(l);		
+						});					
+					});			  
 				});
 
 				x = ($(window).width()-500)/2;
Index: controlies/MainLoop.py
===================================================================
--- controlies/MainLoop.py	(revision 76)
+++ controlies/MainLoop.py	(revision 77)
@@ -161,6 +161,11 @@
 				response = g.getAllGroups()
 				return json.dumps(response)				
 
+        	elif request.args['action'][0] == "getGroupData":
+				g = Groups(l,"",request.args['name'][0],"")
+				response = g.getGroupData()
+				return json.dumps({"response" : response})
+				
         	elif request.args['action'][0] == "delete":
 				g = Groups(l,"",request.args['name'][0],"")
 				response = g.delete()
