|
@ -15,11 +15,7 @@ |
|
|
* GNU General Public License for more details. |
|
|
* GNU General Public License for more details. |
|
|
""" |
|
|
""" |
|
|
|
|
|
|
|
|
try: |
|
|
|
|
|
import simplejson |
|
|
|
|
|
except ImportError: |
|
|
|
|
|
import json as simplejson |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import json |
|
|
import re |
|
|
import re |
|
|
|
|
|
|
|
|
from StringIO import StringIO |
|
|
from StringIO import StringIO |
|
@ -192,7 +188,7 @@ def show( request, server ): |
|
|
|
|
|
|
|
|
return render_to_response( 'mumble/mumble.html', { |
|
|
return render_to_response( 'mumble/mumble.html', { |
|
|
'MumbleServer': srv, |
|
|
'MumbleServer': srv, |
|
|
'ServerDict': simplejson.dumps(serverinfo(request, server)), |
|
|
|
|
|
|
|
|
'ServerDict': json.dumps(serverinfo(request, server)), |
|
|
'RegForm': regformname, |
|
|
'RegForm': regformname, |
|
|
'MumbleActive': True, |
|
|
'MumbleActive': True, |
|
|
'MumbleAccount':user, |
|
|
'MumbleAccount':user, |
|
@ -529,7 +525,7 @@ def mmng_tree( request, server ): |
|
|
prefix = "" |
|
|
prefix = "" |
|
|
|
|
|
|
|
|
return HttpResponse( |
|
|
return HttpResponse( |
|
|
prefix + "(" + simplejson.dumps( { 'channels': chanlist, 'users': userlist } ) + ")", |
|
|
|
|
|
|
|
|
prefix + "(" + json.dumps( { 'channels': chanlist, 'users': userlist } ) + ")", |
|
|
mimetype='text/javascript' |
|
|
mimetype='text/javascript' |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
@ -558,7 +554,7 @@ def cvp_json( request, server ): |
|
|
See <http://mumble.sourceforge.net/Channel_Viewer_Protocol> |
|
|
See <http://mumble.sourceforge.net/Channel_Viewer_Protocol> |
|
|
""" |
|
|
""" |
|
|
srv = get_object_or_404( Mumble, id=int(server) ) |
|
|
srv = get_object_or_404( Mumble, id=int(server) ) |
|
|
json = simplejson.dumps( srv.asDict( cvp_checkauth( request, srv ) ) ) |
|
|
|
|
|
|
|
|
json = json.dumps( srv.asDict( cvp_checkauth( request, srv ) ) ) |
|
|
|
|
|
|
|
|
if "callback" in request.GET: |
|
|
if "callback" in request.GET: |
|
|
validate_jsonp_callback(request.GET["callback"]) |
|
|
validate_jsonp_callback(request.GET["callback"]) |
|
@ -602,6 +598,6 @@ def mumbleviewer_tree_json( request, server ): |
|
|
prefix = "" |
|
|
prefix = "" |
|
|
|
|
|
|
|
|
return HttpResponse( |
|
|
return HttpResponse( |
|
|
prefix + "(" + simplejson.dumps( srv.asMvJson() ) + ")", |
|
|
|
|
|
|
|
|
prefix + "(" + json.dumps( srv.asMvJson() ) + ")", |
|
|
mimetype='text/javascript' |
|
|
mimetype='text/javascript' |
|
|
) |
|
|
) |