From fcabc226d9580cbff6b09ca98c24f719d7aa7cad Mon Sep 17 00:00:00 2001 From: zhujinyong Date: Thu, 27 Sep 2012 03:20:25 +0000 Subject: [PATCH] * change hour to minute. --- module/user/config.php | 2 +- module/user/control.php | 4 ++-- module/user/lang/en.php | 2 +- module/user/lang/zh-cn.php | 2 +- module/user/model.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module/user/config.php b/module/user/config.php index f2c9b2df56..641adfcc36 100644 --- a/module/user/config.php +++ b/module/user/config.php @@ -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; diff --git a/module/user/control.php b/module/user/control.php index f7fb9eb483..a02cdaaf55 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -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) { diff --git a/module/user/lang/en.php b/module/user/lang/en.php index 79e3f0ca0b..82e9d956f2 100644 --- a/module/user/lang/en.php +++ b/module/user/lang/en.php @@ -47,7 +47,7 @@ $lang->user->editProfile = 'Edit profile'; $lang->user->errorDeny = "Sorry, you can't access the %s module's %s 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'; diff --git a/module/user/lang/zh-cn.php b/module/user/lang/zh-cn.php index c7d3ce4ed1..7f45a98033 100644 --- a/module/user/lang/zh-cn.php +++ b/module/user/lang/zh-cn.php @@ -47,7 +47,7 @@ $lang->user->editProfile = '修改信息'; $lang->user->errorDeny = "抱歉,您无权访问『%s』模块的『%s』功能。请联系管理员获取权限。点击后退返回上页。"; $lang->user->loginFailed = "登录失败,请检查您的用户名或密码是否填写正确。"; $lang->user->lockWarning = "您还有%s次尝试机会。"; -$lang->user->loginLocked = "密码尝试次数太多,请联系管理员解锁,或%s小时后重试。"; +$lang->user->loginLocked = "密码尝试次数太多,请联系管理员解锁,或%s分钟后重试。"; $lang->user->genderList->m = '男'; $lang->user->genderList->f = '女'; diff --git a/module/user/model.php b/module/user/model.php index 56aaae4601..14631e98a5 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -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);