diff --git a/src/main/java/org/olat/registration/RegistrationController.java b/src/main/java/org/olat/registration/RegistrationController.java index 09d644e22932ba948cee3f7b66714cf69370a60e..1898cfe813d3f195c9946d33ad4554d063975113 100644 --- a/src/main/java/org/olat/registration/RegistrationController.java +++ b/src/main/java/org/olat/registration/RegistrationController.java @@ -303,7 +303,7 @@ public class RegistrationController extends BasicController implements Activatea }; boolean isMailSent = false; - if (UserManager.getInstance().isEmailAllowed(email)) { + if (registrationManager.isRegistrationPending(email) || UserManager.getInstance().isEmailAllowed(email)) { TemporaryKey tk = null; if (userModule.isEmailUnique()) { tk = registrationManager.loadTemporaryKeyByEmail(email); diff --git a/src/main/java/org/olat/registration/RegistrationManager.java b/src/main/java/org/olat/registration/RegistrationManager.java index 96de61bc0634baec46f81e0e92cc580351609dd2..59b5d03f620dc9972afb98348c9d4a8e32632f16 100644 --- a/src/main/java/org/olat/registration/RegistrationManager.java +++ b/src/main/java/org/olat/registration/RegistrationManager.java @@ -370,18 +370,21 @@ public class RegistrationManager { } } } - tk = loadTemporaryKeyByAction(RegistrationManager.REGISTRATION); - if (tk != null) { - for (TemporaryKey temporaryKey : tk) { + return isRegistrationPending(emailAddress); + } + + public boolean isRegistrationPending(String emailAddress) { + List<TemporaryKey> temporaryKeys = loadTemporaryKeyByAction(RegistrationManager.REGISTRATION); + if (temporaryKeys != null) { + for (TemporaryKey temporaryKey : temporaryKeys) { if (emailAddress.equalsIgnoreCase(temporaryKey.getEmailAddress())) { return true; } } } - return false; } - + /** * Evaluates whether the given identity needs to accept a disclaimer before * logging in or not.