diff --git a/migration/i5.1/oracle/201803011003_IDEMPIERE-1800.sql b/migration/i5.1/oracle/201803011003_IDEMPIERE-1800.sql new file mode 100644 index 0000000000..8bf10a7066 --- /dev/null +++ b/migration/i5.1/oracle/201803011003_IDEMPIERE-1800.sql @@ -0,0 +1,11 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Mar 1, 2018 10:02:34 AM CET +-- IDEMPIERE-1298 2Pack: Support copying of data from one client to another +UPDATE AD_Val_Rule SET Code='AD_User.AD_Client_ID=@#AD_Client_ID@ AND AD_User.IsLocked=''Y''',Updated=TO_DATE('2018-03-01 10:02:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=200067 +; + +SELECT register_migration_script('201803011003_IDEMPIERE-1800.sql') FROM dual +; + diff --git a/migration/i5.1/postgresql/201803011003_IDEMPIERE-1800.sql b/migration/i5.1/postgresql/201803011003_IDEMPIERE-1800.sql new file mode 100644 index 0000000000..8562930640 --- /dev/null +++ b/migration/i5.1/postgresql/201803011003_IDEMPIERE-1800.sql @@ -0,0 +1,8 @@ +-- Mar 1, 2018 10:02:34 AM CET +-- IDEMPIERE-1298 2Pack: Support copying of data from one client to another +UPDATE AD_Val_Rule SET Code='AD_User.AD_Client_ID=@#AD_Client_ID@ AND AD_User.IsLocked=''Y''',Updated=TO_TIMESTAMP('2018-03-01 10:02:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=200067 +; + +SELECT register_migration_script('201803011003_IDEMPIERE-1800.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java b/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java index 2a4f5282d2..a50fd3aa0f 100644 --- a/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java +++ b/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java @@ -50,7 +50,6 @@ public class ResetLockedAccount extends SvrProcess { StringBuilder sql = new StringBuilder ("UPDATE AD_User SET IsLocked = 'N', DateAccountLocked=NULL, FailedLoginCount=0, DateLastLogin=NULL, Updated=SysDate ") .append(" WHERE IsLocked='Y' AND AD_Client_ID = ? ") - .append(" AND DateAccountLocked IS NOT NULL ") .append(" AND AD_User_ID = " + user.getAD_User_ID()); int no = DB.executeUpdate(sql.toString(), new Object[] { p_AD_Client_ID }, false, get_TrxName()); if (no <= 0) @@ -65,8 +64,7 @@ public class ResetLockedAccount extends SvrProcess { int MAX_INACTIVE_PERIOD = MSysConfig.getIntValue(MSysConfig.USER_LOCKING_MAX_INACTIVE_PERIOD_DAY, 0); StringBuilder sql = new StringBuilder("UPDATE AD_User SET IsLocked = 'N', DateAccountLocked=NULL, FailedLoginCount=0, DateLastLogin=NULL, Updated=SysDate ") - .append(" WHERE IsLocked='Y' AND AD_Client_ID = ? ") - .append(" AND DateAccountLocked IS NOT NULL"); + .append(" WHERE IsLocked='Y' AND AD_Client_ID = ? "); if (DB.isPostgreSQL()) {