Implemented 'Require Password Change' in ecommerce and manager apps: if the new field in the UserLogin entity is set to Y then, before the login, the user will be prompted for a new password.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@549406 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacopo Cappellato
2007-06-21 06:20:53 +00:00
parent d67eb76587
commit 4e8e2dac8e
45 changed files with 432 additions and 5 deletions
@@ -362,6 +362,7 @@ public class LoginServices {
String currentPasswordVerify = (String) context.get("currentPasswordVerify");
String enabled = (String) context.get("enabled");
String passwordHint = (String) context.get("passwordHint");
String requirePasswordChange = (String) context.get("requirePasswordChange");
String errMsg = null;
// security: don't create a user login if the specified partyId (if not empty) already exists
@@ -397,6 +398,7 @@ public class LoginServices {
GenericValue userLoginToCreate = delegator.makeValue("UserLogin", UtilMisc.toMap("userLoginId", userLoginId));
userLoginToCreate.set("passwordHint", passwordHint);
userLoginToCreate.set("enabled", enabled);
userLoginToCreate.set("requirePasswordChange", requirePasswordChange);
userLoginToCreate.set("partyId", partyId);
userLoginToCreate.set("currentPassword", useEncryption ? getPasswordHash(currentPassword) : currentPassword);
@@ -503,6 +505,7 @@ public class LoginServices {
userLoginToUpdate.set("currentPassword", useEncryption ? getPasswordHash(newPassword) : newPassword, false);
userLoginToUpdate.set("passwordHint", passwordHint, false);
userLoginToUpdate.set("requirePasswordChange", "N");
try {
userLoginToUpdate.store();