Author: jacopoc
Date: Thu Jun 21 03:20:43 2007
New Revision: 549443

URL: http://svn.apache.org/viewvc?view=rev&rev=549443
Log:
When a password is updated, added check to verify that the new password is 
different from the old one.
Also moved a a few of labels that were in the wrong component.

Modified:
    ofbiz/trunk/applications/securityext/config/SecurityextUiLabels.properties
    ofbiz/trunk/framework/common/config/CommonUiLabels.properties
    ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java

Modified: 
ofbiz/trunk/applications/securityext/config/SecurityextUiLabels.properties
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/securityext/config/SecurityextUiLabels.properties?view=diff&rev=549443&r1=549442&r2=549443
==============================================================================
--- ofbiz/trunk/applications/securityext/config/SecurityextUiLabels.properties 
(original)
+++ ofbiz/trunk/applications/securityext/config/SecurityextUiLabels.properties 
Thu Jun 21 03:20:43 2007
@@ -66,40 +66,6 @@
 loginevents.new_password_createdandsent_check_email=A new password has been 
created and sent to you. Please check your Email.
 loginevents.new_password_sent_check_email=Your password has been sent to you. 
Please check your Email.
 
-loginservices.username_missing=Username missing.
-loginservices.password_missing=Password missing.
-loginservices.password_incorrect=Password incorrect.
-# ${username} = Login ID
-loginservices.account_for_user_login_id_disabled=The account for user login id 
"${username}" has been disabled.
-# ${disabledDateTime} = Date and Time
-loginservices.since_datetime=since ${disabledDateTime}.
-# ${reEnableTime} = Date and Time
-loginservices.will_be_reenabled=It will be re-enabled ${reEnableTime}.
-loginservices.not_scheduled_to_be_reenabled=It is not scheduled to be 
re-enabled.
-loginservices.user_not_found=User not found.
-loginservices.party_with_specified_party_ID_exists_not_have_permission=Party 
with specified party ID exists and you do not have permission to create a user 
login with this party ID.
-loginservices.must_be_logged_in_and_permission_create_login_party_ID_exists=You
 must be logged in and have permission to create a user login with a party ID 
for a party that already exists.
-# ${userLoginId} = Login Id of user
-loginservices.could_not_create_login_user_with_ID_exists=Could not create 
login user: user with ID "${userLoginId}" already exists.
-# ${errorMessage} = Error Description
-loginservices.could_not_create_login_user_read_failure=Could not create login 
user (read failure): ${errorMessage}.
-loginservices.could_not_create_login_user_write_failure=Could create login 
user (write failure): ${errorMessage}.
-loginservices.not_have_permission_update_password_for_user_login=You do not 
have permission to update the password for this user login.
-loginservices.could_not_change_password_read_failure=Could not change password 
(read failure): ${errorMessage}.
-loginservices.could_not_change_password_userlogin_with_id_not_exist=Could not 
change password, UserLogin with ID "${userLoginId}" does not exist.
-loginservices.could_not_change_password_write_failure=Could not change 
password (write failure): ${errorMessage}.
-loginservices.party_with_party_id_exists_not_permission_create_user_login=Party
 with specified party ID exists and you do not have permission to create a user 
login with this party ID.
-loginservices.must_logged_in_have_permission_create_user_login_exists=You must 
be logged in and have permission to create a user login with a party ID for a 
party that already exists.
-loginservices.could_not_create_login_user_write_failure=Couldn't create login 
user (write failure): ${errorMessage}.
-loginservices.could_not_disable_old_login_user_write_failure=Couldn't disable 
old login user (write failure): ${errorMessage}.
-loginservices.not_permission_update_security_info_for_user_login=You do not 
have permission to update the security info for this user login.
-loginservices.old_password_not_correct_reenter=Old Password was not correct, 
please re-enter.
-loginservices.password_or_verify_missing=Password or verify password missing.
-loginservices.password_did_not_match_verify_password=Password did not match 
verify password.
-loginservices.password_must_be_least_characters_long=Password must be at least 
${minPasswordLength} characters long.
-loginservices.password_may_not_equal_username=Password may not equal the 
Username.
-loginservices.password_hint_may_not_contain_password=Password hint may not 
contain the password.
-
 loginmapprocs.old_password_missing=The (old) Password is missing.
 loginmapprocs.new_password_missing=New Password is missing.
 loginmapprocs.password_not_equal_verfiy_password=New Password does not equal 
Verfiy Password

Modified: ofbiz/trunk/framework/common/config/CommonUiLabels.properties
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/CommonUiLabels.properties?view=diff&rev=549443&r1=549442&r2=549443
==============================================================================
--- ofbiz/trunk/framework/common/config/CommonUiLabels.properties (original)
+++ ofbiz/trunk/framework/common/config/CommonUiLabels.properties Thu Jun 21 
03:20:43 2007
@@ -535,3 +535,38 @@
 pt_BR=Portuguese Brazil
 pt_PT=Portuguese Portugal
 zh=Chinese
+
+loginservices.username_missing=Username missing.
+loginservices.password_missing=Password missing.
+loginservices.password_incorrect=Password incorrect.
+# ${username} = Login ID
+loginservices.account_for_user_login_id_disabled=The account for user login id 
"${username}" has been disabled.
+# ${disabledDateTime} = Date and Time
+loginservices.since_datetime=since ${disabledDateTime}.
+# ${reEnableTime} = Date and Time
+loginservices.will_be_reenabled=It will be re-enabled ${reEnableTime}.
+loginservices.not_scheduled_to_be_reenabled=It is not scheduled to be 
re-enabled.
+loginservices.user_not_found=User not found.
+loginservices.party_with_specified_party_ID_exists_not_have_permission=Party 
with specified party ID exists and you do not have permission to create a user 
login with this party ID.
+loginservices.must_be_logged_in_and_permission_create_login_party_ID_exists=You
 must be logged in and have permission to create a user login with a party ID 
for a party that already exists.
+# ${userLoginId} = Login Id of user
+loginservices.could_not_create_login_user_with_ID_exists=Could not create 
login user: user with ID "${userLoginId}" already exists.
+# ${errorMessage} = Error Description
+loginservices.could_not_create_login_user_read_failure=Could not create login 
user (read failure): ${errorMessage}.
+loginservices.could_not_create_login_user_write_failure=Could create login 
user (write failure): ${errorMessage}.
+loginservices.not_have_permission_update_password_for_user_login=You do not 
have permission to update the password for this user login.
+loginservices.could_not_change_password_read_failure=Could not change password 
(read failure): ${errorMessage}.
+loginservices.could_not_change_password_userlogin_with_id_not_exist=Could not 
change password, UserLogin with ID "${userLoginId}" does not exist.
+loginservices.could_not_change_password_write_failure=Could not change 
password (write failure): ${errorMessage}.
+loginservices.party_with_party_id_exists_not_permission_create_user_login=Party
 with specified party ID exists and you do not have permission to create a user 
login with this party ID.
+loginservices.must_logged_in_have_permission_create_user_login_exists=You must 
be logged in and have permission to create a user login with a party ID for a 
party that already exists.
+loginservices.could_not_create_login_user_write_failure=Couldn't create login 
user (write failure): ${errorMessage}.
+loginservices.could_not_disable_old_login_user_write_failure=Couldn't disable 
old login user (write failure): ${errorMessage}.
+loginservices.new_password_is_equal_to_old_password=The new password must be 
different from the old one.
+loginservices.not_permission_update_security_info_for_user_login=You do not 
have permission to update the security info for this user login.
+loginservices.old_password_not_correct_reenter=Old Password was not correct, 
please re-enter.
+loginservices.password_or_verify_missing=Password or verify password missing.
+loginservices.password_did_not_match_verify_password=Password did not match 
verify password.
+loginservices.password_must_be_least_characters_long=Password must be at least 
${minPasswordLength} characters long.
+loginservices.password_may_not_equal_username=Password may not equal the 
Username.
+loginservices.password_hint_may_not_contain_password=Password hint may not 
contain the password.

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?view=diff&rev=549443&r1=549442&r2=549443
==============================================================================
--- ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java 
(original)
+++ ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java 
Thu Jun 21 03:20:43 2007
@@ -727,6 +727,11 @@
                 errMsg = 
UtilProperties.getMessage(resource,"loginservices.old_password_not_correct_reenter",
 locale);
                 errorMessageList.add(errMsg);
             }
+            if (currentPassword.equals(newPassword) || 
realPassword.equals(newPassword)) {
+                errMsg = 
UtilProperties.getMessage(resource,"loginservices.new_password_is_equal_to_old_password",
 locale);
+                errorMessageList.add(errMsg);
+            }
+
         }
 
         if (!UtilValidate.isNotEmpty(newPassword) || 
!UtilValidate.isNotEmpty(newPasswordVerify)) {


Reply via email to