In your theme folder create a locale/[locale_code]/translate.csv
file.
Example: app/design/frontend/[package]/[theme]/locale/en_US/translate.csv
And add this line:
"Please make sure your passwords match.","Translated String."
And finally refresh Translations
cache.
You can use below regular expression.
(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{8,}$/)
Explanation of this expression is
(/^
(?=.*\d) //should contain at least one digit
(?=.*[a-z]) //should contain at least one lower case
(?=.*[A-Z]) //should contain at least one upper case
[a-zA-Z0-9]{8,} //should contain at least 8 from the mentioned characters
$/)
You can replace line
return !(pass.length>0 && pass.length < 8);
with
if (!(/^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])([a-zA-Z0-9]{8,})$/.test(pass))) {
return false;
}
return true;
And change error message related to expression. You can do same for admin password.
For special character you can use below regular expression.
Minimum 8 characters at least 1 Uppercase Alphabet, 1 Lowercase Alphabet, 1 Number and 1 Special Character from amongst these $@$!%*?&#^ .
"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&])([A-Za-z\d$@$!%*?&#^]{8,})"
You can use it like this way
if (!(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&#^])([A-Za-z\d$@$!%*?&#^]{8,})$/.test(pass))) {
return false;
}
return true;
Best Answer
The request is processing by customer account controller
Mage_Customer_AccountController::loginPostAction()
. File location isDig from here. I think the error that is generated when password do not match in customer model. ie
Mage_Customer_Model_Customer::authenticate()
. There you can see this partFile:
app/code/core/Mage/Customer/Model/Customer.php
Dig more with this info