Uploaded image for project: 'OpenOLAT'
  1. OpenOLAT
  2. OO-3328

Registration mail can only be sent once

    XMLWordPrintable

    Details

      Description

      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);
      
      

        Attachments

          Activity

            People

            Assignee:
            uhensler Urs Hensler
            Reporter:
            stephan Stephan Clemenz
            Tester:
            Mandy Menzel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 10 minutes
                1h 10m