From dc1864f98307fad3a36b958c3a4f69b3cf075178 Mon Sep 17 00:00:00 2001 From: Gil Portenseigne Date: Tue, 7 Aug 2018 09:35:23 +0000 Subject: [PATCH] Fixed: Initial set of hasLoggedOut flag when logging in (OFBIZ-10506) Thanks Dennis for your patch git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1837585 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/ofbiz/common/login/LoginServices.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java b/framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java index 2fe4dfe424..8d2ebe2970 100644 --- a/framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java +++ b/framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java @@ -189,8 +189,7 @@ public class LoginServices { "Y".equalsIgnoreCase(userLogin.getString("isSystem")) : false; // grab the hasLoggedOut flag - boolean hasLoggedOut = userLogin.get("hasLoggedOut") != null ? - "Y".equalsIgnoreCase(userLogin.getString("hasLoggedOut")) : false; + Boolean hasLoggedOut = userLogin.getBoolean("hasLoggedOut"); if ((UtilValidate.isEmpty(userLogin.getString("enabled")) || "Y".equals(userLogin.getString("enabled")) || (reEnableTime != null && reEnableTime.before(UtilDateTime.nowTimestamp())) || (isSystem)) && UtilValidate.isEmpty(userLogin.getString("disabledBy"))) { @@ -228,7 +227,7 @@ public class LoginServices { Debug.logVerbose("[LoginServices.userLogin] : Password Matched", module); // update the hasLoggedOut flag - if (hasLoggedOut) { + if (hasLoggedOut == null || hasLoggedOut) { userLogin.set("hasLoggedOut", "N"); } @@ -236,7 +235,7 @@ public class LoginServices { Long currentFailedLogins = userLogin.getLong("successiveFailedLogins"); if (currentFailedLogins != null && currentFailedLogins.longValue() > 0) { userLogin.set("successiveFailedLogins", Long.valueOf(0)); - } else if (!hasLoggedOut) { + } else if (hasLoggedOut != null && !hasLoggedOut) { // successful login & no loggout flag, no need to change anything, so don't do the store doStore = false; }