To enable user creation with duplicate email -id
If you don't have ant ext environment and still want to add this functionality leave me a note and I will send you steps for creating a separate jar and configurations to make your custom code work for your custom application.
For extension environment -- Write a new class in ext-environment
public class AbhishekUserLocalServiceImpl extends UserLocalServiceImpl
Now override two validate methods and make following changes
1. For method with signature
protected void validate(long userId, String screenName, String emailAddress, String firstName, String lastName, String smsSn)
remove ----> throw new DuplicateUserEmailAddressException();
from
if (userPersistence.fetchByC_EA(
user.getCompanyId(), emailAddress) != null) {
throw new DuplicateUserEmailAddressException();
}
2. For method with signature
protected void validate(long companyId, long userId, boolean autoPassword, String password1,String password2, boolean autoScreenName, String screenName, String emailAddress, String firstName, String lastName, long[] organizationIds)
remove --->throw new DuplicateUserEmailAddressException();
from
if (Validator.isNotNull(emailAddress)) {
User user = userPersistence.fetchByC_EA(companyId, emailAddress);
if (user != null) {
throw new DuplicateUserEmailAddressException();
}
}