From 34f6f43a91699b93f73b37401eba306e7922b3a6 Mon Sep 17 00:00:00 2001 From: Santiago Revilla Date: Fri, 26 Feb 2016 17:10:41 -0300 Subject: [PATCH] Login/Password properties in User (no longer in eeuser_props) The following update to eeuser table is required: ALTER TABLE eeuser ADD COLUMN forcePasswordChange character(1) default 'N', ADD COLUMN lastLogin timestamp without time zone, ADD COLUMN passwordChanged timestamp without time zone, ADD COLUMN loginAttempts integer default 0; --- .../src/main/java/org/jpos/ee/User.java | 41 ++++++++++++++++++- .../main/resources/org/jpos/ee/User.hbm.xml | 5 +++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/modules/eeuser/src/main/java/org/jpos/ee/User.java b/modules/eeuser/src/main/java/org/jpos/ee/User.java index 43d7e205b5..5a39508fef 100644 --- a/modules/eeuser/src/main/java/org/jpos/ee/User.java +++ b/modules/eeuser/src/main/java/org/jpos/ee/User.java @@ -39,6 +39,10 @@ public class User extends Cloneable implements Serializable, SoftDelete { private Date startDate; private Date endDate; private List passwordhistory; + private boolean forcePasswordChange; + private Date lastLogin; + private Date passwordChanged; + private int loginAttempts; public User() { super(); @@ -104,7 +108,42 @@ public void setPasswordhistory (List passwordhistory) { } public List getPasswordhistory () { return passwordhistory; - } + } + public boolean isForcePasswordChange() { + return forcePasswordChange; + } + + public void setForcePasswordChange(boolean forcePasswordChange) { + this.forcePasswordChange = forcePasswordChange; + } + + public Date getLastLogin() { + return lastLogin; + } + + public void setLastLogin(Date lastLogin) { + this.lastLogin = lastLogin; + } + + public Date getPasswordChanged() { + return passwordChanged; + } + + public void setPasswordChanged(Date passwordChanged) { + this.passwordChanged = passwordChanged; + } + + public int getLoginAttempts() { + return loginAttempts; + } + + public void setLoginAttempts(int loginAttempts) { + this.loginAttempts = loginAttempts; + } + + public void incLoginAttempts () { + this.loginAttempts++; + } public boolean hasPermission (String permName) { if (permName != null) { for (Role r : roles) { diff --git a/modules/eeuser/src/main/resources/org/jpos/ee/User.hbm.xml b/modules/eeuser/src/main/resources/org/jpos/ee/User.hbm.xml index d3706ebbac..a08e4378a5 100644 --- a/modules/eeuser/src/main/resources/org/jpos/ee/User.hbm.xml +++ b/modules/eeuser/src/main/resources/org/jpos/ee/User.hbm.xml @@ -48,6 +48,11 @@ + + + + +