mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-12 05:02:32 +01:00
User: Simplify owner-checking logic, and fix crash when @hostmask remove is called by an unregistered user.
This commit is contained in:
parent
8cfb841f3b
commit
bd39debb48
@ -341,12 +341,9 @@ class User(callbacks.Plugin):
|
|||||||
pass
|
pass
|
||||||
if not user.checkPassword(password) and \
|
if not user.checkPassword(password) and \
|
||||||
not user.checkHostmask(msg.prefix):
|
not user.checkHostmask(msg.prefix):
|
||||||
try:
|
if ircdb.checkCapability(msg.prefix, 'owner'):
|
||||||
u = ircdb.users.getUser(msg.prefix)
|
u = ircdb.users.getUser(msg.prefix)
|
||||||
except KeyError:
|
else:
|
||||||
irc.error(conf.supybot.replies.incorrectAuthentication(),
|
|
||||||
Raise=True)
|
|
||||||
if not u._checkCapability('owner'):
|
|
||||||
irc.error(conf.supybot.replies.incorrectAuthentication(),
|
irc.error(conf.supybot.replies.incorrectAuthentication(),
|
||||||
Raise=True)
|
Raise=True)
|
||||||
try:
|
try:
|
||||||
@ -382,8 +379,7 @@ class User(callbacks.Plugin):
|
|||||||
hostmask = msg.prefix
|
hostmask = msg.prefix
|
||||||
if not user.checkPassword(password) and \
|
if not user.checkPassword(password) and \
|
||||||
not user.checkHostmask(msg.prefix):
|
not user.checkHostmask(msg.prefix):
|
||||||
u = ircdb.users.getUser(msg.prefix)
|
if not ircdb.checkCapability(msg.prefix, 'owner'):
|
||||||
if not u._checkCapability('owner'):
|
|
||||||
irc.error(conf.supybot.replies.incorrectAuthentication())
|
irc.error(conf.supybot.replies.incorrectAuthentication())
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user