mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 20:52:42 +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
|
user (and the user whose password is being changed isn't that same
|
||||||
owner user), then <old password> needn't be correct.
|
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 \
|
if user.checkPassword(password) or \
|
||||||
(u._checkCapability('owner') and not u == user):
|
(u and u._checkCapability('owner') and not u == user):
|
||||||
user.setPassword(newpassword)
|
user.setPassword(newpassword)
|
||||||
ircdb.users.setUser(user)
|
ircdb.users.setUser(user)
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
|
Loading…
Reference in New Issue
Block a user