Browse Source

fix formats of the results of getRegistration().

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
3dd41df5a5
  1. 12
      pyweb/mumble/MumbleCtlDbus.py
  2. 16
      pyweb/mumble/MumbleCtlIce.py

12
pyweb/mumble/MumbleCtlDbus.py

@ -198,11 +198,13 @@ class MumbleCtlDbus_118(MumbleCtlBase):
self.meta.setSuperUserPassword(dbus.Int32(srvid), value) self.meta.setSuperUserPassword(dbus.Int32(srvid), value)
def getRegistration(self, srvid, mumbleid): def getRegistration(self, srvid, mumbleid):
user = MumbleCtlDbus_118.convertDbusTypeToNative(self._getDbusServerObject(srvid).getRegistration(dbus.Int32(mumbleid)))
return {
'name': user[1],
'email': user[2],
};
user = self._getDbusServerObject(srvid).getRegistration(dbus.Int32(mumbleid))
return ObjectInfo(
userid = mumbleid,
name = unicode(user[1]),
email = unicode(user[2]),
pw = '',
);
def setRegistration(self, srvid, mumbleid, name, email, password): def setRegistration(self, srvid, mumbleid, name, email, password):
return MumbleCtlDbus_118.convertDbusTypeToNative( return MumbleCtlDbus_118.convertDbusTypeToNative(

16
pyweb/mumble/MumbleCtlIce.py

@ -359,16 +359,12 @@ class MumbleCtlIce_120(MumbleCtlIce_118):
def getRegistration(self, srvid, mumbleid): def getRegistration(self, srvid, mumbleid):
from Murmur import UserInfo from Murmur import UserInfo
reg = self._getIceServerObject( srvid ).getRegistration( mumbleid ) reg = self._getIceServerObject( srvid ).getRegistration( mumbleid )
user = {};
if UserInfo.UserName in reg:
user['name'] = reg[UserInfo.UserName];
if UserInfo.UserEmail in reg:
user['email'] = reg[UserInfo.UserEmail];
if UserInfo.UserComment in reg:
user['comment'] = reg[UserInfo.UserComment];
if UserInfo.UserHash in reg:
user['hash'] = reg[UserInfo.UserHash];
return ObjectInfo( **user );
user = ObjectInfo( userid=mumbleid, name="", email="", comment="", hash="", pw="" );
if UserInfo.UserName in reg: user.name = reg[UserInfo.UserName];
if UserInfo.UserEmail in reg: user.email = reg[UserInfo.UserEmail];
if UserInfo.UserComment in reg: user.comment = reg[UserInfo.UserComment];
if UserInfo.UserHash in reg: user.hash = reg[UserInfo.UserHash];
return user;
@protectDjangoErrPage @protectDjangoErrPage
def setRegistration(self, srvid, mumbleid, name, email, password): def setRegistration(self, srvid, mumbleid, name, email, password):

Loading…
Cancel
Save