Browse Source

renamed "identifier" to "channelid", revoke users admin status before deleting

Natenom/support-murmur-13-1446181288462
Michael Ziegler 16 years ago
parent
commit
48f366c76b
  1. 4
      pyweb/mumble/MumbleCtlDbus.py
  2. 44
      pyweb/mumble/MumbleCtlIce.py
  3. 2
      pyweb/mumble/mctl.py
  4. 3
      pyweb/mumble/models.py

4
pyweb/mumble/MumbleCtlDbus.py

@ -87,8 +87,8 @@ class MumbleCtlDbus(MumbleCtlBase):
def getRegisteredPlayers(self, srvid, filter = ''):
return MumbleCtlDbus.converDbusTypeToNative(self._getDbusServerObject(srvid).getRegisteredPlayers( filter ) )
def getACL(self, srvid, identifier):
return MumbleCtlDbus.converDbusTypeToNative(self._getDbusServerObject(srvid).getACL(identifier))
def getACL(self, srvid, channelid):
return MumbleCtlDbus.converDbusTypeToNative(self._getDbusServerObject(srvid).getACL(channelid))
def setACL(self, srvid, acl):
self._getDbusServerObject(srvid).setACL(*acl.pack())

44
pyweb/mumble/MumbleCtlIce.py

@ -113,25 +113,6 @@ class MumbleCtlIce_118(MumbleCtlBase):
return ret
def getACL(self, srvid, identifier):
import Murmur
acls = self._getIceServerObject(srvid).getACL(identifier)
ret = []
for x in acls:
if isinstance(x, list):
tmp = []
for y in x:
if y.__class__ is Murmur.ACL:
tmp.append([y.applyHere, y.applySubs, y.inherited, y.playerid, self.setUnicodeFlag(y.group), y.allow, y.deny])
elif y.__class__ is Murmur.Group:
tmp.append([self.setUnicodeFlag(y.name), y.inherited, y.inherit, y.inheritable, y.add, y.remove, y.members])
ret.append(tmp)
else:
ret.append(x)
return ret
def getDefaultConf(self):
return self.setUnicodeFlag(self.meta.getDefaultConf())
@ -175,6 +156,25 @@ class MumbleCtlIce_118(MumbleCtlBase):
# update*r*egistration r is lowercase...
return self._getIceServerObject(srvid).updateregistration(user)
def getACL(self, srvid, channelid):
import Murmur
acls = self._getIceServerObject(srvid).getACL(channelid)
ret = []
for x in acls:
if isinstance(x, list):
tmp = []
for y in x:
if y.__class__ is Murmur.ACL:
tmp.append([y.applyHere, y.applySubs, y.inherited, y.playerid, self.setUnicodeFlag(y.group), y.allow, y.deny])
elif y.__class__ is Murmur.Group:
tmp.append([self.setUnicodeFlag(y.name), y.inherited, y.inherit, y.inheritable, y.add, y.remove, y.members])
ret.append(tmp)
else:
ret.append(x)
return ret
def setACL(self, srvid, acl):
import Murmur
@ -300,9 +300,9 @@ class MumbleCtlIce_120(MumbleCtlIce_118):
user['pw'] = password.encode( "UTF-8" )
return self._getIceServerObject( srvid ).updateRegistration( mumbleid, user )
def getACL(self, srvid, identifier):
def getACL(self, srvid, channelid):
import Murmur
acls = self._getIceServerObject(srvid).getACL(identifier)
acls = self._getIceServerObject(srvid).getACL(channelid)
ret = []
for x in acls:
if isinstance(x, list):
@ -348,3 +348,5 @@ class MumbleCtlIce_120(MumbleCtlIce_118):
newgroups.append( new_group );
self._getIceServerObject(srvid).setACL( acl.channelId, newacls, newgroups, acl.inherit );

2
pyweb/mumble/mctl.py

@ -78,7 +78,7 @@ class MumbleCtlBase ():
def getAllServers(self):
raise NotImplementedError( "mctl::getAllServers" );
def getACL(self, srvid, identifier):
def getACL(self, srvid, channelid):
raise NotImplementedError( "mctl::getACL" );
def setACL(self, srvid, acl):

3
pyweb/mumble/models.py

@ -323,7 +323,8 @@ class MumbleUser( models.Model ):
kwargs['instance'].unregister();
def unregister( self ):
# Unregister this player in Murmur via dbus.
if self.getAdmin():
self.setAdmin( False );
self.server.ctl.unregisterPlayer(self.server.srvid, self.mumbleid)

Loading…
Cancel
Save