Ejemplo n.º 1
0
def remove_user(sid):
    user = mxcube.USERS.pop(sid)

    if user["operator"]:
        state_storage.flush()
        flush()
    else:
        socketio.emit("observerLogout", user, namespace='/hwr')
        socketio.emit("observersChanged", get_observers(), namespace='/hwr')
Ejemplo n.º 2
0
def remove_user(sid):
    user = mxcube.USERS.pop(sid)

    if user["operator"]:
        state_storage.flush()
        flush()
    else:
        socketio.emit("observerLogout", user, namespace="/hwr")
        socketio.emit("observersChanged", get_observers(), namespace="/hwr")
Ejemplo n.º 3
0
def signout():
    """
    Signout from Mxcube3 and reset the session
    """
    global LOGGED_IN_USER

    qutils.save_queue(session)
    mxcube.queue = qutils.new_queue()

    LOGGED_IN_USER = None
    if remote_access.is_master(session.sid):
        state_storage.flush()
        remote_access.flush()

    session.clear()

    return make_response("", 200)
Ejemplo n.º 4
0
def signout():
    """
    Signout from Mxcube3 and reset the session
    """
    global LOGGED_IN_USER

    qutils.save_queue(session)
    mxcube.queue = qutils.new_queue()
    mxcube.shapes.clear_all()

    if mxcube.CURRENTLY_MOUNTED_SAMPLE:
        if mxcube.CURRENTLY_MOUNTED_SAMPLE.get('location', '') == 'Manual':
            mxcube.CURRENTLY_MOUNTED_SAMPLE = ''

    LOGGED_IN_USER = None
    if remote_access.is_master(session.sid):
        state_storage.flush()
        remote_access.flush()

    session.clear()

    return make_response("", 200)