[ChangePassword] Added columns/fields to ad_client and ad_user. Added some logic to login in client and server
authorJonathan Bueno <jonathan.bueno@openbravo.com>
Thu, 19 Nov 2015 09:33:12 +0100
changeset 28637 cbb05eb7f006
parent 27853 cb4dec610d4b
child 28638 0d4f091d1e54
[ChangePassword] Added columns/fields to ad_client and ad_user. Added some logic to login in client and server
src-db/database/model/tables/AD_CLIENT.xml
src-db/database/model/tables/AD_USER.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_FIELD.xml
src/org/openbravo/authentication/basic/DefaultAuthenticationManager.java
src/org/openbravo/base/secureApp/LoginUtils.java
--- a/src-db/database/model/tables/AD_CLIENT.xml	Wed Nov 11 12:22:58 2015 +0100
+++ b/src-db/database/model/tables/AD_CLIENT.xml	Thu Nov 19 09:33:12 2015 +0100
@@ -193,6 +193,10 @@
         <default><![CDATA[N]]></default>
         <onCreateDefault/>
       </column>
+      <column name="VALIDDAYS" primaryKey="false" required="false" type="DECIMAL" size="10,0" autoIncrement="false">
+        <default><![CDATA[0]]></default>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_CLIENT" name="AD_CLIENT_AD_CLIENT">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/AD_USER.xml	Wed Nov 11 12:22:58 2015 +0100
+++ b/src-db/database/model/tables/AD_USER.xml	Thu Nov 19 09:33:12 2015 +0100
@@ -157,6 +157,10 @@
         <default><![CDATA[N]]></default>
         <onCreateDefault><![CDATA['N']]></onCreateDefault>
       </column>
+      <column name="UPDATEPASSWORDDATE" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
+        <default><![CDATA['1970-01-01 00:00:00'::timestamp without time zone]]></default>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_ORG" name="AD_USER_AD_ORGTRX">
         <reference local="AD_ORGTRX_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Wed Nov 11 12:22:58 2015 +0100
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Thu Nov 19 09:33:12 2015 +0100
@@ -238493,6 +238493,39 @@
 <!--3D20749B2D1642F591849DA6CD6EB654-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--3D20749B2D1642F591849DA6CD6EB654--></AD_COLUMN>
 
+<!--3D4F9C2BB8BB4066871C7E735264E1E9--><AD_COLUMN>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <AD_COLUMN_ID><![CDATA[3D4F9C2BB8BB4066871C7E735264E1E9]]></AD_COLUMN_ID>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <NAME><![CDATA[Update Password Date]]></NAME>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <COLUMNNAME><![CDATA[Updatepassworddate]]></COLUMNNAME>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <AD_TABLE_ID><![CDATA[114]]></AD_TABLE_ID>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <AD_REFERENCE_ID><![CDATA[15]]></AD_REFERENCE_ID>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <FIELDLENGTH><![CDATA[19]]></FIELDLENGTH>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <DEFAULTVALUE><![CDATA[1970-01-01 00:00:00]]></DEFAULTVALUE>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <SEQNO><![CDATA[131]]></SEQNO>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <POSITION><![CDATA[42]]></POSITION>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--3D4F9C2BB8BB4066871C7E735264E1E9--></AD_COLUMN>
+
 <!--3D5960AA56AA42E9B213091E314A51BE--><AD_COLUMN>
 <!--3D5960AA56AA42E9B213091E314A51BE-->  <AD_COLUMN_ID><![CDATA[3D5960AA56AA42E9B213091E314A51BE]]></AD_COLUMN_ID>
 <!--3D5960AA56AA42E9B213091E314A51BE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -293028,6 +293061,39 @@
 <!--88BFF23CE5664105A1EA10AFB8B50FA9-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--88BFF23CE5664105A1EA10AFB8B50FA9--></AD_COLUMN>
 
+<!--88DB9DC7F36A489BAF9352B0EE370269--><AD_COLUMN>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <AD_COLUMN_ID><![CDATA[88DB9DC7F36A489BAF9352B0EE370269]]></AD_COLUMN_ID>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <NAME><![CDATA[Validdays]]></NAME>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <COLUMNNAME><![CDATA[Validdays]]></COLUMNNAME>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <AD_TABLE_ID><![CDATA[112]]></AD_TABLE_ID>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <AD_REFERENCE_ID><![CDATA[11]]></AD_REFERENCE_ID>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <FIELDLENGTH><![CDATA[12]]></FIELDLENGTH>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <DEFAULTVALUE><![CDATA[0]]></DEFAULTVALUE>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <SEQNO><![CDATA[321]]></SEQNO>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <POSITION><![CDATA[50]]></POSITION>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--88DB9DC7F36A489BAF9352B0EE370269-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--88DB9DC7F36A489BAF9352B0EE370269--></AD_COLUMN>
+
 <!--88FA1C15FABD493EAF04D590F6DA945F--><AD_COLUMN>
 <!--88FA1C15FABD493EAF04D590F6DA945F-->  <AD_COLUMN_ID><![CDATA[88FA1C15FABD493EAF04D590F6DA945F]]></AD_COLUMN_ID>
 <!--88FA1C15FABD493EAF04D590F6DA945F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Wed Nov 11 12:22:58 2015 +0100
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Thu Nov 19 09:33:12 2015 +0100
@@ -183814,6 +183814,32 @@
 <!--10D622C19C1C407A99F66025D7470B76-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--10D622C19C1C407A99F66025D7470B76--></AD_FIELD>
 
+<!--10DB133E8FDE4DD98E298833940D8DE7--><AD_FIELD>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <AD_FIELD_ID><![CDATA[10DB133E8FDE4DD98E298833940D8DE7]]></AD_FIELD_ID>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <NAME><![CDATA[Valid Days]]></NAME>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <AD_TAB_ID><![CDATA[145]]></AD_TAB_ID>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <AD_COLUMN_ID><![CDATA[88DB9DC7F36A489BAF9352B0EE370269]]></AD_COLUMN_ID>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <DISPLAYLENGTH><![CDATA[12]]></DISPLAYLENGTH>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <SEQNO><![CDATA[430]]></SEQNO>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--10DB133E8FDE4DD98E298833940D8DE7-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--10DB133E8FDE4DD98E298833940D8DE7--></AD_FIELD>
+
 <!--10EE6FF9FCFD4194A110F11C7DB8115A--><AD_FIELD>
 <!--10EE6FF9FCFD4194A110F11C7DB8115A-->  <AD_FIELD_ID><![CDATA[10EE6FF9FCFD4194A110F11C7DB8115A]]></AD_FIELD_ID>
 <!--10EE6FF9FCFD4194A110F11C7DB8115A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -204689,6 +204715,32 @@
 <!--44D815496B5B4EDF97B562977ED58556-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--44D815496B5B4EDF97B562977ED58556--></AD_FIELD>
 
+<!--44FA9B5980474579845B7A0175DE24C7--><AD_FIELD>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <AD_FIELD_ID><![CDATA[44FA9B5980474579845B7A0175DE24C7]]></AD_FIELD_ID>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <NAME><![CDATA[Update Password Date]]></NAME>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <AD_TAB_ID><![CDATA[118]]></AD_TAB_ID>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <AD_COLUMN_ID><![CDATA[3D4F9C2BB8BB4066871C7E735264E1E9]]></AD_COLUMN_ID>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <DISPLAYLENGTH><![CDATA[19]]></DISPLAYLENGTH>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <SEQNO><![CDATA[300]]></SEQNO>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--44FA9B5980474579845B7A0175DE24C7-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--44FA9B5980474579845B7A0175DE24C7--></AD_FIELD>
+
 <!--44FB2A13EF4E455AB7380E9880B23222--><AD_FIELD>
 <!--44FB2A13EF4E455AB7380E9880B23222-->  <AD_FIELD_ID><![CDATA[44FB2A13EF4E455AB7380E9880B23222]]></AD_FIELD_ID>
 <!--44FB2A13EF4E455AB7380E9880B23222-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src/org/openbravo/authentication/basic/DefaultAuthenticationManager.java	Wed Nov 11 12:22:58 2015 +0100
+++ b/src/org/openbravo/authentication/basic/DefaultAuthenticationManager.java	Thu Nov 19 09:33:12 2015 +0100
@@ -94,6 +94,19 @@
       throw new AuthenticationException("IDENTIFICATION_FAILURE_TITLE", errorMsg);
     }
 
+    // Check if password valid date is reached
+    String strUPD = LoginUtils.getUpdatePasswordDate(conn, strUser, strPass);
+
+    // Needs to check if password is reached too
+    if (strUPD == null) {
+      log4j.debug("Failed user/password. Username: " + strUser + " - Session ID:" + sessionId);
+      OBError errorMsg = new OBError();
+      errorMsg.setType("Error");
+      errorMsg.setTitle("IDENTIFICATION_FAILURE_TITLE");
+      errorMsg.setMessage("IDENTIFICATION_FAILURE_MSG");
+      throw new AuthenticationException("IDENTIFICATION_FAILURE_TITLE", errorMsg);
+    }
+
     // Using the Servlet API instead of vars.setSessionValue to avoid breaking code
     // vars.setSessionValue always transform the key to upper-case
     request.getSession(true).setAttribute("#Authenticated_user", userId);
--- a/src/org/openbravo/base/secureApp/LoginUtils.java	Wed Nov 11 12:22:58 2015 +0100
+++ b/src/org/openbravo/base/secureApp/LoginUtils.java	Thu Nov 19 09:33:12 2015 +0100
@@ -89,6 +89,26 @@
     }
   }
 
+  public static String getUpdatePasswordDate(ConnectionProvider connectionProvider, String login,
+      String unHashedPassword) {
+    try {
+      // Get the Update password date
+      UserLock lockSettings = new UserLock(login);
+      lockSettings.delayResponse();
+      if (lockSettings.isLockedUser()) {
+        return null;
+      }
+      final String hashedPassword = FormatUtilities.sha1Base64(unHashedPassword);
+      String valid = SeguridadData.validityDatePassword(connectionProvider, login, hashedPassword);
+      if (valid == null) {
+        log4j.error("Valid password date is reached");
+      }
+      return valid;
+    } catch (final Exception e) {
+      throw new OBException(e);
+    }
+  }
+
   /**
    * Similar to {@link LoginUtils#getValidUserId(ConnectionProvider, String, String)} but not
    * blocking user accounts.