Commit a31b60eb authored by o2sword's avatar o2sword
Browse files

passwordPeriod为0时任何情况密码都不过期

parent a4fd3d7e
Showing with 3 additions and 3 deletions
+3 -3
......@@ -92,7 +92,7 @@ public class Person extends ConfigObject {
@FieldDescribe("注册初始密码,使用()调用脚本生成初始密码,默认为:" + DEFAULT_PASSWORD)
private String password;
@FieldDescribe("密码过期时间(天),0表示不过期(只对新用户有效),-1表示永不过期(对所有用户有效),默认值:0.")
@FieldDescribe("密码过期时间(天),0表示不过期,默认值:0.")
private Integer passwordPeriod;
@FieldDescribe("密码校验正则表达式,默认6位以上,包含数字和字母.")
......
......@@ -196,14 +196,14 @@ abstract class BaseAction extends StandardJaxrsAction {
private void passwordExpired(AbstractWoAuthentication wo) throws Exception {
wo.setPasswordExpired(false);
Integer passwordPeriod = Config.person().getPasswordPeriod();
if(passwordPeriod!=null && passwordPeriod <0){
if(passwordPeriod.intValue() == 0){
return;
}
if (null != wo.getPasswordExpiredTime()) {
if (wo.getPasswordExpiredTime().getTime() < (new Date()).getTime()) {
wo.setPasswordExpired(true);
}
} else if(passwordPeriod!=null && passwordPeriod > 0 && wo.getChangePasswordTime()!=null){
} else if(wo.getChangePasswordTime()!=null){
Date date = DateTools.addDay(wo.getChangePasswordTime(), passwordPeriod);
if (date.getTime() < (new Date()).getTime()) {
wo.setPasswordExpired(true);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment