SHA256
1
0
forked from pool/trytond
trytond/trytond_server.diff

34 lines
1.2 KiB
Diff

diff -crB a/trytond/res/user.py b/trytond/res/user.py
*** a/trytond/res/user.py 2016-03-08 13:56:41.921761645 +0000
- --- b/trytond/res/user.py 2016-03-08 13:57:05.931762976 +0000
***************
*** 464,476 ****
Return user id if password matches
'''
LoginAttempt = Pool().get('res.user.login.attempt')
- - time.sleep(2 ** LoginAttempt.count(login) - 1)
user_id, password_hash = cls._get_login(login)
if user_id:
if cls.check_password(password, password_hash):
- - LoginAttempt.remove(login)
return user_id
! LoginAttempt.add(login)
return 0
@staticmethod
- --- 464,477 ----
Return user id if password matches
'''
LoginAttempt = Pool().get('res.user.login.attempt')
user_id, password_hash = cls._get_login(login)
if user_id:
if cls.check_password(password, password_hash):
return user_id
!
! #Timeout for invalid login attempts
! #TODO : use failed_login_timeout from configuration param.
! time.sleep(3)
return 0
@staticmethod