topolik/liferay-portal — pull request #103 by lipusz (2014-10-16 15:14:46+00:00)
Title: [TECHNICAL-SUPPORT] LPS-50794 When LDAP export and e-mail verification is enabled verification e-mail is sent twice

https://issues.liferay.com/browse/LPS-50794

Hi Tomáš,

The 2nd verification is triggered by an LDAP import, because when the user creates its account, it will be exported to LDAP and the modified date will be different than the one in the portal, so when the user attempts to login with the temp password (received in email), an LDAP import will be started and

````java
protected User importUser(
long ldapServerId, long companyId, Attributes attributes,
Properties userMappings, Properties userExpandoMappings,
Properties contactMappings, Properties contactExpandoMappings,
String password)
throws Exception {
// ...
String modifiedDate = LDAPUtil.getAttributeString(
attributes, "modifyTimestamp");

user = updateUser(
companyId, ldapUser, user, userMappings, contactMappings,
password, modifiedDate, isNew);
// ...
}
````

will hit
````java
ULSI#sendEmailAddressVerification
````
, again.

Regards,
Tibor

/cc @NorbertKocsis
@topolik

Final diff: https://github.com/lipusz/liferay-portal/compare/044bb769805c5ec1a19fc8104170c966151e1325...118c09c3634607df388ec4272cf72d977ada9ef2