* change hour to minute.
This commit is contained in:
@@ -2,4 +2,4 @@
|
||||
$config->user->create->requiredFields = 'account,realname,password,password1,password2';
|
||||
$config->user->edit->requiredFields = 'account,realname';
|
||||
$config->user->failTimes = 5;
|
||||
$config->user->lockHours = 0.5;
|
||||
$config->user->lockMinutes = 10;
|
||||
|
||||
@@ -384,7 +384,7 @@ class user extends control
|
||||
if($this->post->password) $password = $this->post->password;
|
||||
if($this->get->password) $password = $this->get->password;
|
||||
|
||||
if($this->user->checkLocked($account)) die(js::error(sprintf($this->lang->user->loginLocked, $this->config->user->lockHours)));
|
||||
if($this->user->checkLocked($account)) die(js::error(sprintf($this->lang->user->loginLocked, $this->config->user->lockMinutes)));
|
||||
|
||||
$user = $this->user->identify($account, $password);
|
||||
|
||||
@@ -447,7 +447,7 @@ class user extends control
|
||||
$remainTimes = $this->config->user->failTimes - $fails;
|
||||
if($remainTimes <= 0)
|
||||
{
|
||||
die(js::error(sprintf($this->lang->user->loginLocked, $this->config->user->lockHours)));
|
||||
die(js::error(sprintf($this->lang->user->loginLocked, $this->config->user->lockMinutes)));
|
||||
}
|
||||
else if($remainTimes <= 3)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ $lang->user->editProfile = 'Edit profile';
|
||||
$lang->user->errorDeny = "Sorry, you can't access the <b>%s</b> module's <b>%s</b> feature";
|
||||
$lang->user->loginFailed = "Login failed, please check your account and password.";
|
||||
$lang->user->lockWarning = "You only have %s times to try.";
|
||||
$lang->user->loginLocked = "You try the password too many times, please contact the administrator or try again after %s hours.";
|
||||
$lang->user->loginLocked = "You try the password too many times, please contact the administrator or try again after %s minutes.";
|
||||
|
||||
$lang->user->genderList->m = 'Male';
|
||||
$lang->user->genderList->f = 'Female';
|
||||
|
||||
@@ -47,7 +47,7 @@ $lang->user->editProfile = '修改信息';
|
||||
$lang->user->errorDeny = "抱歉,您无权访问『<b>%s</b>』模块的『<b>%s</b>』功能。请联系管理员获取权限。点击后退返回上页。";
|
||||
$lang->user->loginFailed = "登录失败,请检查您的用户名或密码是否填写正确。";
|
||||
$lang->user->lockWarning = "您还有%s次尝试机会。";
|
||||
$lang->user->loginLocked = "密码尝试次数太多,请联系管理员解锁,或%s小时后重试。";
|
||||
$lang->user->loginLocked = "密码尝试次数太多,请联系管理员解锁,或%s分钟后重试。";
|
||||
|
||||
$lang->user->genderList->m = '男';
|
||||
$lang->user->genderList->f = '女';
|
||||
|
||||
@@ -475,7 +475,7 @@ class userModel extends model
|
||||
}
|
||||
else
|
||||
{
|
||||
$locked = date('Y-m-d H:i:s', mktime() + $this->config->user->lockHours * 60 * 60);
|
||||
$locked = date('Y-m-d H:i:s', mktime() + $this->config->user->lockMinutes * 60);
|
||||
$failTimes = 0;
|
||||
}
|
||||
$this->dao->update(TABLE_USER)->set('fails')->eq($failTimes)->set('locked')->eq($locked)->where('account')->eq($account)->exec(false);
|
||||
|
||||
Reference in New Issue
Block a user