mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-18 22:51:01 +01:00
Made register command guard against people with matching hostmasks trying to register again.
This commit is contained in:
parent
3d990599fe
commit
d6f5bd3747
@ -70,6 +70,12 @@ class UserCommands(callbacks.Privmsg):
|
|||||||
if ircutils.isUserHostmask(name):
|
if ircutils.isUserHostmask(name):
|
||||||
irc.error(msg, 'Hostmasks aren\'t valid usernames.')
|
irc.error(msg, 'Hostmasks aren\'t valid usernames.')
|
||||||
return
|
return
|
||||||
|
try:
|
||||||
|
u = ircdb.users.getUser(msg.prefix)
|
||||||
|
irc.error(msg,'Your hostmask is already registered to %s' % u.name)
|
||||||
|
return
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
(id, user) = ircdb.users.newUser()
|
(id, user) = ircdb.users.newUser()
|
||||||
user.name = name
|
user.name = name
|
||||||
user.setPassword(password)
|
user.setPassword(password)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user