3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

login: fix login for legacy accounts (#590)

This commit is contained in:
James Lu 2018-05-26 01:27:12 -07:00
parent 2df3dc280c
commit 108d4b86d9

View File

@ -60,12 +60,13 @@ def verify_hash(password, passhash):
return pwd_context.verify(password, passhash)
return False # No password given!
def _irc_try_login(irc, source, username):
def _irc_try_login(irc, source, username, skip_checks=False):
"""Internal function to process logins via IRC."""
if irc.is_internal_client(source):
irc.error("Cannot use 'identify' via a command proxy.")
return
if not skip_checks:
logindata = _get_account(username)
network_filter = logindata.get('networks')
@ -113,7 +114,7 @@ def identify(irc, source, args):
# Process legacy logins (login:user).
if username.lower() == conf.conf['login'].get('user', '').lower() and password == conf.conf['login'].get('password'):
realuser = conf.conf['login']['user']
_irc_try_login(irc, source, realuser)
_irc_try_login(irc, source, realuser, skip_checks=True)
return
# Username not found or password incorrect.