mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
Minor improvements (#856)
This commit is contained in:
parent
666c42f012
commit
6e1d7c3538
1 changed files with 9 additions and 9 deletions
18
login.php
18
login.php
|
@ -88,7 +88,7 @@ if (isset($_POST['login'])) {
|
|||
if ($user->login($_POST, $mod_admin_login)) {
|
||||
$redirect_url = (defined('FIRST_LOGON')) ? $bb_cfg['first_logon_redirect_url'] : $redirect_url;
|
||||
// Обнуление при введении правильно комбинации логин/пароль
|
||||
CACHE('bb_login_err')->set('l_err_' . USER_IP, 0, 3600);
|
||||
CACHE('bb_login_err')->rm('l_err_' . USER_IP);
|
||||
|
||||
if ($redirect_url == '/' . LOGIN_URL || $redirect_url == LOGIN_URL) {
|
||||
$redirect_url = 'index.php';
|
||||
|
@ -97,16 +97,16 @@ if (isset($_POST['login'])) {
|
|||
}
|
||||
|
||||
$login_errors[] = $lang['ERROR_LOGIN'];
|
||||
}
|
||||
|
||||
if (!$mod_admin_login) {
|
||||
$login_err = CACHE('bb_login_err')->get('l_err_' . USER_IP);
|
||||
if ($login_err > $bb_cfg['invalid_logins']) {
|
||||
$need_captcha = true;
|
||||
}
|
||||
CACHE('bb_login_err')->set('l_err_' . USER_IP, ($login_err + 1), 3600);
|
||||
} else {
|
||||
$need_captcha = false;
|
||||
if (!$mod_admin_login) {
|
||||
$login_err = CACHE('bb_login_err')->get('l_err_' . USER_IP);
|
||||
if ($login_err > $bb_cfg['invalid_logins']) {
|
||||
$need_captcha = true;
|
||||
}
|
||||
CACHE('bb_login_err')->set('l_err_' . USER_IP, ($login_err + 1), 3600);
|
||||
} else {
|
||||
$need_captcha = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue