From d6f5bd37475e88d02e96b4d787c2a0807bd493bd Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Fri, 3 Oct 2003 22:21:48 +0000 Subject: [PATCH] Made register command guard against people with matching hostmasks trying to register again. --- src/UserCommands.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/UserCommands.py b/src/UserCommands.py index e1f555f31..449837ae1 100755 --- a/src/UserCommands.py +++ b/src/UserCommands.py @@ -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)