Fixed to handle secure flag properly.

This commit is contained in:
Jeremy Fincher 2003-10-09 05:09:05 +00:00
parent 7b28caba1b
commit aee2b1555b

View File

@ -288,9 +288,13 @@ class UserCommands(callbacks.Privmsg):
irc.error(msg, conf.replyNoUser)
return
if user.checkPassword(password):
user.setAuth(msg.prefix)
ircdb.users.setUser(id, user)
irc.reply(msg, conf.replySuccess)
try:
user.setAuth(msg.prefix)
ircdb.users.setUser(id, user)
irc.reply(msg, conf.replySuccess)
except ValueError:
irc.error(msg, 'Your secure flag is true and your hostmask '
'doesn\'t match any of your known hostmasks.')
else:
irc.error(msg, conf.replyIncorrectAuth)