Index: controlies/www/groups/index.html
===================================================================
--- controlies/www/groups/index.html	(revision 83)
+++ controlies/www/groups/index.html	(revision 84)
@@ -90,11 +90,25 @@
 			}
 			
 			function addRecord(){
-
+				$("#messageLoading").show();		
+				
 				$("#dialog-form").html("");
 				$("#dialog-form").load("groups/form.html", function() {
 					$("#form_data #action").val("add");
 					$("#form_data #messageForm").html("Todos los campos son obligatorios");					
+
+					x = ($(window).width()-500)/2;
+					y = ($(window).height()-500)/2;
+
+					$("#messageLoading").hide();
+
+					$("#dialog-form").dialog({
+						resizable: false,
+						position: top,
+						modal: true,
+						width: 500,
+						title: "Añadir Grupo"
+					}).dialog('option', 'position', [x, y]);	
 					
 					var autoComplete = new $.TextboxList('#users', {unique: true, plugins: {autocomplete: {
 						minLength: 2,
@@ -101,18 +115,9 @@
 						queryRemote: true,
 						remote: {url: 'users?action=getAllUsers'}
 					}}});										
-				});
 
-				x = ($(window).width()-500)/2;
-				y = ($(window).height()-500)/2;
-
-				$("#dialog-form").dialog({
-					resizable: false,
-					position: top,
-					modal: true,
-					width: 500,
-					title: "Añadir Grupo"
-				}).dialog('option', 'position', [x, y]);
+			
+				});									
 			}
 			
 			var autoComplete;
@@ -119,21 +124,17 @@
 			
 			function modifyRecord(){
 				var uid;
-				
+
+				$("#messageLoading").show();
+								
 				var uid = rowSelected();
 				if(uid==false)
 					return false;
 
-				$("#dialog-form").html("");
+				$("#dialog-form").html("").css("display","none");;
 				$("#dialog-form").load("groups/form.html", function() {
 					
 					$("#form_data #action").val("modify");
-					// Autocomplete with poll the server as you type
-					autoComplete = new $.TextboxList('#users', {unique: true, plugins: {autocomplete: {
-						minLength: 2,
-						queryRemote: true,
-						remote: {url: 'users?action=getAllUsers'}
-					}}});
 		
 					$.post('groups', 'action=getGroupData&name='+uid, function(data) {
 						var result = $.parseJSON(data);
@@ -145,22 +146,31 @@
 							
 						$("#form_data #type").replaceWith(textType+"<input type='hidden' id='type' name='type' value='"+result.response['type']+"'/>");
 						$("#form_data #name").replaceWith(result.response['name']+"<input type='hidden' id='name' name='name' value='"+result.response['name']+"'/>");
+									
+						x = ($(window).width()-500)/2;
+						y = ($(window).height()-500)/2;
+						
+						$("#messageLoading").hide();
+						
+						$("#dialog-form").dialog({
+							resizable: false,
+							modal: true,
+							width: 500,
+							title: "Modificar Grupo"
+						}).dialog('option', 'position', [x, y]);		
+										
+						// Autocomplete with poll the server as you type
+						autoComplete = new $.TextboxList('#users', {unique: true, plugins: {autocomplete: {
+							minLength: 2,
+							queryRemote: true,
+							remote: {url: 'users?action=getAllUsers'}
+						}}});
 
 						$.each(result.response['memberuid'], function(i, l){
 							autoComplete.add(l);		
-						});					
+						});								
 					});			  
 				});
-
-				x = ($(window).width()-500)/2;
-				y = ($(window).height()-500)/2;
-				
-				$("#dialog-form").dialog({
-					resizable: false,
-					modal: true,
-					width: 500,
-					title: "Modificar Grupo"
-				}).dialog('option', 'position', [x, y]);
 			}
 
 			function deleteRecord(){
Index: controlies/www/users/index.html
===================================================================
--- controlies/www/users/index.html	(revision 83)
+++ controlies/www/users/index.html	(revision 84)
@@ -81,32 +81,39 @@
 
 			function addRecord(){
 
-				$("#dialog-form").html("");
+				$("#messageLoading").show();
+
+				$("#dialog-form").html("").css("display","none");;
 				$("#dialog-form").load("users/form.html", function() {
 					getAllGroups();
 					$("#form_data #action").val("add");
-					$("#form_data #messageForm").html("Todos los campos son obligatorios");					
-				});
+					$("#form_data #messageForm").html("Todos los campos son obligatorios");										
 
-				x = ($(window).width()-250)/2;
-				y = ($(window).height()-400)/2;
+					x = ($(window).width()-300)/2;
+					y = ($(window).height()-500)/2;
 
-				$("#dialog-form").dialog({
-					resizable: false,
-					position: top,
-					modal: true,
-					title: "Añadir Usuario"
-				}).dialog('option', 'position', [x, y]);
+					$("#messageLoading").hide();
+
+					$("#dialog-form").dialog({
+						resizable: false,
+						position: top,
+						modal: true,
+						width: 300,						
+						title: "Añadir Usuario"
+					}).dialog('option', 'position', [x, y]);
+				});
 			}
 
 			function modifyRecord(){
 				var uid;
+
+				$("#messageLoading").show();
 				
 				var uid = rowSelected();
 				if(uid==false)
 					return false;
 
-				$("#dialog-form").html("");
+				$("#dialog-form").html("").css("display","none");
 				$("#dialog-form").load("users/form.html", function() {
 					
 					getAllGroups();
@@ -141,18 +148,20 @@
 						$.each(result.response['groups']['classrooms'], function(i, l){
 							$('#form_data input:checkbox[value='+l+']').attr('checked', true);							
 						});						
+
+						x = ($(window).width()-300)/2;
+						y = ($(window).height()-500)/2;
+						
+						$("#messageLoading").hide();
+						
+						$("#dialog-form").dialog({
+							resizable: false,
+							modal: true,
+							width: 300,
+							title: "Modificar Usuario"
+						}).dialog('option', 'position', [x, y]);						
 					});				  
 				});
-
-				x = ($(window).width()-300)/2;
-				y = ($(window).height()-500)/2;
-				
-				$("#dialog-form").dialog({
-					resizable: false,
-					modal: true,
-					width: 300,
-					title: "Modificar Usuario"
-				}).dialog('option', 'position', [x, y]);
 			}
 
 			function deleteRecord(){
Index: controlies/www/main.html
===================================================================
--- controlies/www/main.html	(revision 83)
+++ controlies/www/main.html	(revision 84)
@@ -30,7 +30,11 @@
 		});
 
 		function loadModule(module){
-			$("#module").load(module+"/index.html");
+
+			$("#messageLoading").show();			
+			$("#module").load(module+"/index.html", function() {
+				$("#messageLoading").hide();
+			});
 		}
 
 		function logout(){
@@ -58,6 +62,11 @@
 </head>
 <body>
 
+	<div id="messageLoading" class="ui-state-error ui-corner-all" style="padding: 0pt 0.7em; float:right; width:90px; display:none;"> 
+		<p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: 0.3em;"></span> 
+		<strong id="messageGetGroups">Cargando...</strong></p>
+	</div>
+
 	<h1>&nbsp;&nbsp;Control<span class="fontTitle">IES</span>&nbsp;&nbsp;<span class="subTitle">Centros Educativos de Extremadura</span</h1>
 
 	<!-- Beginning of compulsory code below -->
Index: controlies/Plugins/Users.py
===================================================================
--- controlies/Plugins/Users.py	(revision 83)
+++ controlies/Plugins/Users.py	(revision 84)
@@ -395,12 +395,17 @@
 		if result[0][0][1]["homeDirectory"][0][0:14]=="/home/profesor":
 			type = "teacher"
 		
+		try:
+			photo = base64.b64encode(result[0][0][1]["jpegPhoto"][0])
+		except:
+			photo = ""
+			
 		dataUser = {
 			"user":result[0][0][1]["uid"][0],
 			"name":result[0][0][1]["cn"][0],
 			"surname":result[0][0][1]["sn"][0],
 			"nif":result[0][0][1]["employeeNumber"][0],
-			"photo":base64.b64encode(result[0][0][1]["jpegPhoto"][0]),
+			"photo":photo,
 			"type":type,
 			"groups":self.getUserGroups()
 		 }
