Skip to content

Commit

Permalink
Login/Password properties in User (no longer in eeuser_props)
Browse files Browse the repository at this point in the history
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;
  • Loading branch information
sprevilla committed Feb 26, 2016
1 parent 4d75e95 commit 34f6f43
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
41 changes: 40 additions & 1 deletion modules/eeuser/src/main/java/org/jpos/ee/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ public class User extends Cloneable implements Serializable, SoftDelete {
private Date startDate;
private Date endDate;
private List<PasswordHistory> passwordhistory;
private boolean forcePasswordChange;
private Date lastLogin;
private Date passwordChanged;
private int loginAttempts;

public User() {
super();
Expand Down Expand Up @@ -104,7 +108,42 @@ public void setPasswordhistory (List<PasswordHistory> passwordhistory) {
}
public List<PasswordHistory> 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) {
Expand Down
5 changes: 5 additions & 0 deletions modules/eeuser/src/main/resources/org/jpos/ee/User.hbm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
</composite-element>
</list>

<property name="forcePasswordChange" type="yes_no" />
<property name="lastLogin" type="timestamp" />
<property name="passwordChanged" type="timestamp" />
<property name="loginAttempts" type="int" />

<map name="props" lazy="true" table="eeuser_props"
cascade="all-delete-orphan">
<key foreign-key="FKUserProps" />
Expand Down

0 comments on commit 34f6f43

Please sign in to comment.