Made register command guard against people with matching hostmasks trying to register again.

This commit is contained in:
Jeremy Fincher 2003-10-03 22:21:48 +00:00
parent 3d990599fe
commit d6f5bd3747

View File

@ -70,6 +70,12 @@ class UserCommands(callbacks.Privmsg):
if ircutils.isUserHostmask(name):
irc.error(msg, 'Hostmasks aren\'t valid usernames.')
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()
user.name = name
user.setPassword(password)