mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 03:33:11 +01:00
User: Prevent set.password from failing with an unknown hostmask
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
This commit is contained in:
parent
c2a783c0b0
commit
187620dddc
@ -176,9 +176,12 @@ class User(callbacks.Plugin):
|
||||
user (and the user whose password is being changed isn't that same
|
||||
owner user), then <old password> needn't be correct.
|
||||
"""
|
||||
u = ircdb.users.getUser(msg.prefix)
|
||||
try:
|
||||
u = ircdb.users.getUser(msg.prefix)
|
||||
except KeyError:
|
||||
u = None
|
||||
if user.checkPassword(password) or \
|
||||
(u._checkCapability('owner') and not u == user):
|
||||
(u and u._checkCapability('owner') and not u == user):
|
||||
user.setPassword(newpassword)
|
||||
ircdb.users.setUser(user)
|
||||
irc.replySuccess()
|
||||
|
Loading…
Reference in New Issue
Block a user