Esempio n. 1
0
def mumbleadmin_kick(request, session_id):
    server = get_server()
    user = server.getUsers()[int(session_id)]
    server.kickUser(int(session_id), "Kicked via web admin")
    messages.success(request, 'Kicked %s from mumble' % user.name)

    server.ice_getCommunicator().destroy()
    return redirect(mumbleadmin_index)
Esempio n. 2
0
def mumbleadmin_index(request):
    server = get_server()

    context = {
        "server": server,
        "users": map(lambda x: x[1], server.getUsers().items())
    }

    o = render(request, "eveauth/mumbleadmin_index.html", context)
    server.ice_getCommunicator().destroy()
    return o
Esempio n. 3
0
def channel(id):
    if settings.MUMBLE_HOST == "":
        return "CHANNEL_NAME"

    # Try cache
    key = "murmur_channel_name:%s"
    name = cache.get(key % id)
    if name != None:
        return name

    # Populate cache
    murmur = get_server()
    channels = murmur.getChannels()
    for channel in channels:
        channel = channels[channel]
        cache.set(key % channel.id, channel.name, 60)
        if channel.id == id:
            name = channel.name
    murmur.ice_getCommunicator().destroy()

    return name