Index: controlies/trunk/applications/controlies/controllers/gestion.py
===================================================================
--- controlies/trunk/applications/controlies/controllers/gestion.py	(revision 355)
+++ controlies/trunk/applications/controlies/controllers/gestion.py	(revision 356)
@@ -3,7 +3,65 @@
 from applications.controlies.modules.Rayuela2Ldap import Rayuela  
 import applications.controlies.modules.Utils.LdapUtils as LdapUtils
 
+@service.json   
+@auth.requires_login()
+def base_datos():
+    import StringIO
+
+    right_version=right_firefox_version(request.env.http_user_agent)
+
+    if not "archivos" in session.keys():
+        session.archivos=[]    
+    form=SQLFORM.factory(Field('principiocurso','boolean',default=False ),submit_button='Enviar')
+    if form.accepts(request.vars, session):
+        response.flash = 'Procesando datos, espere'
+        borrando = form.vars.principiocurso
+        if len(session.archivos)>0:
+            l=conecta()
+            usuarios=[]
+
+            try:
+                os.mkdir( "/tmp/rayuela-ldap")
+            except:
+                pass #problema de permisos o directorio ya creado 
+
+            lista_completa=[]                           
+            for archivo in session.archivos:
+                rayuela=Rayuela(l,archivo,borrando)
+                todos=rayuela.gestiona_archivo()
+                lista_completa +=[(archivo,)]
+                lista_completa +=todos
+                lista_completa +=[("--",)]
+                
+            session.archivos=[]    
+            #LdapUtils.sanea_grupos(l)                               
+            l.close()
+            
+            #generamos el archivo de salida 
+            s=StringIO.StringIO()
+
+            for entrada in lista_completa:
+                if len(entrada)<3:
+                    s.write(entrada[0]+ '\n' + '\n')
+                else:
+                    linea=entrada[0] + " - "
+                    if entrada[1]:
+                        linea +=entrada[2]
+                        linea +='\n'
+                    else:
+                        linea += "USUARIO ANTIGUO\n"
+                    s.write(linea)             
+                          
+            response.headers['Content-Type']='text/txt'
+            response.headers['Content-Disposition'] = 'attachment;filename=usuarios.txt'
+            return s.getvalue()
+
+
+        session.archivos=[]
+  
     
+    return dict(form=form,right_version=right_version)
+    
 @service.json   
 @auth.requires_login()
 def servidores_aula():
Index: controlies/trunk/applications/controlies/controllers/usuarios.py
===================================================================
--- controlies/trunk/applications/controlies/controllers/usuarios.py	(revision 355)
+++ controlies/trunk/applications/controlies/controllers/usuarios.py	(revision 356)
@@ -11,6 +11,8 @@
 def list():
     l=conecta()
     u = Users(l,"","","","","","","","","")
+    import pdb
+    pdb.set_trace()
     response = u.list(request.vars)
     l.close()
     return response    
Index: controlies/trunk/applications/controlies/modules/Users.py
===================================================================
--- controlies/trunk/applications/controlies/modules/Users.py	(revision 355)
+++ controlies/trunk/applications/controlies/modules/Users.py	(revision 356)
@@ -115,8 +115,9 @@
         
             
     def list(self,args):
-
+        import pdb
         filter = self.buildFilter(args)
+        pdb.set_trace()
         search = self.ldap.search("ou=People",filter,["employeeNumber","uid","cn","uidnumber","gidnumber","homedirectory"])
 
         # grid parameters
@@ -182,7 +183,8 @@
 
     def buildFilter(self, args):
         filter = "(&(uid=*)"
-        
+        import pdb
+        pdb.set_trace()
         try:
             filter = filter + "(uid=*" + args['uid'] + "*)"
         except LookupError:
Index: controlies/trunk/applications/controlies/models/menu.py
===================================================================
--- controlies/trunk/applications/controlies/models/menu.py	(revision 355)
+++ controlies/trunk/applications/controlies/models/menu.py	(revision 356)
@@ -43,11 +43,12 @@
 response.menu+=[('Gestión', False, None,[            
             ('Servidores de Aula', False,URL( 'gestion', 'servidores_aula')),   
             ('Importación de Rayuela', False, URL( 'gestion', 'rayuela')),
+            ('Importación datos de Portátiles', False, URL( 'gestion', 'base_datos')),
             ]
    )]
 
 response.menu+=[('Base Datos', False, None,[            
-            ('Portátiles', False,URL( 'laptops', 'index')),   
+            ('Portátiles', False,URL( 'laptops', 'index')),
             ]
    )]
 
