Fixes
This commit is contained in:
parent
8240e3039d
commit
651613b644
5 changed files with 86 additions and 88 deletions
|
|
@ -19,6 +19,11 @@ from paramecio2.libraries.formsutils import check_csrf
|
|||
|
||||
#_=pgettext(__file__)
|
||||
|
||||
login_tries=5
|
||||
|
||||
if hasattr(config, 'login_tries'):
|
||||
login_tries=config.login_tries
|
||||
|
||||
gtext=PGetText(__file__)
|
||||
|
||||
_=gtext.gettext
|
||||
|
|
@ -211,7 +216,7 @@ def login():
|
|||
|
||||
arr_user=user_admin.set_conditions('WHERE username=%s', [username]).select_a_row_where()
|
||||
|
||||
if arr_user:
|
||||
if arr_user and not check_login_tries():
|
||||
|
||||
if user_admin.fields['password'].verify(password, arr_user['password']):
|
||||
|
||||
|
|
@ -450,7 +455,7 @@ def check_login_tries():
|
|||
|
||||
if arr_try:
|
||||
|
||||
if arr_try['num_tries']<5:
|
||||
if arr_try['num_tries']<login_tries:
|
||||
|
||||
logintries.query('update logintries set num_tries=num_tries+1, last_login=%s WHERE ip=%s', [date_now, ip])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue