Index: controlies/Server.py
===================================================================
--- controlies/Server.py	(revision 88)
+++ controlies/Server.py	(revision 89)
@@ -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/Utils/avahiClient.py
===================================================================
--- controlies/Utils/avahiClient.py	(nonexistent)
+++ controlies/Utils/avahiClient.py	(revision 89)
@@ -0,0 +1,52 @@
+import dbus, gobject, avahi
+from dbus import DBusException
+from dbus.mainloop.glib import DBusGMainLoop
+
+class avahiClient(object):  
+
+	names = []
+
+	def __init__ (self):
+
+		loop = DBusGMainLoop()
+		bus = dbus.SystemBus(mainloop=loop)
+
+		self.server = dbus.Interface(bus.get_object(avahi.DBUS_NAME, '/'), 'org.freedesktop.Avahi.Server')
+
+		sbrowser = dbus.Interface(bus.get_object(avahi.DBUS_NAME, self.server.ServiceBrowserNew(avahi.IF_UNSPEC, avahi.PROTO_UNSPEC, "_workstation._tcp", 'local', dbus.UInt32(0))), avahi.DBUS_INTERFACE_SERVICE_BROWSER)
+		sbrowser.connect_to_signal("ItemNew", self.myhandler)
+
+		self.loop = gobject.MainLoop()
+		self.loop.run()
+		
+
+	def service_resolved(self,*args):
+		#print args
+		print 'service resolved'
+		print 'name:', args[2]
+		print 'address:', args[7]
+		print 'port:', args[8]
+		#print args		
+		self.names.append(args[2])
+
+		#self.loop.quit()
+
+
+	def print_error(self,*args):
+		print 'error_handler'
+		print args[0]
+
+	def myhandler(self,interface, protocol, name, stype, domain, flags):
+		#print "Found service '%s' type '%s' domain '%s' " % (name, stype, domain)
+
+		if flags & avahi.LOOKUP_RESULT_LOCAL:
+				#print "que es esto"
+				pass
+
+		self.server.ResolveService(interface, protocol, name, stype, domain, avahi.PROTO_UNSPEC, dbus.UInt32(0), reply_handler=self.service_resolved, error_handler=self.print_error)
+		
+	def getList(self):
+		return self.names
+
+	def kill(self):
+		self.loop.quit()
Index: controlies/Plugins/Hosts.py
===================================================================
--- controlies/Plugins/Hosts.py	(revision 88)
+++ controlies/Plugins/Hosts.py	(revision 89)
@@ -26,6 +26,7 @@
 
 import ldap
 import logging
+import time
 from math import ceil
 from operator import itemgetter
 
@@ -147,15 +148,8 @@
 			search = self.ldap.search("ou=hosts","cn=*",["cn","ipHostNumber","macAddress"])		
 			
 			# triplets que contiene los nombres de los ltsp-servers
-			#triplets = l.search("ou=Netgroup","cn=ltsp-server-hosts",["nisNetgroupTriple"])
-			triplets = self.ldap.search("ou=Netgroup","cn=ltsp-server-hosts",["nisNetgroupTriple"])
-			triplets = triplets [0][0][1]["nisNetgroupTriple"]
-			hostnames=list()
-			
-			for node in triplets:
-				name = node.replace(",-,-)","").replace("(","")
-				hostnames.append(name)
-				
+			hostnames = self.getLTSPServers()
+							
 			# Ahora tengo que quedarme con los elementos de search que estan en hostnames: los que son ltsp
 			resultado=list()
 			for element in search:
@@ -376,6 +370,30 @@
 			groups.append (g[0][1]["cn"][0])
 			
 		return { "groups":groups }
+		
+		
+    def getLTSPServers (self):
+		triplets = self.ldap.search("ou=Netgroup","cn=ltsp-server-hosts",["nisNetgroupTriple"])
+		triplets = triplets [0][0][1]["nisNetgroupTriple"]
+		hostnames=list()
+			
+		for node in triplets:
+			name = node.replace(",-,-)","").replace("(","")
+			hostnames.append(name)
+		hostnames.sort()
+		return hostnames
+
+
+    def getLTSPStatus (self):
+		from Utils.avahiClient import avahiClient
+		
+		a = avahiClient()
+		time.sleep(1000) 		
+		names = a.getList()
+		print names
+		a.kill()
+		return names
+
 #	def wakeup(self):
 #		from twisted.internet.task import LoopingCall
 #		from twisted.internet import defer
Index: controlies/www/main.html
===================================================================
--- controlies/www/main.html	(revision 88)
+++ controlies/www/main.html	(revision 89)
@@ -84,6 +84,11 @@
 				<li><a href="javascript:loadForm('show','Parametros DHCP')">Parámetros DHCP</a></li>
 			</ul>
 		</li>
+		<li><a href="#" class="dir">Gestión</a>
+			<ul>
+				<li><a href="javascript:loadModule('classroomServers')">Servidores de Aula</a></li>
+			</ul>
+		</li>		
 	<!--	<li><a href="#" class="dir">Sincronización</a>
 			<ul>
 				<li><a href="#">Importación Rayuela</a></li>
Index: controlies/www/css/helper.css
===================================================================
--- controlies/www/css/helper.css	(revision 88)
+++ controlies/www/css/helper.css	(revision 89)
@@ -18,7 +18,7 @@
 * html ul.dropdown ul { background-image: url(images/dropdown_pane_8bit.png); }
 
 .centerAuth{ position:absolute; left:50%; margin-left:-150px; }
-.centerGrid{ position:absolute; left:50%; margin-left:-400px; }
+.centerGrid{ position:absolute; left:50%; margin-left:-450px; }
 
 form p{ margin-bottom:10px; font-weight:bold;}
 form input{ border:1px solid #DDD; }
Index: controlies/www/classroomServers/index.html
===================================================================
--- controlies/www/classroomServers/index.html	(nonexistent)
+++ controlies/www/classroomServers/index.html	(revision 89)
@@ -0,0 +1,39 @@
+<style>
+	#selectable .ui-selecting { background: #FECA40; }
+	#selectable .ui-selected { background: #F39814; color: white; }
+	#selectable { list-style-type: none; margin: 0; padding: 0; }
+	#selectable li { margin: 3px 3px 3px 0; padding: 1px; float: left; width: 80px; height: 95px; font-size: 1px; text-align: center; cursor:pointer; }
+</style>
+<script>
+	$(function() {
+		$( "#selectable" ).selectable();
+		getLTSPServers();
+	});
+	
+	function getLTSPServers(){
+		$.post('hosts','action=getLTSPServers', function(data) {
+			var result = $.parseJSON(data);
+			
+			$.each(result.response, function(i, l){
+				$('#selectable').append('<li class="ui-state-default" id="selectable-'+l+'"><div id="pcName" style="font-size:11px;">'+l+'</div><img class="thumb-image" src="img/turnOff.png"/><div id="userName" style="font-size:11px;">ajimenezf01</div></li>');					
+			});
+			
+			getLTSPStatus();
+		});
+	}
+	
+	function getLTSPStatus(){
+		$.post('hosts','action=getLTSPStatus', function(data) {
+			var result = $.parseJSON(data);
+			
+			$.each(result.response, function(i, l){
+				$('#selectable').append('<li class="ui-state-default" id="selectable-'+l+'"><div id="pcName" style="font-size:11px;">'+l+'</div><img class="thumb-image" src="img/turnOff.png"/><div id="userName" style="font-size:11px;">ajimenezf01</div></li>');					
+			});
+			
+			setTimeout("getLTSPStatus()",2000);			
+		});
+	}
+	
+</script>
+
+<ol id="selectable" style="width:900px;"></ol>
Index: controlies/www/groups/index.html
===================================================================
--- controlies/www/groups/index.html	(revision 88)
+++ controlies/www/groups/index.html	(revision 89)
@@ -37,7 +37,7 @@
 					], 
 					rowNum:25,
 					height:335,
-					width: 800,
+					width: 900,
 					rowList:[25,50,75],  
 					pager: '#pager', 
 					sortname: 'cn', 
Index: controlies/www/users/index.html
===================================================================
--- controlies/www/users/index.html	(revision 88)
+++ controlies/www/users/index.html	(revision 89)
@@ -27,7 +27,7 @@
 					], 
 					rowNum:25,
 					height:335,
-					width: 800,
+					width: 900,
 					rowList:[25,50,75],  
 					pager: '#pager', 
 					sortname: 'cn', 
Index: controlies/MainLoop.py
===================================================================
--- controlies/MainLoop.py	(revision 88)
+++ controlies/MainLoop.py	(revision 89)
@@ -175,7 +175,7 @@
 				response = g.process(request.args['action'][0])
 				return json.dumps({"response" : response})
 				
-			# Gestion de Grupos
+
         if command == "hosts":
         	from Plugins.Hosts import Hosts
         	import pdb
@@ -192,7 +192,18 @@
         	elif request.args['action'][0] == "getThinclientGroups":
 				h = Hosts (l,"","","","","")
 				response = h.getThinclientGroups ()
-				return json.dumps({"response" : response})				
+				return json.dumps({"response" : response})		
+				
+        	elif request.args['action'][0] == "getLTSPServers":
+				h = Hosts (l,"","","","","")
+				response = h.getLTSPServers ()
+				return json.dumps({"response" : response})		
+
+        	elif request.args['action'][0] == "getLTSPStatus":
+				h = Hosts (l,"","","","","")
+				response = h.getLTSPStatus ()
+				return json.dumps({"response" : response})		
+				
         	else:
 				if request.args ['type'][0] == 'thinclient':
 					ip = ""
