-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 12.2.5, 12.3
-
Fix Version/s: 12.3.2
-
Component/s: DMZ, Registration, Login
-
Labels:None
-
Funded by:
If self registration is enabled the registration mail can only be sent once. This is because of the check "UserManager.getInstance().isEmailAllowed(email)". This checks also for existing mails in o_temporarykey. This is useless because if the mail address exists in this table, the registration mail will be sent again with the existing registration key. With the following patch a registration mail can be sent multiple times. It checks only for existing addresses in Olat:
diff --git a/src/main/java/org/olat/registration/RegistrationController.java b/src/main/java/org/olat/registration/RegistrationController.java --- a/src/main/java/org/olat/registration/RegistrationController.java +++ b/src/main/java/org/olat/registration/RegistrationController.java @@ -72,6 +72,7 @@ import org.olat.core.util.mail.MailManager; import org.olat.core.util.mail.MailerResult; import org.olat.dispatcher.LocaleNegotiator; +import org.olat.user.UserDAO; import org.olat.user.UserManager; import org.olat.user.UserModule; import org.olat.user.UserPropertiesConfig; @@ -115,6 +116,8 @@ private RegistrationModule registrationModule; @Autowired private RegistrationManager registrationManager; + @Autowired + private UserDAO userDAO; // <VCRP> private String institutionalName; @@ -311,7 +314,7 @@ }; boolean isMailSent = false; - if (UserManager.getInstance().isEmailAllowed(email)) { + if (email != null && !userDAO.isEmailInUse(email)) { TemporaryKey tk = null; if (userModule.isEmailUnique()) { tk = registrationManager.loadTemporaryKeyByEmail(email);