|
@ -37,6 +37,7 @@ from django.core.urlresolvers import reverse |
|
|
from django.contrib.auth.decorators import login_required |
|
|
from django.contrib.auth.decorators import login_required |
|
|
|
|
|
|
|
|
from models import Mumble, MumbleUser |
|
|
from models import Mumble, MumbleUser |
|
|
|
|
|
from forms import * |
|
|
from mmobjects import mmServer, mmChannel |
|
|
from mmobjects import mmServer, mmChannel |
|
|
|
|
|
|
|
|
class Storage( object ): |
|
|
class Storage( object ): |
|
@ -58,7 +59,7 @@ def show( request, server ): |
|
|
|
|
|
|
|
|
return render_to_response( |
|
|
return render_to_response( |
|
|
'mumble/mumble.htm', |
|
|
'mumble/mumble.htm', |
|
|
{ 'DBaseObject': srv, 'ServerObject': o, 'ChannelTable': Storage.s }, |
|
|
|
|
|
|
|
|
{ 'DBaseObject': srv, 'ServerObject': o, 'ChannelTable': Storage.s, "CurrentUserIsAdmin": srv.isUserAdmin( request.user ) }, |
|
|
context_instance = RequestContext(request) |
|
|
context_instance = RequestContext(request) |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
@ -153,6 +154,24 @@ def savereg( request ): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@login_required |
|
|
|
|
|
def admin( request, serverid ): |
|
|
|
|
|
murmur = get_object_or_404( Mumble, id=serverid ); |
|
|
|
|
|
|
|
|
|
|
|
if request.method == 'POST': |
|
|
|
|
|
form = MumbleForm( request.POST, instance=murmur ); |
|
|
|
|
|
if form.is_valid(): |
|
|
|
|
|
form.save(); |
|
|
|
|
|
return HttpResponseRedirect( '/mumble/%d' % int(serverid) ); |
|
|
|
|
|
else: |
|
|
|
|
|
form = MumbleForm( instance=murmur ); |
|
|
|
|
|
|
|
|
|
|
|
return render_to_response( |
|
|
|
|
|
'mumble/admin.htm', |
|
|
|
|
|
{ "Mumble": murmur, "Adminform": form, "CurrentUserIsAdmin": murmur.isUserAdmin( request.user ) }, |
|
|
|
|
|
context_instance = RequestContext(request) |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|