You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2009/02/07 13:28:48 UTC

svn commit: r741886 - /ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java

Author: jacopoc
Date: Sat Feb  7 12:28:48 2009
New Revision: 741886

URL: http://svn.apache.org/viewvc?rev=741886&view=rev
Log:
Fixed bug reported by deepak dixit in OFBIZ-2173: setting a blank password could messed up things.

Modified:
    ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java

Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java?rev=741886&r1=741885&r2=741886&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java (original)
+++ ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java Sat Feb  7 12:28:48 2009
@@ -566,7 +566,7 @@
         }
 
         List<String> errorMessageList = FastList.newInstance();
-        if (newPassword != null && newPassword.length() > 0) {
+        if (newPassword != null) {
             checkNewPassword(userLoginToUpdate, currentPassword, newPassword, newPasswordVerify,
                 passwordHint, errorMessageList, adminUser, locale);
         }
@@ -823,6 +823,14 @@
 
         }
 
+        if (!UtilValidate.isNotEmpty(newPassword) || !UtilValidate.isNotEmpty(newPasswordVerify)) {
+            errMsg = UtilProperties.getMessage(resource,"loginservices.password_or_verify_missing", locale);
+            errorMessageList.add(errMsg);
+        } else if (!newPassword.equals(newPasswordVerify)) {
+            errMsg = UtilProperties.getMessage(resource,"loginservices.password_did_not_match_verify_password", locale);
+            errorMessageList.add(errMsg);
+        }
+
         int passwordChangeHistoryLimit = 0;
         try {
             passwordChangeHistoryLimit = Integer.parseInt(UtilProperties.getPropertyValue("security.properties", "password.change.history.limit", "0"));
@@ -856,14 +864,6 @@
            
         }
 
-        if (!UtilValidate.isNotEmpty(newPassword) || !UtilValidate.isNotEmpty(newPasswordVerify)) {
-            errMsg = UtilProperties.getMessage(resource,"loginservices.password_or_verify_missing", locale);
-            errorMessageList.add(errMsg);
-        } else if (!newPassword.equals(newPasswordVerify)) {
-            errMsg = UtilProperties.getMessage(resource,"loginservices.password_did_not_match_verify_password", locale);
-            errorMessageList.add(errMsg);
-        }
-
         int minPasswordLength = 0;
 
         try {