Beispiel #1
0
def getAllUsers():
    import applications.controlies.modules.Utils.LdapUtils as LdapUtils

    l = conecta()
    response = LdapUtils.getAllUsers(l)
    l.close()
    return response
Beispiel #2
0
def wakeup():
    data = gluon.contrib.simplejson.loads(request.body.read())

    l = conecta()
    broadcast = LdapUtils.getBroadcast(l)
    for i in data["pclist"]:
        h = Hosts(l, i, "", "", "")
        h.wakeup(broadcast)

    return response.json({'success': 'true'})
Beispiel #3
0
def wakeup():
    data = gluon.contrib.simplejson.loads(request.body.read())

    l=conecta()
    broadcast = LdapUtils.getBroadcast(l)
    for i in data["pclist"]:
        h = Hosts(l,i,"","","")
        h.wakeup(broadcast)

    return response.json({'success':'true'})
Beispiel #4
0
def wakeupThinclients():
    l=conecta()
    rows = LdapUtils.getThinclientsFromClassroom(l, request.vars["host"])

    try:
        server = xmlrpclib.ServerProxy("http://"+request.vars["host"]+":6800")
        s = server.wakeupThinclients(rows)
        return dict(response="OK", host=request.vars["host"], message=s)
    except:
        return dict(response="fail", host=request.vars["host"], message="Surgió un error")
Beispiel #5
0
def chat():
    if not auth.user: redirect(URL(c='default', f='index'))

    l = conecta()
    session.domain = LdapUtils.getDomain(l)
    l.close()

    import random
    r = lambda: random.randint(0, 255)
    color = ('#%02X%02X%02X' % (r(), r(), r()))
    session.color = color

    #WS.websocket_send('http://127.0.0.1:8888',session.domain+" ha entrado en la sala"+'<br/>','mykey','chat')
    return dict()
Beispiel #6
0
def chat():
    if not auth.user: redirect(URL(c='default',f='index'))

    l=conecta()
    session.domain = LdapUtils.getDomain(l)
    l.close()


    import random
    r = lambda: random.randint(0,255)
    color = ('#%02X%02X%02X' % (r(),r(),r()))
    session.color = color

    #WS.websocket_send('http://127.0.0.1:8888',session.domain+" ha entrado en la sala"+'<br/>','mykey','chat')    
    return dict()
Beispiel #7
0
def getClassrooms():
    import applications.controlies.modules.Utils.LdapUtils as LdapUtils
    l = conecta()
    response = LdapUtils.getAllGroups(l)
    l.close()
    return response
Beispiel #8
0
def getallranges():
    from applications.controlies.modules.Utils import LdapUtils
    l = conecta()
    myRanges = LdapUtils.getAllRanges(l)
    return dict(response=myRanges)
Beispiel #9
0
def getallranges():
    from applications.controlies.modules.Utils import LdapUtils
    l=conecta()
    myRanges = LdapUtils.getAllRanges(l)
    return dict(response=myRanges)