Prevent user to send merge request email to itself
This commit is contained in:
parent
5d01519415
commit
f5533e1b95
|
@ -69,6 +69,7 @@ public class MergeEmailConfirmationManager {
|
||||||
public void sendConfirmationEmail(String email, Principal principal, UUID userId, Integer provider) throws HasConfirmedEmailException {
|
public void sendConfirmationEmail(String email, Principal principal, UUID userId, Integer provider) throws HasConfirmedEmailException {
|
||||||
UserInfo user = apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao().find(principal.getId());
|
UserInfo user = apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao().find(principal.getId());
|
||||||
|
|
||||||
|
if (user.getEmail() != null && !user.getEmail().equals(email)) {
|
||||||
apiContext.getUtilitiesService().getConfirmationEmailService().createMergeConfirmationEmail(
|
apiContext.getUtilitiesService().getConfirmationEmailService().createMergeConfirmationEmail(
|
||||||
databaseRepository.getLoginConfirmationEmailDao(),
|
databaseRepository.getLoginConfirmationEmailDao(),
|
||||||
apiContext.getUtilitiesService().getMailService(),
|
apiContext.getUtilitiesService().getMailService(),
|
||||||
|
@ -78,6 +79,7 @@ public class MergeEmailConfirmationManager {
|
||||||
provider
|
provider
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
private void mergeNewUserToOld(UserInfo newUser, UserInfo oldUser, Integer provider) {
|
private void mergeNewUserToOld(UserInfo newUser, UserInfo oldUser, Integer provider) {
|
||||||
|
|
Loading…
Reference in New Issue