[ChangePassword] Merge ChangePassword development
authorGuillermo Gil <guillermo.gil@openbravo.com>
Fri, 26 Feb 2016 08:20:01 +0100
changeset 28683 f2e7ebc3ea7f
parent 28636 85f5f008873a (current diff)
parent 28682 bd8ecbb28bd0 (diff)
child 28684 fd863146a4f4
[ChangePassword] Merge ChangePassword development
--- a/src-db/database/model/tables/AD_CLIENT.xml	Wed Feb 24 18:05:08 2016 +0530
+++ b/src-db/database/model/tables/AD_CLIENT.xml	Fri Feb 26 08:20:01 2016 +0100
@@ -193,6 +193,10 @@
         <default><![CDATA[N]]></default>
         <onCreateDefault/>
       </column>
+      <column name="DAYSTOPASSWORDEXPIRATION" 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 Feb 24 18:05:08 2016 +0530
+++ b/src-db/database/model/tables/AD_USER.xml	Fri Feb 26 08:20:01 2016 +0100
@@ -157,6 +157,10 @@
         <default><![CDATA[N]]></default>
         <onCreateDefault><![CDATA['N']]></onCreateDefault>
       </column>
+      <column name="LASTPASSWORDUPDATE" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
+        <default><![CDATA[SYSDATE]]></default>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_ORG" name="AD_USER_AD_ORGTRX">
         <reference local="AD_ORGTRX_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/triggers/AD_USER_EXPIRATIONPASS_TRG.xml	Fri Feb 26 08:20:01 2016 +0100
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+  <database name="TRIGGER AD_USER_EXPIRATIONPASS_TRG">
+    <trigger name="AD_USER_EXPIRATIONPASS_TRG" table="AD_USER" fires="before" insert="false" update="true" delete="false" foreach="row">
+      <body><![CDATA[
+      
+/*************************************************************************
+* The contents of this file are subject to the Openbravo  Public  License
+* Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+* Version 1.1  with a permitted attribution clause; you may not  use this
+* file except in compliance with the License. You  may  obtain  a copy of
+* the License at http://www.openbravo.com/legal/license.html
+* Software distributed under the License  is  distributed  on  an "AS IS"
+* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+* License for the specific  language  governing  rights  and  limitations
+* under the License.
+* The Original Code is Openbravo ERP.
+* The Initial Developer of the Original Code is Openbravo SLU
+* All portions are Copyright (C) 2015 Openbravo SLU
+* All Rights Reserved.
+* Contributor(s):  ______________________________________.
+************************************************************************/
+ 
+ BEGIN
+ 
+   IF AD_isTriggerEnabled()='N' THEN RETURN;
+   END IF;
+
+   IF (:OLD.password<>:NEW.password OR :OLD.password IS NULL AND :NEW.password IS NOT NULL) THEN
+     
+     :NEW.lastpasswordupdate := now();
+     
+   END IF;
+ 
+   END AD_USER_EXPIRATIONPASS_TRG
+]]></body>
+    </trigger>
+  </database>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Wed Feb 24 18:05:08 2016 +0530
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Fri Feb 26 08:20:01 2016 +0100
@@ -238462,6 +238462,45 @@
 <!--06D3A446DE4747D085367B10876B6B9E-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
 <!--06D3A446DE4747D085367B10876B6B9E--></AD_COLUMN>
 
+<!--06EF3D56611445C4BAC1A2ACE23AD94A--><AD_COLUMN>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <AD_COLUMN_ID><![CDATA[06EF3D56611445C4BAC1A2ACE23AD94A]]></AD_COLUMN_ID>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <NAME><![CDATA[DaysToPasswordExpiration]]></NAME>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <DESCRIPTION><![CDATA[Define the days that user password must be valid from previous password change]]></DESCRIPTION>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <HELP><![CDATA[Define the days that user password must be valid from previous password change, if value is set to 0 no update will be required, for value greater than 0, password must be updated when the last password update date of the user plus the days defined here achieves. It will affect to all users depending the client.]]></HELP>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <COLUMNNAME><![CDATA[DaysToPasswordExpiration]]></COLUMNNAME>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <AD_TABLE_ID><![CDATA[112]]></AD_TABLE_ID>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <AD_REFERENCE_ID><![CDATA[11]]></AD_REFERENCE_ID>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <FIELDLENGTH><![CDATA[12]]></FIELDLENGTH>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <DEFAULTVALUE><![CDATA[0]]></DEFAULTVALUE>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <SEQNO><![CDATA[321]]></SEQNO>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <VALUEMIN><![CDATA[0]]></VALUEMIN>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <AD_ELEMENT_ID><![CDATA[02F1D370B8B34FB79D151811C705B200]]></AD_ELEMENT_ID>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <POSITION><![CDATA[51]]></POSITION>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
+<!--06EF3D56611445C4BAC1A2ACE23AD94A--></AD_COLUMN>
+
 <!--070CB5DDE659436984E4DEB06100AC41--><AD_COLUMN>
 <!--070CB5DDE659436984E4DEB06100AC41-->  <AD_COLUMN_ID><![CDATA[070CB5DDE659436984E4DEB06100AC41]]></AD_COLUMN_ID>
 <!--070CB5DDE659436984E4DEB06100AC41-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -245726,6 +245765,44 @@
 <!--1F9C02B7A18448368C4E137F971747BF-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
 <!--1F9C02B7A18448368C4E137F971747BF--></AD_COLUMN>
 
+<!--1FEFAB2F6215496FA9026D5FF7706F6F--><AD_COLUMN>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <AD_COLUMN_ID><![CDATA[1FEFAB2F6215496FA9026D5FF7706F6F]]></AD_COLUMN_ID>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <NAME><![CDATA[LastPasswordUpdate]]></NAME>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <DESCRIPTION><![CDATA[Latest date of user password change]]></DESCRIPTION>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <HELP><![CDATA[Latest date of user password change]]></HELP>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <COLUMNNAME><![CDATA[LastPasswordUpdate]]></COLUMNNAME>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <AD_TABLE_ID><![CDATA[114]]></AD_TABLE_ID>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <AD_REFERENCE_ID><![CDATA[15]]></AD_REFERENCE_ID>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <FIELDLENGTH><![CDATA[19]]></FIELDLENGTH>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <DEFAULTVALUE><![CDATA[@#Date@]]></DEFAULTVALUE>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <SEQNO><![CDATA[131]]></SEQNO>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <AD_ELEMENT_ID><![CDATA[D570CE6C7BB4426BBEBDA54C7D1EFF3B]]></AD_ELEMENT_ID>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <POSITION><![CDATA[42]]></POSITION>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
+<!--1FEFAB2F6215496FA9026D5FF7706F6F--></AD_COLUMN>
+
 <!--200D1AA20B4D437FB6EEE9D899D0FD87--><AD_COLUMN>
 <!--200D1AA20B4D437FB6EEE9D899D0FD87-->  <AD_COLUMN_ID><![CDATA[200D1AA20B4D437FB6EEE9D899D0FD87]]></AD_COLUMN_ID>
 <!--200D1AA20B4D437FB6EEE9D899D0FD87-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Wed Feb 24 18:05:08 2016 +0530
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Fri Feb 26 08:20:01 2016 +0100
@@ -21000,6 +21000,20 @@
 <!--026C0C35D730459B865E7242955C87F2-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--026C0C35D730459B865E7242955C87F2--></AD_ELEMENT>
 
+<!--02F1D370B8B34FB79D151811C705B200--><AD_ELEMENT>
+<!--02F1D370B8B34FB79D151811C705B200-->  <AD_ELEMENT_ID><![CDATA[02F1D370B8B34FB79D151811C705B200]]></AD_ELEMENT_ID>
+<!--02F1D370B8B34FB79D151811C705B200-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--02F1D370B8B34FB79D151811C705B200-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--02F1D370B8B34FB79D151811C705B200-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--02F1D370B8B34FB79D151811C705B200-->  <COLUMNNAME><![CDATA[DaysToPasswordExpiration]]></COLUMNNAME>
+<!--02F1D370B8B34FB79D151811C705B200-->  <NAME><![CDATA[Days To Password Expiration]]></NAME>
+<!--02F1D370B8B34FB79D151811C705B200-->  <PRINTNAME><![CDATA[Days To Password Expiration]]></PRINTNAME>
+<!--02F1D370B8B34FB79D151811C705B200-->  <DESCRIPTION><![CDATA[Define the days that user password must be valid from previous password change]]></DESCRIPTION>
+<!--02F1D370B8B34FB79D151811C705B200-->  <HELP><![CDATA[Define the days that user password must be valid from previous password change, if value is set to 0 no update will be required, for value greater than 0, password must be updated when the last password update date of the user plus the days defined here achieves. It will affect to all users depending the client.]]></HELP>
+<!--02F1D370B8B34FB79D151811C705B200-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--02F1D370B8B34FB79D151811C705B200-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--02F1D370B8B34FB79D151811C705B200--></AD_ELEMENT>
+
 <!--035BE38188FC44538E3DDDA769800CFB--><AD_ELEMENT>
 <!--035BE38188FC44538E3DDDA769800CFB-->  <AD_ELEMENT_ID><![CDATA[035BE38188FC44538E3DDDA769800CFB]]></AD_ELEMENT_ID>
 <!--035BE38188FC44538E3DDDA769800CFB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -32966,6 +32980,20 @@
 <!--D562603297394ACD82F50464ABB8F6EF-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--D562603297394ACD82F50464ABB8F6EF--></AD_ELEMENT>
 
+<!--D570CE6C7BB4426BBEBDA54C7D1EFF3B--><AD_ELEMENT>
+<!--D570CE6C7BB4426BBEBDA54C7D1EFF3B-->  <AD_ELEMENT_ID><![CDATA[D570CE6C7BB4426BBEBDA54C7D1EFF3B]]></AD_ELEMENT_ID>
+<!--D570CE6C7BB4426BBEBDA54C7D1EFF3B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D570CE6C7BB4426BBEBDA54C7D1EFF3B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D570CE6C7BB4426BBEBDA54C7D1EFF3B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D570CE6C7BB4426BBEBDA54C7D1EFF3B-->  <COLUMNNAME><![CDATA[LastPasswordUpdate]]></COLUMNNAME>
+<!--D570CE6C7BB4426BBEBDA54C7D1EFF3B-->  <NAME><![CDATA[Last Password Update]]></NAME>
+<!--D570CE6C7BB4426BBEBDA54C7D1EFF3B-->  <PRINTNAME><![CDATA[Last Password Update]]></PRINTNAME>
+<!--D570CE6C7BB4426BBEBDA54C7D1EFF3B-->  <DESCRIPTION><![CDATA[Latest date of user password change]]></DESCRIPTION>
+<!--D570CE6C7BB4426BBEBDA54C7D1EFF3B-->  <HELP><![CDATA[Latest date of user password change]]></HELP>
+<!--D570CE6C7BB4426BBEBDA54C7D1EFF3B-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D570CE6C7BB4426BBEBDA54C7D1EFF3B-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--D570CE6C7BB4426BBEBDA54C7D1EFF3B--></AD_ELEMENT>
+
 <!--D5CB4C07B1F3408AB06BD8BC776494AA--><AD_ELEMENT>
 <!--D5CB4C07B1F3408AB06BD8BC776494AA-->  <AD_ELEMENT_ID><![CDATA[D5CB4C07B1F3408AB06BD8BC776494AA]]></AD_ELEMENT_ID>
 <!--D5CB4C07B1F3408AB06BD8BC776494AA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Wed Feb 24 18:05:08 2016 +0530
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Fri Feb 26 08:20:01 2016 +0100
@@ -50310,7 +50310,7 @@
 <!--3813-->  <DISPLAYLOGIC><![CDATA[@SMTPHost@!null & @SMTPHost@!'']]></DISPLAYLOGIC>
 <!--3813-->  <DISPLAYLENGTH><![CDATA[20]]></DISPLAYLENGTH>
 <!--3813-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--3813-->  <SEQNO><![CDATA[80]]></SEQNO>
+<!--3813-->  <SEQNO><![CDATA[90]]></SEQNO>
 <!--3813-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--3813-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--3813-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -62524,7 +62524,7 @@
 <!--5161-->  <DISPLAYLOGIC><![CDATA[@SMTPHost@!null & @SMTPHost@!'']]></DISPLAYLOGIC>
 <!--5161-->  <DISPLAYLENGTH><![CDATA[20]]></DISPLAYLENGTH>
 <!--5161-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--5161-->  <SEQNO><![CDATA[100]]></SEQNO>
+<!--5161-->  <SEQNO><![CDATA[110]]></SEQNO>
 <!--5161-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--5161-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--5161-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -62555,7 +62555,7 @@
 <!--5162-->  <DISPLAYLOGIC><![CDATA[@SMTPHost@!null & @SMTPHost@!'']]></DISPLAYLOGIC>
 <!--5162-->  <DISPLAYLENGTH><![CDATA[20]]></DISPLAYLENGTH>
 <!--5162-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--5162-->  <SEQNO><![CDATA[110]]></SEQNO>
+<!--5162-->  <SEQNO><![CDATA[120]]></SEQNO>
 <!--5162-->  <ISSAMELINE><![CDATA[Y]]></ISSAMELINE>
 <!--5162-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--5162-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -62586,7 +62586,7 @@
 <!--5163-->  <DISPLAYLOGIC><![CDATA[@SMTPHost@!null & @SMTPHost@!'']]></DISPLAYLOGIC>
 <!--5163-->  <DISPLAYLENGTH><![CDATA[20]]></DISPLAYLENGTH>
 <!--5163-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--5163-->  <SEQNO><![CDATA[120]]></SEQNO>
+<!--5163-->  <SEQNO><![CDATA[130]]></SEQNO>
 <!--5163-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--5163-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--5163-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -62617,7 +62617,7 @@
 <!--5164-->  <DISPLAYLOGIC><![CDATA[@SMTPHost@!null & @SMTPHost@!'']]></DISPLAYLOGIC>
 <!--5164-->  <DISPLAYLENGTH><![CDATA[20]]></DISPLAYLENGTH>
 <!--5164-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--5164-->  <SEQNO><![CDATA[130]]></SEQNO>
+<!--5164-->  <SEQNO><![CDATA[140]]></SEQNO>
 <!--5164-->  <ISSAMELINE><![CDATA[Y]]></ISSAMELINE>
 <!--5164-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--5164-->  <ISENCRYPTED><![CDATA[Y]]></ISENCRYPTED>
@@ -73489,7 +73489,7 @@
 <!--5887-->  <DISPLAYLOGIC><![CDATA[@SMTPHost@!null & @SMTPHost@!'']]></DISPLAYLOGIC>
 <!--5887-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
 <!--5887-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--5887-->  <SEQNO><![CDATA[90]]></SEQNO>
+<!--5887-->  <SEQNO><![CDATA[100]]></SEQNO>
 <!--5887-->  <ISSAMELINE><![CDATA[Y]]></ISSAMELINE>
 <!--5887-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--5887-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -191619,7 +191619,7 @@
 <!--21D7540351B54FCAB5FC1866330454EB-->  <DISPLAYLOGIC><![CDATA[@Org_Acctdim_Isenable@='Y' & @Acctdim_Centrally_Maintained@='Y']]></DISPLAYLOGIC>
 <!--21D7540351B54FCAB5FC1866330454EB-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
 <!--21D7540351B54FCAB5FC1866330454EB-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--21D7540351B54FCAB5FC1866330454EB-->  <SEQNO><![CDATA[170]]></SEQNO>
+<!--21D7540351B54FCAB5FC1866330454EB-->  <SEQNO><![CDATA[180]]></SEQNO>
 <!--21D7540351B54FCAB5FC1866330454EB-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--21D7540351B54FCAB5FC1866330454EB-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--21D7540351B54FCAB5FC1866330454EB-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -200995,7 +200995,7 @@
 <!--393F614AD39F4BB4B0287B53A6D14C7E-->  <DISPLAYLOGIC><![CDATA[@Acctdim_Centrally_Maintained@='Y']]></DISPLAYLOGIC>
 <!--393F614AD39F4BB4B0287B53A6D14C7E-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
 <!--393F614AD39F4BB4B0287B53A6D14C7E-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
-<!--393F614AD39F4BB4B0287B53A6D14C7E-->  <SEQNO><![CDATA[150]]></SEQNO>
+<!--393F614AD39F4BB4B0287B53A6D14C7E-->  <SEQNO><![CDATA[160]]></SEQNO>
 <!--393F614AD39F4BB4B0287B53A6D14C7E-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--393F614AD39F4BB4B0287B53A6D14C7E-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--393F614AD39F4BB4B0287B53A6D14C7E-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -204347,6 +204347,34 @@
 <!--419FEB9778C044FE83E606EA4548A1B4-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--419FEB9778C044FE83E606EA4548A1B4--></AD_FIELD>
 
+<!--41AD871370F04BA7AE780F013DEE70DF--><AD_FIELD>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <AD_FIELD_ID><![CDATA[41AD871370F04BA7AE780F013DEE70DF]]></AD_FIELD_ID>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <NAME><![CDATA[Last Password Update]]></NAME>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <DESCRIPTION><![CDATA[Latest date of user password change]]></DESCRIPTION>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <HELP><![CDATA[Latest date of user password change]]></HELP>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <AD_TAB_ID><![CDATA[118]]></AD_TAB_ID>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <AD_COLUMN_ID><![CDATA[1FEFAB2F6215496FA9026D5FF7706F6F]]></AD_COLUMN_ID>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <DISPLAYLENGTH><![CDATA[19]]></DISPLAYLENGTH>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <SEQNO><![CDATA[300]]></SEQNO>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--41AD871370F04BA7AE780F013DEE70DF-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--41AD871370F04BA7AE780F013DEE70DF--></AD_FIELD>
+
 <!--41AE565AFD0948F18A78A09BB41106CD--><AD_FIELD>
 <!--41AE565AFD0948F18A78A09BB41106CD-->  <AD_FIELD_ID><![CDATA[41AE565AFD0948F18A78A09BB41106CD]]></AD_FIELD_ID>
 <!--41AE565AFD0948F18A78A09BB41106CD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -226396,6 +226424,34 @@
 <!--625D3468BEE14D7C800A712B2F8306B3-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--625D3468BEE14D7C800A712B2F8306B3--></AD_FIELD>
 
+<!--626DBD89E53645F79542B2A9B9B38F17--><AD_FIELD>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <AD_FIELD_ID><![CDATA[626DBD89E53645F79542B2A9B9B38F17]]></AD_FIELD_ID>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <NAME><![CDATA[Days To Password Expiration]]></NAME>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <DESCRIPTION><![CDATA[Define the days that user password must be valid from previous password change]]></DESCRIPTION>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <HELP><![CDATA[Define the days that user password must be valid from previous password change, if value is set to 0 no update will be required, for value greater than 0, password must be updated when the last password update date of the user plus the days defined here achieves. It will affect to all users depending the client.]]></HELP>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <AD_TAB_ID><![CDATA[145]]></AD_TAB_ID>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <AD_COLUMN_ID><![CDATA[06EF3D56611445C4BAC1A2ACE23AD94A]]></AD_COLUMN_ID>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <DISPLAYLENGTH><![CDATA[12]]></DISPLAYLENGTH>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <SEQNO><![CDATA[80]]></SEQNO>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--626DBD89E53645F79542B2A9B9B38F17-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--626DBD89E53645F79542B2A9B9B38F17--></AD_FIELD>
+
 <!--62771C59EBEC4D989520CE0A299956D0--><AD_FIELD>
 <!--62771C59EBEC4D989520CE0A299956D0-->  <AD_FIELD_ID><![CDATA[62771C59EBEC4D989520CE0A299956D0]]></AD_FIELD_ID>
 <!--62771C59EBEC4D989520CE0A299956D0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -238762,7 +238818,7 @@
 <!--7D8571DE9B4B47CB88F9DB275422AEFD-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--7D8571DE9B4B47CB88F9DB275422AEFD-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
 <!--7D8571DE9B4B47CB88F9DB275422AEFD-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--7D8571DE9B4B47CB88F9DB275422AEFD-->  <SEQNO><![CDATA[140]]></SEQNO>
+<!--7D8571DE9B4B47CB88F9DB275422AEFD-->  <SEQNO><![CDATA[150]]></SEQNO>
 <!--7D8571DE9B4B47CB88F9DB275422AEFD-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--7D8571DE9B4B47CB88F9DB275422AEFD-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--7D8571DE9B4B47CB88F9DB275422AEFD-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -292412,7 +292468,7 @@
 <!--D22CED5BEC9940AD99657C22CD2CCC08-->  <DISPLAYLOGIC><![CDATA[@Org_Acctdim_Isenable@='Y' & @Acctdim_Centrally_Maintained@='Y']]></DISPLAYLOGIC>
 <!--D22CED5BEC9940AD99657C22CD2CCC08-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
 <!--D22CED5BEC9940AD99657C22CD2CCC08-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--D22CED5BEC9940AD99657C22CD2CCC08-->  <SEQNO><![CDATA[160]]></SEQNO>
+<!--D22CED5BEC9940AD99657C22CD2CCC08-->  <SEQNO><![CDATA[170]]></SEQNO>
 <!--D22CED5BEC9940AD99657C22CD2CCC08-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--D22CED5BEC9940AD99657C22CD2CCC08-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--D22CED5BEC9940AD99657C22CD2CCC08-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
--- a/src-db/database/sourcedata/AD_MESSAGE.xml	Wed Feb 24 18:05:08 2016 +0530
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml	Fri Feb 26 08:20:01 2016 +0100
@@ -18355,6 +18355,18 @@
 <!--351FC82B45B74D2E9473973D5E85766D-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--351FC82B45B74D2E9473973D5E85766D--></AD_MESSAGE>
 
+<!--359DA25A7D184703A7F70790D8B5B6BD--><AD_MESSAGE>
+<!--359DA25A7D184703A7F70790D8B5B6BD-->  <AD_MESSAGE_ID><![CDATA[359DA25A7D184703A7F70790D8B5B6BD]]></AD_MESSAGE_ID>
+<!--359DA25A7D184703A7F70790D8B5B6BD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--359DA25A7D184703A7F70790D8B5B6BD-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--359DA25A7D184703A7F70790D8B5B6BD-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--359DA25A7D184703A7F70790D8B5B6BD-->  <VALUE><![CDATA[CPEmptyUserPassword]]></VALUE>
+<!--359DA25A7D184703A7F70790D8B5B6BD-->  <MSGTEXT><![CDATA[Please enter your username and password]]></MSGTEXT>
+<!--359DA25A7D184703A7F70790D8B5B6BD-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--359DA25A7D184703A7F70790D8B5B6BD-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--359DA25A7D184703A7F70790D8B5B6BD-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--359DA25A7D184703A7F70790D8B5B6BD--></AD_MESSAGE>
+
 <!--35B777D45FEA433281D73DBBECAB0E16--><AD_MESSAGE>
 <!--35B777D45FEA433281D73DBBECAB0E16-->  <AD_MESSAGE_ID><![CDATA[35B777D45FEA433281D73DBBECAB0E16]]></AD_MESSAGE_ID>
 <!--35B777D45FEA433281D73DBBECAB0E16-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -19225,6 +19237,18 @@
 <!--47409688AF1E4A698F396E8FFCF01CBE-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--47409688AF1E4A698F396E8FFCF01CBE--></AD_MESSAGE>
 
+<!--477D32C1DD00461BB399A6D6E0DFB479--><AD_MESSAGE>
+<!--477D32C1DD00461BB399A6D6E0DFB479-->  <AD_MESSAGE_ID><![CDATA[477D32C1DD00461BB399A6D6E0DFB479]]></AD_MESSAGE_ID>
+<!--477D32C1DD00461BB399A6D6E0DFB479-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--477D32C1DD00461BB399A6D6E0DFB479-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--477D32C1DD00461BB399A6D6E0DFB479-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--477D32C1DD00461BB399A6D6E0DFB479-->  <VALUE><![CDATA[CPSamePasswordThanOld]]></VALUE>
+<!--477D32C1DD00461BB399A6D6E0DFB479-->  <MSGTEXT><![CDATA[Same password than old one]]></MSGTEXT>
+<!--477D32C1DD00461BB399A6D6E0DFB479-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--477D32C1DD00461BB399A6D6E0DFB479-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--477D32C1DD00461BB399A6D6E0DFB479-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--477D32C1DD00461BB399A6D6E0DFB479--></AD_MESSAGE>
+
 <!--478F1A67DE4D4CEABA652C04A7D50B63--><AD_MESSAGE>
 <!--478F1A67DE4D4CEABA652C04A7D50B63-->  <AD_MESSAGE_ID><![CDATA[478F1A67DE4D4CEABA652C04A7D50B63]]></AD_MESSAGE_ID>
 <!--478F1A67DE4D4CEABA652C04A7D50B63-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -19262,6 +19286,18 @@
 <!--47D88149F6D2473D892D25F4A86CA161-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--47D88149F6D2473D892D25F4A86CA161--></AD_MESSAGE>
 
+<!--47FE48A07B1F404DBC023F4303999919--><AD_MESSAGE>
+<!--47FE48A07B1F404DBC023F4303999919-->  <AD_MESSAGE_ID><![CDATA[47FE48A07B1F404DBC023F4303999919]]></AD_MESSAGE_ID>
+<!--47FE48A07B1F404DBC023F4303999919-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--47FE48A07B1F404DBC023F4303999919-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--47FE48A07B1F404DBC023F4303999919-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--47FE48A07B1F404DBC023F4303999919-->  <VALUE><![CDATA[CPSamePassword]]></VALUE>
+<!--47FE48A07B1F404DBC023F4303999919-->  <MSGTEXT><![CDATA[Passwords must be the same]]></MSGTEXT>
+<!--47FE48A07B1F404DBC023F4303999919-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--47FE48A07B1F404DBC023F4303999919-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--47FE48A07B1F404DBC023F4303999919-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--47FE48A07B1F404DBC023F4303999919--></AD_MESSAGE>
+
 <!--4824BDCE0FDA46ADA4D79BA676791DFF--><AD_MESSAGE>
 <!--4824BDCE0FDA46ADA4D79BA676791DFF-->  <AD_MESSAGE_ID><![CDATA[4824BDCE0FDA46ADA4D79BA676791DFF]]></AD_MESSAGE_ID>
 <!--4824BDCE0FDA46ADA4D79BA676791DFF-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -20638,6 +20674,18 @@
 <!--66BEE4A0FBD44C96B2967716918A1318-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--66BEE4A0FBD44C96B2967716918A1318--></AD_MESSAGE>
 
+<!--66C9D1145558443EA2B6038CA2201049--><AD_MESSAGE>
+<!--66C9D1145558443EA2B6038CA2201049-->  <AD_MESSAGE_ID><![CDATA[66C9D1145558443EA2B6038CA2201049]]></AD_MESSAGE_ID>
+<!--66C9D1145558443EA2B6038CA2201049-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--66C9D1145558443EA2B6038CA2201049-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--66C9D1145558443EA2B6038CA2201049-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--66C9D1145558443EA2B6038CA2201049-->  <VALUE><![CDATA[CPUpdatePassword]]></VALUE>
+<!--66C9D1145558443EA2B6038CA2201049-->  <MSGTEXT><![CDATA[Write a new password]]></MSGTEXT>
+<!--66C9D1145558443EA2B6038CA2201049-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--66C9D1145558443EA2B6038CA2201049-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--66C9D1145558443EA2B6038CA2201049-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--66C9D1145558443EA2B6038CA2201049--></AD_MESSAGE>
+
 <!--67178C115E364ED2B68EC84473CD7404--><AD_MESSAGE>
 <!--67178C115E364ED2B68EC84473CD7404-->  <AD_MESSAGE_ID><![CDATA[67178C115E364ED2B68EC84473CD7404]]></AD_MESSAGE_ID>
 <!--67178C115E364ED2B68EC84473CD7404-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -22119,6 +22167,18 @@
 <!--87F4030110BF457ABC427FEA68750143-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--87F4030110BF457ABC427FEA68750143--></AD_MESSAGE>
 
+<!--883A1F99972748F19C4E901C76589770--><AD_MESSAGE>
+<!--883A1F99972748F19C4E901C76589770-->  <AD_MESSAGE_ID><![CDATA[883A1F99972748F19C4E901C76589770]]></AD_MESSAGE_ID>
+<!--883A1F99972748F19C4E901C76589770-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--883A1F99972748F19C4E901C76589770-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--883A1F99972748F19C4E901C76589770-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--883A1F99972748F19C4E901C76589770-->  <VALUE><![CDATA[CPExpirationPassword]]></VALUE>
+<!--883A1F99972748F19C4E901C76589770-->  <MSGTEXT><![CDATA[Your password has expired. Please provide a new one.]]></MSGTEXT>
+<!--883A1F99972748F19C4E901C76589770-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--883A1F99972748F19C4E901C76589770-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--883A1F99972748F19C4E901C76589770-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--883A1F99972748F19C4E901C76589770--></AD_MESSAGE>
+
 <!--88A1D0A0F67F49339B2639EA4E5F6B4B--><AD_MESSAGE>
 <!--88A1D0A0F67F49339B2639EA4E5F6B4B-->  <AD_MESSAGE_ID><![CDATA[88A1D0A0F67F49339B2639EA4E5F6B4B]]></AD_MESSAGE_ID>
 <!--88A1D0A0F67F49339B2639EA4E5F6B4B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -25496,6 +25556,18 @@
 <!--D3696EC5C14B4068B5E2331A89CD1A2A-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--D3696EC5C14B4068B5E2331A89CD1A2A--></AD_MESSAGE>
 
+<!--D3A7922C8400453CABDBE823D90C0623--><AD_MESSAGE>
+<!--D3A7922C8400453CABDBE823D90C0623-->  <AD_MESSAGE_ID><![CDATA[D3A7922C8400453CABDBE823D90C0623]]></AD_MESSAGE_ID>
+<!--D3A7922C8400453CABDBE823D90C0623-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D3A7922C8400453CABDBE823D90C0623-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D3A7922C8400453CABDBE823D90C0623-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D3A7922C8400453CABDBE823D90C0623-->  <VALUE><![CDATA[CPDifferentPassword]]></VALUE>
+<!--D3A7922C8400453CABDBE823D90C0623-->  <MSGTEXT><![CDATA[Password must be different from the previous one]]></MSGTEXT>
+<!--D3A7922C8400453CABDBE823D90C0623-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--D3A7922C8400453CABDBE823D90C0623-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D3A7922C8400453CABDBE823D90C0623-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--D3A7922C8400453CABDBE823D90C0623--></AD_MESSAGE>
+
 <!--D3A9E2D613734D5E847C11DF4DDAC958--><AD_MESSAGE>
 <!--D3A9E2D613734D5E847C11DF4DDAC958-->  <AD_MESSAGE_ID><![CDATA[D3A9E2D613734D5E847C11DF4DDAC958]]></AD_MESSAGE_ID>
 <!--D3A9E2D613734D5E847C11DF4DDAC958-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -26438,6 +26510,18 @@
 <!--E652E8A6AC41454D817E71F6FEE67779-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--E652E8A6AC41454D817E71F6FEE67779--></AD_MESSAGE>
 
+<!--E665B521F8DE4D238ED4D2BD8764D609--><AD_MESSAGE>
+<!--E665B521F8DE4D238ED4D2BD8764D609-->  <AD_MESSAGE_ID><![CDATA[E665B521F8DE4D238ED4D2BD8764D609]]></AD_MESSAGE_ID>
+<!--E665B521F8DE4D238ED4D2BD8764D609-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E665B521F8DE4D238ED4D2BD8764D609-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E665B521F8DE4D238ED4D2BD8764D609-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E665B521F8DE4D238ED4D2BD8764D609-->  <VALUE><![CDATA[CPDifferentPasswordInFields]]></VALUE>
+<!--E665B521F8DE4D238ED4D2BD8764D609-->  <MSGTEXT><![CDATA[The password must be the same in both fields]]></MSGTEXT>
+<!--E665B521F8DE4D238ED4D2BD8764D609-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--E665B521F8DE4D238ED4D2BD8764D609-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E665B521F8DE4D238ED4D2BD8764D609-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--E665B521F8DE4D238ED4D2BD8764D609--></AD_MESSAGE>
+
 <!--E667A3DF0E1D4FA6BFEE696F302C1663--><AD_MESSAGE>
 <!--E667A3DF0E1D4FA6BFEE696F302C1663-->  <AD_MESSAGE_ID><![CDATA[E667A3DF0E1D4FA6BFEE696F302C1663]]></AD_MESSAGE_ID>
 <!--E667A3DF0E1D4FA6BFEE696F302C1663-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Wed Feb 24 18:05:08 2016 +0530
+++ b/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Fri Feb 26 08:20:01 2016 +0100
@@ -16621,6 +16621,17 @@
 <!--65505548D00711DD9127001D09C4A2FE-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--65505548D00711DD9127001D09C4A2FE--></AD_TEXTINTERFACES>
 
+<!--66D7C4700AE2495AB0922E85EA3C5CF0--><AD_TEXTINTERFACES>
+<!--66D7C4700AE2495AB0922E85EA3C5CF0-->  <AD_TEXTINTERFACES_ID><![CDATA[66D7C4700AE2495AB0922E85EA3C5CF0]]></AD_TEXTINTERFACES_ID>
+<!--66D7C4700AE2495AB0922E85EA3C5CF0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--66D7C4700AE2495AB0922E85EA3C5CF0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--66D7C4700AE2495AB0922E85EA3C5CF0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--66D7C4700AE2495AB0922E85EA3C5CF0-->  <TEXT><![CDATA[Confirm Password]]></TEXT>
+<!--66D7C4700AE2495AB0922E85EA3C5CF0-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/security/Login.html]]></FILENAME>
+<!--66D7C4700AE2495AB0922E85EA3C5CF0-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--66D7C4700AE2495AB0922E85EA3C5CF0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--66D7C4700AE2495AB0922E85EA3C5CF0--></AD_TEXTINTERFACES>
+
 <!--69B61F0276871955E040007F01017873--><AD_TEXTINTERFACES>
 <!--69B61F0276871955E040007F01017873-->  <AD_TEXTINTERFACES_ID><![CDATA[69B61F0276871955E040007F01017873]]></AD_TEXTINTERFACES_ID>
 <!--69B61F0276871955E040007F01017873-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -21877,6 +21888,17 @@
 <!--E6894EE1CD7D4E58B3B2AD4A25B6ED2C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--E6894EE1CD7D4E58B3B2AD4A25B6ED2C--></AD_TEXTINTERFACES>
 
+<!--E75A4670EFB84DF7A11DBE0471E5AA5C--><AD_TEXTINTERFACES>
+<!--E75A4670EFB84DF7A11DBE0471E5AA5C-->  <AD_TEXTINTERFACES_ID><![CDATA[E75A4670EFB84DF7A11DBE0471E5AA5C]]></AD_TEXTINTERFACES_ID>
+<!--E75A4670EFB84DF7A11DBE0471E5AA5C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E75A4670EFB84DF7A11DBE0471E5AA5C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E75A4670EFB84DF7A11DBE0471E5AA5C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E75A4670EFB84DF7A11DBE0471E5AA5C-->  <TEXT><![CDATA[New Password]]></TEXT>
+<!--E75A4670EFB84DF7A11DBE0471E5AA5C-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/security/Login.html]]></FILENAME>
+<!--E75A4670EFB84DF7A11DBE0471E5AA5C-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--E75A4670EFB84DF7A11DBE0471E5AA5C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E75A4670EFB84DF7A11DBE0471E5AA5C--></AD_TEXTINTERFACES>
+
 <!--E76C696EF9D211DD98162F8F330D81D6--><AD_TEXTINTERFACES>
 <!--E76C696EF9D211DD98162F8F330D81D6-->  <AD_TEXTINTERFACES_ID><![CDATA[E76C696EF9D211DD98162F8F330D81D6]]></AD_TEXTINTERFACES_ID>
 <!--E76C696EF9D211DD98162F8F330D81D6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/referencedData/AD_USER.xml	Wed Feb 24 18:05:08 2016 +0530
+++ b/src-db/database/sourcedata/referencedData/AD_USER.xml	Fri Feb 26 08:20:01 2016 +0100
@@ -10,6 +10,7 @@
 <!--0-->  <USERNAME><![CDATA[System]]></USERNAME>
 <!--0-->  <ISLOCKED><![CDATA[N]]></ISLOCKED>
 <!--0-->  <GRANT_PORTAL_ACCESS><![CDATA[N]]></GRANT_PORTAL_ACCESS>
+<!--0-->  <LASTPASSWORDUPDATE><![CDATA[2016-01-20 10:50:20.329404]]></LASTPASSWORDUPDATE>
 <!--0--></AD_USER>
 
 <!--100--><AD_USER>
@@ -24,6 +25,7 @@
 <!--100-->  <USERNAME><![CDATA[Openbravo]]></USERNAME>
 <!--100-->  <ISLOCKED><![CDATA[N]]></ISLOCKED>
 <!--100-->  <GRANT_PORTAL_ACCESS><![CDATA[N]]></GRANT_PORTAL_ACCESS>
+<!--100-->  <LASTPASSWORDUPDATE><![CDATA[2016-01-20 11:26:57.0]]></LASTPASSWORDUPDATE>
 <!--100--></AD_USER>
 
 </data>
--- a/src/org/openbravo/authentication/AuthenticationException.java	Wed Feb 24 18:05:08 2016 +0530
+++ b/src/org/openbravo/authentication/AuthenticationException.java	Fri Feb 26 08:20:01 2016 +0100
@@ -1,6 +1,6 @@
 /*
  ************************************************************************************
- * Copyright (C) 2001-2011 Openbravo S.L.U.
+ * Copyright (C) 2001-2016 Openbravo S.L.U.
  * Licensed under the Apache Software License version 2.0
  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to  in writing,  software  distributed
@@ -29,6 +29,11 @@
     this.error = null;
   }
 
+  public AuthenticationException(String msg, Boolean isLogExceptionNeeded) {
+    super(msg, isLogExceptionNeeded);
+    this.error = null;
+  }
+
   public AuthenticationException(String msg, Throwable cause) {
     super(msg, cause);
     this.error = null;
@@ -39,6 +44,11 @@
     this.error = error;
   }
 
+  public AuthenticationException(String msg, OBError error, Boolean isLogExceptionNeeded) {
+    super(msg, isLogExceptionNeeded);
+    this.error = error;
+  }
+
   public OBError getOBError() {
     return error;
   }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/authentication/AuthenticationExpirationPasswordException.java	Fri Feb 26 08:20:01 2016 +0100
@@ -0,0 +1,43 @@
+/*
+ ************************************************************************************
+ * Copyright (C) 2016 Openbravo S.L.U.
+ * Licensed under the Apache Software License version 2.0
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to  in writing,  software  distributed
+ * under the License is distributed  on  an  "AS IS"  BASIS,  WITHOUT  WARRANTIES  OR
+ * CONDITIONS OF ANY KIND, either  express  or  implied.  See  the  License  for  the
+ * specific language governing permissions and limitations under the License.
+ ************************************************************************************
+ */
+
+package org.openbravo.authentication;
+
+import org.openbravo.erpCommon.utility.OBError;
+
+/**
+ * This exception is used in case password for user has expired. Exception is launched in case that
+ * last update password date for user plus validity days defined for client has been reached
+ * 
+ */
+public class AuthenticationExpirationPasswordException extends AuthenticationException {
+  private static final long serialVersionUID = 1L;
+
+  public AuthenticationExpirationPasswordException(String msg) {
+    super(msg);
+  }
+
+  public AuthenticationExpirationPasswordException(String msg, OBError error) {
+    super(msg, error);
+  }
+
+  public AuthenticationExpirationPasswordException(String msg, Throwable cause) {
+    super(msg, cause);
+  }
+
+  public AuthenticationExpirationPasswordException(String msg, OBError error,
+      boolean passwordExpiration) {
+    super(msg, error, false);
+    this.getLogger().error(error.getTitle());
+
+  }
+}
\ No newline at end of file
--- a/src/org/openbravo/authentication/basic/DefaultAuthenticationManager.java	Wed Feb 24 18:05:08 2016 +0530
+++ b/src/org/openbravo/authentication/basic/DefaultAuthenticationManager.java	Fri Feb 26 08:20:01 2016 +0100
@@ -1,6 +1,6 @@
 /*
  ************************************************************************************
- * Copyright (C) 2001-2012 Openbravo S.L.U.
+ * Copyright (C) 2001-2016 Openbravo S.L.U.
  * Licensed under the Apache Software License version 2.0
  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to  in writing,  software  distributed
@@ -13,6 +13,8 @@
 package org.openbravo.authentication.basic;
 
 import java.io.IOException;
+import java.util.Calendar;
+import java.util.Date;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
@@ -21,14 +23,19 @@
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
+import org.hibernate.criterion.Restrictions;
 import org.openbravo.authentication.AuthenticationException;
+import org.openbravo.authentication.AuthenticationExpirationPasswordException;
 import org.openbravo.authentication.AuthenticationManager;
 import org.openbravo.base.HttpBaseUtils;
 import org.openbravo.base.secureApp.LoginUtils;
 import org.openbravo.base.secureApp.VariablesHistory;
 import org.openbravo.base.secureApp.VariablesSecureApp;
+import org.openbravo.dal.service.OBCriteria;
+import org.openbravo.dal.service.OBDal;
 import org.openbravo.erpCommon.utility.OBError;
 import org.openbravo.erpCommon.utility.Utility;
+import org.openbravo.model.ad.access.User;
 
 /**
  * 
@@ -51,49 +58,63 @@
       throws AuthenticationException, ServletException, IOException {
 
     final VariablesSecureApp vars = new VariablesSecureApp(request, false);
-    final String sUserId = (String) request.getSession().getAttribute("#Authenticated_user");
+    final Boolean resetPassword = Boolean.parseBoolean(vars.getStringParameter("resetPassword"));
+    final String sUserId;
+    if (resetPassword) {
+      sUserId = vars.getSessionValue("#AD_User_ID");
+
+    } else {
+      sUserId = (String) request.getSession().getAttribute("#Authenticated_user");
+    }
+
     final String strAjax = vars.getStringParameter("IsAjaxCall");
-
-    if (!StringUtils.isEmpty(sUserId)) {
+    if (!StringUtils.isEmpty(sUserId) && !resetPassword) {
       return sUserId;
     }
 
     VariablesHistory variables = new VariablesHistory(request);
-
+    final String user;
+    final String pass;
     // Begins code related to login process
-
-    final String strUser = vars.getStringParameter("user");
-    final String strPass = vars.getStringParameter("password");
-    username = strUser;
-
-    if (StringUtils.isEmpty(strUser)) {
+    if (resetPassword) {
+      User userOB = OBDal.getInstance().get(User.class, sUserId);
+      user = userOB.getUsername();
+    } else {
+      user = vars.getStringParameter("user");
+    }
+    pass = vars.getStringParameter("password");
+    username = user;
+    if (StringUtils.isEmpty(user)) {
       // redirects to the menu or the menu with the target
       setTargetInfoInVariables(request, variables);
       return null; // just give up, return null
     }
 
-    final String userId = LoginUtils.getValidUserId(conn, strUser, strPass);
-    final String sessionId = createDBSession(request, strUser, userId);
+    final String userId = LoginUtils.getValidUserId(conn, user, pass);
+    final String sessionId = createDBSession(request, user, userId);
 
     if (userId == null) {
 
       OBError errorMsg = new OBError();
       errorMsg.setType("Error");
 
-      if (LoginUtils.checkUserPassword(conn, strUser, strPass) == null) {
-        log4j.debug("Failed user/password. Username: " + strUser + " - Session ID:" + sessionId);
+      if (LoginUtils.checkUserPassword(conn, user, pass) == null) {
+        log4j.debug("Failed user/password. Username: " + user + " - Session ID:" + sessionId);
         errorMsg.setTitle("IDENTIFICATION_FAILURE_TITLE");
         errorMsg.setMessage("IDENTIFICATION_FAILURE_MSG");
       } else {
-        log4j.debug(strUser + " is locked cannot activate session ID " + sessionId);
+        log4j.debug(user + " is locked cannot activate session ID " + sessionId);
         errorMsg.setTitle("LOCKED_USER_TITLE");
         errorMsg.setMessage("LOCKED_USER_MSG");
       }
 
-      // throw error message will be caught by LoginHandler
       throw new AuthenticationException("IDENTIFICATION_FAILURE_TITLE", errorMsg);
     }
 
+    vars.setSessionValue("#AD_User_ID", userId);
+
+    checkIfPasswordExpired(userId, variables.getLanguage());
+
     // 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);
@@ -139,4 +160,47 @@
       response.sendRedirect(HttpBaseUtils.getLocalAddress(request));
     }
   }
+
+  /**
+   * Checks the expiration password date from userId, throws
+   * AuthenticationExpirationPasswordException in case that expiration date is reached
+   * 
+   * @param userId
+   *          The userId of the user to check expiration password date
+   * @param language
+   *          Default language for the user
+   * @throws AuthenticationExpirationPasswordException
+   *           AuthenticationExpirationPasswordException is thrown in case that expiration date is
+   *           reached
+   * 
+   */
+  private void checkIfPasswordExpired(String userId, String language)
+      throws AuthenticationExpirationPasswordException {
+
+    Date total = null;
+
+    final OBCriteria<User> obc = OBDal.getInstance().createCriteria(User.class);
+    obc.setFilterOnReadableClients(false);
+    obc.setFilterOnReadableOrganization(false);
+    obc.add(Restrictions.eq(User.PROPERTY_ID, userId));
+    final User userOB = (User) obc.uniqueResult();
+    Date lastUpdatePassword = userOB.getLastPasswordUpdate();
+    Long validityDays = userOB.getClient().getDaysToPasswordExpiration();
+    if (validityDays != null && validityDays > 0) {
+      Calendar expirationDate = Calendar.getInstance();
+      expirationDate.setTimeInMillis(lastUpdatePassword.getTime());
+      expirationDate.add(Calendar.DATE, validityDays.intValue());
+      total = expirationDate.getTime();
+    }
+
+    Date today = new Date();
+    if (total != null && total.compareTo(today) <= 0) {
+      OBError errorMsg = new OBError();
+      errorMsg.setType("Error");
+      errorMsg.setTitle(Utility.messageBD(conn, "CPExpirationPassword", language));
+      errorMsg.setMessage(Utility.messageBD(conn, "CPUpdatePassword", language));
+      throw new AuthenticationExpirationPasswordException(errorMsg.getTitle(), errorMsg, true);
+    }
+
+  }
 }
--- a/src/org/openbravo/base/secureApp/LoginHandler.java	Wed Feb 24 18:05:08 2016 +0530
+++ b/src/org/openbravo/base/secureApp/LoginHandler.java	Fri Feb 26 08:20:01 2016 +0100
@@ -1,6 +1,7 @@
 /*
  ************************************************************************************
- * Copyright (C) 2001-2015 Openbravo S.L.U.
+
+ * Copyright (C) 2001-2016 Openbravo S.L.U.
  * Licensed under the Apache Software License version 2.0
  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to  in writing,  software  distributed
@@ -21,10 +22,13 @@
 import org.apache.commons.lang.StringUtils;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
+import org.hibernate.criterion.Restrictions;
 import org.openbravo.authentication.AuthenticationException;
+import org.openbravo.authentication.AuthenticationExpirationPasswordException;
 import org.openbravo.authentication.AuthenticationManager;
 import org.openbravo.base.HttpBaseServlet;
 import org.openbravo.dal.core.OBContext;
+import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.erpCommon.obps.ActivationKey;
 import org.openbravo.erpCommon.obps.ActivationKey.LicenseRestriction;
@@ -38,6 +42,7 @@
 import org.openbravo.model.ad.module.Module;
 import org.openbravo.model.ad.system.Client;
 import org.openbravo.model.ad.system.SystemInformation;
+import org.openbravo.utils.FormatUtilities;
 import org.openbravo.xmlEngine.XmlDocument;
 
 /**
@@ -69,7 +74,15 @@
     vars.removeSessionValue("#AD_Role_ID");
     vars.setSessionObject("#loggingIn", "Y");
 
-    final String strUser = vars.getStringParameter("user");
+    final String user;
+    final String password;
+
+    boolean isPasswordResetFlow = Boolean.parseBoolean(vars.getStringParameter("resetPassword"));
+    if (isPasswordResetFlow) {
+      user = vars.getSessionValue("#AD_User_ID");
+    } else {
+      user = vars.getStringParameter("user");
+    }
 
     // When redirect parameter is true, instead of returning a json object with the login result and
     // target, a redirect to the application or error page is done.
@@ -83,10 +96,15 @@
 
       String language = systemClient.getLanguage().getLanguage();
 
-      if (strUser.equals("") && !OBVersion.getInstance().is30()) {
+      if (user.equals("") && !OBVersion.getInstance().is30()) {
         res.sendRedirect(res.encodeRedirectURL(strDireccion + "/security/Login_F1.html"));
       } else {
         try {
+          if (isPasswordResetFlow && StringUtils.isNotBlank(vars.getSessionValue("#AD_User_ID"))) {
+            password = vars.getStringParameter("password");
+            updatePassword(user, password, language);
+          }
+
           AuthenticationManager authManager = AuthenticationManager.getAuthenticationManager(this);
 
           final String strUserAuth = authManager.authenticate(req, res);
@@ -95,7 +113,13 @@
           if (StringUtils.isEmpty(strUserAuth)) {
             throw new AuthenticationException("Message");// FIXME
           }
-          checkLicenseAndGo(res, vars, strUserAuth, strUser, sessionId, doRedirect);
+          checkLicenseAndGo(res, vars, strUserAuth, user, sessionId, doRedirect);
+
+        } catch (AuthenticationExpirationPasswordException aepe) {
+
+          vars.removeSessionValue("#LoginErrorMsg");
+          goToUpdatePassword(res, vars, aepe.getOBError().getMessage(), aepe.getOBError()
+              .getTitle(), "Error", "../security/Login_FS.html", doRedirect);
 
         } catch (AuthenticationException e) {
 
@@ -394,8 +418,8 @@
   protected final void goToRetry(HttpServletResponse response, VariablesSecureApp vars,
       String message, String title, String msgType, String action, boolean doRedirect)
       throws IOException, ServletException {
-    String msg = (message != null && !message.equals("")) ? message
-        : "Please enter your username and password.";
+    String msg = (message != null && !message.equals("")) ? message : Utility.messageBD(myPool,
+        "CPEmptyUserPassword", vars.getLanguage());
 
     if (OBVersion.getInstance().is30() && !doRedirect) {
       // 3.0 instances show the message in the same login window, return a json object with the info
@@ -446,9 +470,82 @@
     }
   }
 
+  protected final void goToUpdatePassword(HttpServletResponse response, VariablesSecureApp vars,
+      String message, String title, String msgType, String action, boolean doRedirect)
+      throws IOException, ServletException {
+    String msg = (message != null && !message.equals("")) ? message : Utility.messageBD(myPool,
+        "CPEmptyUserPassword", vars.getLanguage());
+
+    try {
+      JSONObject jsonMsg = new JSONObject();
+      jsonMsg.put("showMessage", true);
+      jsonMsg.put("target", action);
+      jsonMsg.put("messageType", msgType);
+      jsonMsg.put("messageTitle", title);
+      jsonMsg.put("messageText", msg);
+      jsonMsg.put("resetPassword", true);
+      jsonMsg.put("loggedUser", vars.getStringParameter("user"));
+      if ("Confirmation".equals(msgType)) {
+        jsonMsg.put("command", "FORCE_NAMED_USER");
+      }
+      response.setContentType("application/json;charset=UTF-8");
+      final PrintWriter out = response.getWriter();
+      out.print(jsonMsg.toString());
+      out.close();
+    } catch (JSONException e) {
+      log4j.error("Error setting login msg", e);
+      throw new ServletException(e);
+    }
+  }
+
   @Override
   public String getServletInfo() {
     return "User-login control Servlet";
   } // end of getServletInfo() method
 
+  /**
+   * Update user password for userId with unHashedPassword provided, throws
+   * AuthenticationExpirationPasswordException in case the new password is the same that the old
+   * one.
+   * 
+   * 
+   * @param userId
+   *          the userId
+   * @param unHashedPassword
+   *          the password, the unhashed password as it is entered by the user.
+   * @param myPool
+   *          ConnectionProvider used to translate messages.
+   * @param language
+   *          Default language for the user
+   * @throws ServletException
+   *           ServletException is thrown in case that password could not be hashed
+   * 
+   */
+  private void updatePassword(String userId, String unHashedPassword, String language)
+      throws ServletException {
+    try {
+      OBContext.setAdminMode();
+      final OBCriteria<User> obc = OBDal.getInstance().createCriteria(User.class);
+      obc.add(Restrictions.eq(User.PROPERTY_ID, userId));
+      obc.setFilterOnReadableClients(false);
+      obc.setFilterOnReadableOrganization(false);
+      final User userOB = (User) obc.uniqueResult();
+      String oldPassword = userOB.getPassword();
+      String newPassword = FormatUtilities.sha1Base64(unHashedPassword);
+      if (oldPassword.equals(newPassword)) {
+        OBError errorMsg = new OBError();
+        errorMsg.setType("Error");
+        errorMsg.setTitle(Utility.messageBD(myPool, "CPDifferentPassword", language));
+        errorMsg.setMessage(Utility.messageBD(myPool, "CPSamePasswordThanOld", language));
+        throw new AuthenticationExpirationPasswordException(errorMsg.getMessage(), errorMsg, false);
+      } else {
+        userOB.setPassword(newPassword);
+        OBDal.getInstance().save(userOB);
+        OBDal.getInstance().flush();
+        OBDal.getInstance().commitAndClose();
+      }
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+  }
 }
--- a/src/org/openbravo/erpCommon/security/Login.html	Wed Feb 24 18:05:08 2016 +0530
+++ b/src/org/openbravo/erpCommon/security/Login.html	Fri Feb 26 08:20:01 2016 +0100
@@ -40,6 +40,8 @@
 <script language="JavaScript" type="text/javascript" id="recBrowserMsgText">var recBrowserMsgText = 'xx';</script>
 <script language="JavaScript" type="text/javascript" id="identificationFailureTitle">var identificationFailureTitle = 'xx';</script>
 <script language="JavaScript" type="text/javascript" id="errorEmptyContent">var errorEmptyContent = 'xx';</script>
+<script language="JavaScript" type="text/javascript" id="errorSamePassword">var errorSamePassword = 'xx';</script>
+<script language="JavaScript" type="text/javascript" id="errorDifferentPasswordInFields">var errorDifferentPasswordInFields = 'xx';</script>
 
 <script language="JavaScript" type="text/javascript">
 var validBrowserFirefox = '38.0.0.0';
@@ -189,6 +191,10 @@
 </script>
 <script type="text/javascript">
 function buttonOK_click() {
+    if (document.getElementById('resetPassword').value ==='true' && document.getElementById('user').value !== document.getElementById('password').value){
+        setLoginMessage('Error', errorSamePassword, errorDifferentPasswordInFields);
+        return true;
+    }
     if (focusedWindowElement.id === 'user' && document.getElementById('user').value !== '' && document.getElementById('password').value === '') {
       setTimeout(function() { // To manage browser autocomplete feature if it is active
        if (focusedWindowElement.id === 'user' && document.getElementById('password').value === '') {
@@ -201,12 +207,17 @@
       setWindowElementFocus(document.getElementById('user'))
     } else {
       if (document.getElementById('user').value === '' || document.getElementById('password').value === '') {
-          setLoginMessage('Error', identificationFailureTitle, errorEmptyContent);
+        setLoginMessage('Error', identificationFailureTitle, errorEmptyContent);
         return true;
-      }     
+      }   
       disableButton('buttonOK');
-      submitXmlHttpRequest(loginResult, document.frmIdentificacion, 'DEFAULT', '../secureApp/LoginHandler.html', false, null, null);
+      if (document.getElementById('resetPassword').value ==='true'){
+        submitXmlHttpRequest(loginResult, document.frmIdentificacion, 'FORCE_RESET_PASSWORD', '../secureApp/LoginHandler.html', false, null, null);
+      }else{
+        submitXmlHttpRequest(loginResult, document.frmIdentificacion, 'DEFAULT', '../secureApp/LoginHandler.html', false, null, null);
+      }
     }
+    
     return false;
   }
 
@@ -230,7 +241,15 @@
         document.getElementById('password').value = '';
       }
     }
-
+    if (result.resetPassword ){
+      document.getElementById('resetPassword').value=result.resetPassword;
+      document.getElementById('user').value = '';
+      document.getElementById('user').type = 'password';
+      document.getElementById('userlabel').style.display = 'none';
+      document.getElementById('passwordlabel').style.display = 'none';
+      document.getElementById('newpasswordlabel').style.display = '';
+      document.getElementById('confirmpasswordlabel').style.display = '';
+    }
     if (shouldContinue) {
       try {
         if (parent.frameMenu) {
@@ -243,6 +262,10 @@
       }
       command = result.command || 'DEFAULT';
       submitCommandForm(command, false, null, result.target, target, true);
+    }else if (result.resetPassword){
+      enableButton('buttonOK');
+      document.getElementById('user').value = '';
+      setWindowElementFocus('user', 'id');
     } else {
       enableButton('buttonOK');
       setWindowElementFocus('password', 'id');
@@ -455,20 +478,26 @@
       <div class="Login_LogForm">
         <form method="post" action="../secureApp/LoginHandler.html" name="frmIdentificacion" id="frmFormulario" autocomplete="off">
           <input type="hidden" name="Command" value="" />
-
+          <input type="hidden" name="resetPassword" id="resetPassword" value="" />
           <div class="Login_LogForm_CompanyLogo_Container">
             <div class="Login_LogForm_CompanyLogo" id="CompanyLogo_Container" style="display: none;"><img class="Login_Logo_Company" src="../../../../../web/images/blank.gif" /></div>
           </div>
           <div class="Login_LogForm_Input_Container">
             <dl>
               <dt>
-                <label for="user" class="LabelText Login_LabelText">User Name</label>
+                <label for="user" class="LabelText Login_LabelText" id="userlabel" >User Name</label>
+              </dt>
+              <dt>
+                <label for="user" class="LabelText Login_LabelText" id="newpasswordlabel" style="display:none;">New Password</label>
               </dt>
               <dd>
                 <input class="dojoValidateValid Login_TextBox" type="text" maxlength="60" name="user" id="user" />
               </dd>
               <dt>
-                <label for="password" class="LabelText Login_LabelText">Password</label>
+                <label for="password" class="LabelText Login_LabelText" id="passwordlabel" >Password</label>
+              </dt>
+              <dt>
+                <label for="password" class="LabelText Login_LabelText" id="confirmpasswordlabel" style="display:none;">Confirm Password</label>
               </dt>
               <dd>
                 <input class="dojoValidateValid Login_TextBox" type="password" maxlength="40" name="password" id="password" />
--- a/src/org/openbravo/erpCommon/security/Login.java	Wed Feb 24 18:05:08 2016 +0530
+++ b/src/org/openbravo/erpCommon/security/Login.java	Fri Feb 26 08:20:01 2016 +0100
@@ -86,11 +86,14 @@
             "IDENTIFICATION_FAILURE_TITLE", systemClient.getLanguage().getLanguage());
         final String emptyUsernameOrPasswordText = Utility.messageBD(this,
             "EMPTY_USERNAME_OR_PASSWORD_TEXT", systemClient.getLanguage().getLanguage());
-
+        final String errorSamePassword = Utility.messageBD(this, "CPSamePassword", systemClient
+            .getLanguage().getLanguage());
+        final String errorDifferentPasswordInFields = Utility.messageBD(this,
+            "CPDifferentPasswordInFields", systemClient.getLanguage().getLanguage());
         if (OBVersion.getInstance().is30()) {
           printPageLogin30(vars, response, strTheme, cacheMsg, validBrowserMsg, orHigherMsg,
               recBrowserMsgTitle, recBrowserMsgText, identificationFailureTitle,
-              emptyUsernameOrPasswordText);
+              emptyUsernameOrPasswordText, errorSamePassword, errorDifferentPasswordInFields);
         } else {
           printPageLogin250(response, strTheme, cacheMsg, validBrowserMsg, orHigherMsg);
         }
@@ -246,7 +249,8 @@
   private void printPageLogin30(VariablesSecureApp vars, HttpServletResponse response,
       String strTheme, String cacheMsg, String validBrowserMsg, String orHigherMsg,
       String recBrowserMsgTitle, String recBrowserMsgText, String identificationFailureTitle,
-      String emptyUsernameOrPasswordText) throws IOException, ServletException {
+      String emptyUsernameOrPasswordText, String errorSamePassword,
+      String errorDifferentPasswordInFields) throws IOException, ServletException {
 
     boolean showForgeLogo = true;
     boolean showITLogo = false;
@@ -324,6 +328,14 @@
     xmlDocument.setParameter("errorEmptyContent",
         emptyUserNameOrPasswordFinal.replaceAll("\\n", "\n"));
 
+    String errorSamePasswordFinal = "var errorSamePassword = \"" + errorSamePassword + "\"";
+    xmlDocument.setParameter("errorSamePassword", errorSamePasswordFinal.replaceAll("\\n", "\n"));
+
+    String errorDifferentPasswordInFieldsFinal = "var errorDifferentPasswordInFields = \""
+        + errorDifferentPasswordInFields + "\"";
+    xmlDocument.setParameter("errorDifferentPasswordInFields",
+        errorDifferentPasswordInFieldsFinal.replaceAll("\\n", "\n"));
+
     String validBrowserMsgFinal = "var validBrowserMsg = \"" + validBrowserMsg + "\"";
     String orHigherMsgFinal = "var validBrowserMsgOrHigher = \"" + orHigherMsg + "\"";
     xmlDocument.setParameter("validBrowserMsg", validBrowserMsgFinal.replaceAll("\\n", "\n"));
--- a/src/org/openbravo/erpCommon/security/Login.xml	Wed Feb 24 18:05:08 2016 +0530
+++ b/src/org/openbravo/erpCommon/security/Login.xml	Fri Feb 26 08:20:01 2016 +0100
@@ -34,5 +34,7 @@
   <PARAMETER id="errorMsgContent" name="errorMsgContent" default="" />
   <PARAMETER id="identificationFailureTitle" name="identificationFailureTitle" default="" />
   <PARAMETER id="errorEmptyContent" name="errorEmptyContent" default="" />
+  <PARAMETER id="errorSamePassword" name="errorSamePassword" default="" />
+  <PARAMETER id="errorDifferentPasswordInFields" name="errorDifferentPasswordInFields" default="" />
   <PARAMETER id="sign-in" name="sign-in" default=""/>
 </REPORT>