GUACAMOLE-36: Add password reset date to schema.

This commit is contained in:
Michael Jumper
2016-08-22 12:01:58 -07:00
parent 66f00adab0
commit a207411241
7 changed files with 96 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ package org.apache.guacamole.auth.jdbc.user;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import org.apache.guacamole.auth.jdbc.base.ObjectModel;
/**
@@ -41,6 +42,11 @@ public class UserModel extends ObjectModel {
*/
private byte[] passwordSalt;
/**
* The time this user's password was last reset.
*/
private Timestamp passwordDate;
/**
* Whether the user account is disabled. Disabled accounts exist and can
* be modified, but cannot be used.
@@ -143,6 +149,30 @@ public class UserModel extends ObjectModel {
this.passwordSalt = passwordSalt;
}
/**
* Returns the date that this user's password was last set/reset. This
* value is required to be manually updated whenever the user's password is
* changed; it will not be automatically updated by the database.
*
* @return
* The date that this user's password was last set/reset.
*/
public Timestamp getPasswordDate() {
return passwordDate;
}
/**
* Sets the date that this user's password was last set/reset. This
* value is required to be manually updated whenever the user's password is
* changed; it will not be automatically updated by the database.
*
* @param passwordDate
* The date that this user's password was last set/reset.
*/
public void setPasswordDate(Timestamp passwordDate) {
this.passwordDate = passwordDate;
}
/**
* Returns whether the user has been disabled. Disabled users are not
* allowed to login. Although their account data exists, all login attempts