From cb910d298d4fd251784f00f669fb8d7b98ff1335 Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Thu, 27 Sep 2012 15:22:39 +0800 Subject: [PATCH] IDEMPIERE-373 Implement User Locking - fix login error message --- .../oracle/919_IDEMPIERE-373_User_Locking.sql | 22 +++++++++++++++++++ .../919_IDEMPIERE-373_User_Locking.sql | 22 +++++++++++++++++++ .../src/org/compiere/util/Login.java | 4 ++-- 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 migration/360lts-release/oracle/919_IDEMPIERE-373_User_Locking.sql create mode 100644 migration/360lts-release/postgresql/919_IDEMPIERE-373_User_Locking.sql diff --git a/migration/360lts-release/oracle/919_IDEMPIERE-373_User_Locking.sql b/migration/360lts-release/oracle/919_IDEMPIERE-373_User_Locking.sql new file mode 100644 index 0000000000..6f1da9c4ce --- /dev/null +++ b/migration/360lts-release/oracle/919_IDEMPIERE-373_User_Locking.sql @@ -0,0 +1,22 @@ +-- Sep 27, 2012 12:32:31 PM SGT +-- IDEMPIERE-373 Implement User Locking +UPDATE AD_Message SET MsgText='Reached the maximum number of login attempts, user account ({0}) is locked',Updated=TO_DATE('2012-09-27 12:32:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200033 +; + +-- Sep 27, 2012 12:32:31 PM SGT +-- IDEMPIERE-373 Implement User Locking +UPDATE AD_Message_Trl SET IsTranslated='N' WHERE AD_Message_ID=200033 +; + +-- Sep 27, 2012 12:32:59 PM SGT +-- IDEMPIERE-373 Implement User Locking +UPDATE AD_Message SET MsgText='User account ({0}) is locked, please contact the system administrator',Updated=TO_DATE('2012-09-27 12:32:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200032 +; + +-- Sep 27, 2012 12:32:59 PM SGT +-- IDEMPIERE-373 Implement User Locking +UPDATE AD_Message_Trl SET IsTranslated='N' WHERE AD_Message_ID=200032 +; + +SELECT register_migration_script('919_IDEMPIERE-373_User_Locking.sql') FROM dual +; diff --git a/migration/360lts-release/postgresql/919_IDEMPIERE-373_User_Locking.sql b/migration/360lts-release/postgresql/919_IDEMPIERE-373_User_Locking.sql new file mode 100644 index 0000000000..abd7b3ec57 --- /dev/null +++ b/migration/360lts-release/postgresql/919_IDEMPIERE-373_User_Locking.sql @@ -0,0 +1,22 @@ +-- Sep 27, 2012 12:32:31 PM SGT +-- IDEMPIERE-373 Implement User Locking +UPDATE AD_Message SET MsgText='Reached the maximum number of login attempts, user account ({0}) is locked',Updated=TO_TIMESTAMP('2012-09-27 12:32:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200033 +; + +-- Sep 27, 2012 12:32:31 PM SGT +-- IDEMPIERE-373 Implement User Locking +UPDATE AD_Message_Trl SET IsTranslated='N' WHERE AD_Message_ID=200033 +; + +-- Sep 27, 2012 12:32:59 PM SGT +-- IDEMPIERE-373 Implement User Locking +UPDATE AD_Message SET MsgText='User account ({0}) is locked, please contact the system administrator',Updated=TO_TIMESTAMP('2012-09-27 12:32:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=200032 +; + +-- Sep 27, 2012 12:32:59 PM SGT +-- IDEMPIERE-373 Implement User Locking +UPDATE AD_Message_Trl SET IsTranslated='N' WHERE AD_Message_ID=200032 +; + +SELECT register_migration_script('919_IDEMPIERE-373_User_Locking.sql') FROM dual +; diff --git a/org.adempiere.base/src/org/compiere/util/Login.java b/org.adempiere.base/src/org/compiere/util/Login.java index db1f9d9cbc..4c74695bca 100644 --- a/org.adempiere.base/src/org/compiere/util/Login.java +++ b/org.adempiere.base/src/org/compiere/util/Login.java @@ -1468,7 +1468,7 @@ public class Login { if (user.isLocked()) { - // User account '{0}' is locked, please contact the system administrator + // User account ({0}) is locked, please contact the system administrator loginErrMsg = Msg.getMsg(m_ctx, "UserAccountLocked", new Object[] {app_user}); break; } @@ -1479,7 +1479,7 @@ public class Login int MAX_LOGIN_ATTEMPT = MSysConfig.getIntValue(MSysConfig.USER_LOCKING_MAX_LOGIN_ATTEMPT, 0); if (MAX_LOGIN_ATTEMPT > 0 && count >= MAX_LOGIN_ATTEMPT) { - // Reached the maximum number of login attempts, user account '{0}' is locked + // Reached the maximum number of login attempts, user account ({0}) is locked loginErrMsg = Msg.getMsg(m_ctx, "ReachedMaxLoginAttempts", new Object[] {app_user}); reachMaxAttempt = true; }