mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-25 19:44:13 +01:00
NickAuth & User: Fix nick auth + gpg auth when secure flag is on. Closes GH-825.
This commit is contained in:
parent
92c76044ec
commit
a440d6ddf4
@ -161,7 +161,12 @@ class NickAuth(callbacks.Plugin):
|
|||||||
if not user:
|
if not user:
|
||||||
user = ircdb.users.getUserFromNick(irc.network, theirnick)
|
user = ircdb.users.getUserFromNick(irc.network, theirnick)
|
||||||
if user:
|
if user:
|
||||||
user.addAuth(prefix)
|
try:
|
||||||
|
user.addAuth(prefix)
|
||||||
|
except ValueError:
|
||||||
|
irc.error(_('Your secure flag is true and your hostmask '
|
||||||
|
'doesn\'t match any of your known hostmasks.'),
|
||||||
|
Raise=True)
|
||||||
ircdb.users.setUser(user, flush=False)
|
ircdb.users.setUser(user, flush=False)
|
||||||
irc.reply(_('You are now authenticated as %s.') % user.name)
|
irc.reply(_('You are now authenticated as %s.') % user.name)
|
||||||
else:
|
else:
|
||||||
|
@ -522,7 +522,12 @@ class User(callbacks.Plugin):
|
|||||||
found = False
|
found = False
|
||||||
for (id, user) in ircdb.users.items():
|
for (id, user) in ircdb.users.items():
|
||||||
if keyid in [x[-len(keyid):] for x in user.gpgkeys]:
|
if keyid in [x[-len(keyid):] for x in user.gpgkeys]:
|
||||||
user.addAuth(msg.prefix)
|
try:
|
||||||
|
user.addAuth(msg.prefix)
|
||||||
|
except ValueError:
|
||||||
|
irc.error(_('Your secure flag is true and your '
|
||||||
|
'hostmask doesn\'t match any of your '
|
||||||
|
'known hostmasks.'), Raise=True)
|
||||||
ircdb.users.setUser(user, flush=False)
|
ircdb.users.setUser(user, flush=False)
|
||||||
irc.reply(_('You are now authenticated as %s.') %
|
irc.reply(_('You are now authenticated as %s.') %
|
||||||
user.name)
|
user.name)
|
||||||
|
Loading…
Reference in New Issue
Block a user