Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
varun kashyap
UserLocalServiceUtil.addUser() why do we have password1 password2 fields?
November 19, 2012 3:46 AM
Answer

varun kashyap

Rank: New Member

Posts: 1

Join Date: November 19, 2012

Recent Posts

Hi
In UserLocalServiceUtil.addUser() method ,w e have two input parameters , pasword1 and password2 . What is the significance of this?
Do the two needs to be always same? I have seen few codes over internet where people have used different values.
What is the ideal solution here?
Hitoshi Ozawa
RE: UserLocalServiceUtil.addUser() why do we have password1 password2 field
November 19, 2012 3:51 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

I think password1 is the password field in the password page while password2 is password confirmation.
Apoorva Prakash
RE: UserLocalServiceUtil.addUser() why do we have password1 password2 field
November 19, 2012 4:34 AM
Answer

Apoorva Prakash

Rank: Liferay Master

Posts: 659

Join Date: June 15, 2010

Recent Posts

Hi Varun,

You can see the following code snippet in validate() method (with some arguments) of class com.liferay.portal.security.pwd.PwdToolkitUtil:

1if (!password1.equals(password2)) {
2    throw new UserPasswordException(
3        UserPasswordException.PASSWORDS_DO_NOT_MATCH);
4}

This method is called from several places for the purpose of validation.

Hope this will help.

Thanks and Regards,
Apoorva Prakash