akosthurzo/liferay-portal — pull request #13 by vilmospapp (2014-04-03 10:21:05+00:00)
Title: LPS-45580 LDAP Export doesn't work when e-mail address verification is required

Hi Ákos,

This issue is occurs when e-mail address verification is turned on. Since then, if an e-mail address is changed the user cannot verify it, as in the background the portal tries to find the user from LDAP to be modified by the new e-mail address, but it's not yet saved to LDAP, but the user object has the new e-mail address . So the resolution is to keep the original e-mail address to find the user from LDAP if the user is not found with the actual e-mail address. As it's called from a listener where we cannot break the API and pass another argument but the User, I used ServiceContext and the ServiceContextThreadLocal to keep this information.

Please review my changes.

If you have any concerns/questions, please let me know.

Cheers,
Vili