From cb7b9a6471a7b52a292a400bef8ec4e416b8a0ca Mon Sep 17 00:00:00 2001 From: Hans Bakker Date: Tue, 5 Jul 2011 07:18:54 +0000 Subject: [PATCH] currently it is pretty difficult to disable a userlogin by setting the deleted date to a date in the future and enable=N, further when disable a party tries to disable related userlogins but does not set that future date. This change will allow to nullify the deleted date so it is now clear the userlogin will never be enabled. The deleted date is still available in the last modified date. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1142908 13f79535-47bb-0310-9956-ffa450edef68 --- .../party/src/org/ofbiz/party/party/PartyServices.java | 1 - .../common/src/org/ofbiz/common/login/LoginServices.java | 5 ----- 2 files changed, 6 deletions(-) diff --git a/applications/party/src/org/ofbiz/party/party/PartyServices.java b/applications/party/src/org/ofbiz/party/party/PartyServices.java index df377a0db1..4e7fc9e3f0 100644 --- a/applications/party/src/org/ofbiz/party/party/PartyServices.java +++ b/applications/party/src/org/ofbiz/party/party/PartyServices.java @@ -249,7 +249,6 @@ public class PartyServices { for(GenericValue userLogin : userLogins) { if (!"N".equals(userLogin.getString("enabled"))) { userLogin.set("enabled", "N"); - userLogin.set("disabledDateTime", UtilDateTime.nowTimestamp()); userLogin.store(); } } diff --git a/framework/common/src/org/ofbiz/common/login/LoginServices.java b/framework/common/src/org/ofbiz/common/login/LoginServices.java index a93908b3fd..6db254fdba 100644 --- a/framework/common/src/org/ofbiz/common/login/LoginServices.java +++ b/framework/common/src/org/ofbiz/common/login/LoginServices.java @@ -888,11 +888,6 @@ public class LoginServices { userLoginToUpdate.set("disabledDateTime", null); } - // if was enabled and we are disabling it, and no disabledDateTime was passed, set it to now - if (wasEnabled && "N".equals(context.get("enabled")) && context.get("disabledDateTime") == null) { - userLoginToUpdate.set("disabledDateTime", UtilDateTime.nowTimestamp()); - } - try { userLoginToUpdate.store(); } catch (GenericEntityException e) {