mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
Fixed bug #1062631.
This commit is contained in:
parent
907587e326
commit
3f93307518
@ -146,6 +146,7 @@ class User(callbacks.Privmsg):
|
|||||||
isOwner = caller.checkCapability('owner')
|
isOwner = caller.checkCapability('owner')
|
||||||
except KeyError:
|
except KeyError:
|
||||||
caller = None
|
caller = None
|
||||||
|
isOwner = False
|
||||||
if not conf.supybot.databases.users.allowUnregistration():
|
if not conf.supybot.databases.users.allowUnregistration():
|
||||||
if not caller or not isOwner:
|
if not caller or not isOwner:
|
||||||
self.log.warning('%s tried to unregister user %s.',
|
self.log.warning('%s tried to unregister user %s.',
|
||||||
@ -310,7 +311,9 @@ class User(callbacks.Privmsg):
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
user = ircdb.users.getUser(name)
|
user = ircdb.users.getUser(name)
|
||||||
irc.reply(repr(user.hostmasks))
|
hostmasks = map(repr, user.hostmasks)
|
||||||
|
hostmasks.sort()
|
||||||
|
irc.reply(utils.commaAndify(hostmasks))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.errorNoUser()
|
irc.errorNoUser()
|
||||||
else:
|
else:
|
||||||
|
@ -36,13 +36,16 @@ class UserTestCase(PluginTestCase, PluginDocumentation):
|
|||||||
plugins = ('User',)
|
plugins = ('User',)
|
||||||
prefix1 = 'somethingElse!user@host.tld'
|
prefix1 = 'somethingElse!user@host.tld'
|
||||||
prefix2 = 'EvensomethingElse!user@host.tld'
|
prefix2 = 'EvensomethingElse!user@host.tld'
|
||||||
## def testHostmasks(self):
|
def testHostmasks(self):
|
||||||
## self.assertNotError('hostmasks')
|
self.assertError('hostmasks')
|
||||||
## original = self.prefix
|
original = self.prefix
|
||||||
## self.prefix = self.prefix1
|
self.prefix = self.prefix1
|
||||||
## self.assertNotError('register foo bar')
|
self.assertNotError('register foo bar')
|
||||||
## self.prefix = original
|
self.prefix = original
|
||||||
## self.assertRegexp('hostmasks foo', 'only.*your.*own')
|
self.assertError('hostmasks foo')
|
||||||
|
self.assertNotError('addhostmask foo [hostmask] bar')
|
||||||
|
self.assertNotError('hostmasks foo')
|
||||||
|
self.assertNotRegexp('hostmasks foo', 'IrcSet')
|
||||||
|
|
||||||
def testRegisterUnregister(self):
|
def testRegisterUnregister(self):
|
||||||
self.prefix = self.prefix1
|
self.prefix = self.prefix1
|
||||||
@ -93,13 +96,14 @@ class UserTestCase(PluginTestCase, PluginDocumentation):
|
|||||||
self.assertNotError('setpassword foo bar baz')
|
self.assertNotError('setpassword foo bar baz')
|
||||||
self.assertEqual(ircdb.users.getUser(self.prefix).password, 'baz')
|
self.assertEqual(ircdb.users.getUser(self.prefix).password, 'baz')
|
||||||
self.assertNotError('setpassword --hashed foo baz biff')
|
self.assertNotError('setpassword --hashed foo baz biff')
|
||||||
self.assertNotEqual(ircdb.users.getUser(self.prefix).password, 'biff')
|
self.assertNotEqual(ircdb.users.getUser(self.prefix).password,
|
||||||
|
'biff')
|
||||||
finally:
|
finally:
|
||||||
conf.supybot.databases.users.hash.setValue(orig)
|
conf.supybot.databases.users.hash.setValue(orig)
|
||||||
|
|
||||||
def testStats(self):
|
def testStats(self):
|
||||||
self.assertNotError('user stats')
|
self.assertNotError('user stats')
|
||||||
self.assertNotError('load FunDB')
|
self.assertNotError('load Lart')
|
||||||
self.assertNotError('user stats')
|
self.assertNotError('user stats')
|
||||||
|
|
||||||
def testUserPluginAndUserList(self):
|
def testUserPluginAndUserList(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user