Browse Source

fix registration for 1.1.8 over ice

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
72672e32f8
  1. 4
      pyweb/mumble/MumbleCtlIce.py
  2. 17
      pyweb/mumble/mmobjects.py

4
pyweb/mumble/MumbleCtlIce.py

@ -215,7 +215,9 @@ class MumbleCtlIce_118(MumbleCtlBase):
@protectDjangoErrPage @protectDjangoErrPage
def setRegistration(self, srvid, mumbleid, name, email, password): def setRegistration(self, srvid, mumbleid, name, email, password):
user = self._getIceServerObject(srvid).getRegistration(mumbleid)
from Murmur import Player
user = Player()
user.playerid = mumbleid;
user.name = name.encode( "UTF-8" ) user.name = name.encode( "UTF-8" )
user.email = email.encode( "UTF-8" ) user.email = email.encode( "UTF-8" )
user.pw = password.encode( "UTF-8" ) user.pw = password.encode( "UTF-8" )

17
pyweb/mumble/mmobjects.py

@ -29,7 +29,7 @@ def cmp_names( a, b ):
class mmChannel( object ): class mmChannel( object ):
"""Represents a channel in Murmur."""
""" Represents a channel in Murmur. """
def __init__( self, server, channelObj, parentChan = None ): def __init__( self, server, channelObj, parentChan = None ):
self.server = server; self.server = server;
@ -55,7 +55,7 @@ class mmChannel( object ):
raise AttributeError( "'%s' object has no attribute '%s'" % ( self.__class__.__name__, key ) ); raise AttributeError( "'%s' object has no attribute '%s'" % ( self.__class__.__name__, key ) );
def parentChannels( self ): def parentChannels( self ):
"""Return the names of this channel's parents in the channel tree."""
""" Return the names of this channel's parents in the channel tree. """
if self.parent is None or self.parent.is_server or self.parent.chanid == 0: if self.parent is None or self.parent.is_server or self.parent.chanid == 0:
return []; return [];
return self.parent.parentChannels() + [self.parent.name]; return self.parent.parentChannels() + [self.parent.name];
@ -97,14 +97,14 @@ class mmChannel( object ):
return '<Channel "%s" (%d)>' % ( self.name, self.chanid ); return '<Channel "%s" (%d)>' % ( self.name, self.chanid );
def sort( self ): def sort( self ):
"""Sort my subchannels and players, and then iterate over them and sort them recursively."""
""" Sort my subchannels and players, and then iterate over them and sort them recursively. """
self.subchans.sort( cmp_names ); self.subchans.sort( cmp_names );
self.players.sort( cmp_names ); self.players.sort( cmp_names );
for sc in self.subchans: for sc in self.subchans:
sc.sort(); sc.sort();
def visit( self, callback, lvl = 0 ): def visit( self, callback, lvl = 0 ):
"""Call callback on myself, then visit my subchans, then my players."""
""" Call callback on myself, then visit my subchans, then my players. """
callback( self, lvl ); callback( self, lvl );
for sc in self.subchans: for sc in self.subchans:
sc.visit( callback, lvl + 1 ); sc.visit( callback, lvl + 1 );
@ -113,8 +113,7 @@ class mmChannel( object ):
def getURL( self, forUser = None ): def getURL( self, forUser = None ):
"""
Create an URL to connect to this channel. The URL is of the form
""" Create an URL to connect to this channel. The URL is of the form
mumble://username@host:port/parentchans/self.name mumble://username@host:port/parentchans/self.name
""" """
userstr = ""; userstr = "";
@ -139,7 +138,7 @@ class mmChannel( object ):
connecturl = property( getURL, doc="A convenience wrapper for getURL." ); connecturl = property( getURL, doc="A convenience wrapper for getURL." );
def setDefault( self ): def setDefault( self ):
"Make this the server's default channel."
""" Make this the server's default channel. """
self.server.defchan = self.chanid; self.server.defchan = self.chanid;
self.server.save(); self.server.save();
@ -158,7 +157,7 @@ class mmChannel( object ):
class mmPlayer( object ): class mmPlayer( object ):
"""Represents a Player in Murmur."""
""" Represents a Player in Murmur. """
def __init__( self, srvInstance, playerObj, playerChan ): def __init__( self, srvInstance, playerObj, playerChan ):
self.playerObj = playerObj; self.playerObj = playerObj;
@ -224,7 +223,7 @@ class mmPlayer( object ):
class mmACL( object ): class mmACL( object ):
"""Represents an ACL for a certain channel."""
""" Represents an ACL for a certain channel. """
def __init__( self, channel, aclObj ): def __init__( self, channel, aclObj ):
self.channel = channel; self.channel = channel;

Loading…
Cancel
Save