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

A private email address should not be visible on auto generated mails

    XMLWordPrintable

    Details

      Description

      A group is configured with waiting list and automatic move up. If a student unenrolls from that group the first student in waiting list who moves up in the group gets an email. The senders address of that email is the private address of the student who unenrolled from that group. This is a privacy problem. In this case the senders address should be the systems default address.

      This patch fixes that:

      diff --git a/src/main/java/org/olat/group/manager/BusinessGroupServiceImpl.java b/src/main/java/org/olat/group/manager/BusinessGroupServiceImpl.java
      --- a/src/main/java/org/olat/group/manager/BusinessGroupServiceImpl.java
      +++ b/src/main/java/org/olat/group/manager/BusinessGroupServiceImpl.java
      @@ -1475,7 +1475,7 @@
       							mailing = new MailPackage(true);
       						}
       
      -						BusinessGroupMailing.sendEmail(ureqIdentity, firstWaitingListIdentity, group, MailType.graduateFromWaitingListToParticpant, mailing);				
      +						BusinessGroupMailing.sendEmail(null, firstWaitingListIdentity, group, MailType.graduateFromWaitingListToParticpant, mailing);				
       						counter++;
       				  }
       				}
      diff --git a/src/main/java/org/olat/group/ui/BGMailHelper.java b/src/main/java/org/olat/group/ui/BGMailHelper.java
      --- a/src/main/java/org/olat/group/ui/BGMailHelper.java
      +++ b/src/main/java/org/olat/group/ui/BGMailHelper.java
      @@ -190,13 +190,18 @@
       	 */
       	private static MailTemplate createMailTemplate(BusinessGroupShort group, Identity actor, String subjectKey, String bodyKey) {
       		// get some data about the actor and fetch the translated subject / body via i18n module
      -		String[] bodyArgs = new String[] {
      -				actor.getUser().getProperty(UserConstants.FIRSTNAME, null),
      -				actor.getUser().getProperty(UserConstants.LASTNAME, null),
      -				actor.getUser().getProperty(UserConstants.EMAIL, null),
      -				actor.getUser().getProperty(UserConstants.EMAIL, null)// 2x for compatibility with old i18m properties
      -		};
      -		Locale locale = I18nManager.getInstance().getLocaleOrDefault(actor.getUser().getPreferences().getLanguage());
      +		String[] bodyArgs = null;
      +		String lang = null;
      +		if (actor != null) {
      +			bodyArgs = new String[] {
      +					actor.getUser().getProperty(UserConstants.FIRSTNAME, null),
      +					actor.getUser().getProperty(UserConstants.LASTNAME, null),
      +					actor.getUser().getProperty(UserConstants.EMAIL, null),
      +					actor.getUser().getProperty(UserConstants.EMAIL, null)// 2x for compatibility with old i18m properties
      +			};
      +			lang = actor.getUser().getPreferences().getLanguage();
      +		}
      +		Locale locale = I18nManager.getInstance().getLocaleOrDefault(lang);
       		Translator trans = Util.createPackageTranslator(BGMailHelper.class, locale,
       				Util.createPackageTranslator(BusinessGroupListController.class, locale));
       		String subject = trans.translate(subjectKey);
      

        Attachments

          Activity

            People

            Assignee:
            srosse Stéphane Rossé
            Reporter:
            stephan Stephan Clemenz
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 25 minutes
                25m