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

Admin user deletion: newly registered users get user deletion emails

    XMLWordPrintable

    Details

      Description

      Newly created users e.g. by importing them appear in the table because their lastlogin is null. Since we send emails every few days users are confused about the deletion of their account. The following patch fixes that. I also decided to send emails to persons who are registered to Olat and did not login during the last login period.

      diff --git a/src/main/java/org/olat/admin/user/delete/service/UserDeletionManager.java b/src/main/java/org/olat/admin/user/delete/service/UserDeletionManager.java
      index fbe21c9..21e51e0 100644
      --- a/src/main/java/org/olat/admin/user/delete/service/UserDeletionManager.java
      +++ b/src/main/java/org/olat/admin/user/delete/service/UserDeletionManager.java
      @@ -180,7 +180,7 @@
       		StringBuilder sb = new StringBuilder(512);
       		sb.append("select ident from ").append(IdentityImpl.class.getName()).append(" as ident")
       		  .append(" inner join fetch ident.user as user")
      -		  .append(" where ident.status=").append(Identity.STATUS_ACTIV).append(" and (ident.lastLogin = null or ident.lastLogin < :lastLogin)")
      +		  .append(" where ident.status=").append(Identity.STATUS_ACTIV).append(" and ((ident.lastLogin = null and ident.creationDate < :lastLogin) or ident.lastLogin < :lastLogin)")
       		  .append(" and exists (select orgtomember.key from bgroupmember as orgtomember ")
       		  .append("  inner join organisation as org on (org.group.key=orgtomember.group.key)")
       		  .append("  where orgtomember.identity.key=ident.key and org.key in (:organisationKeys) and orgtomember.role='").append(OrganisationRoles.user).append("')");
      

       

        Figma for Jira By 42nd

          Attachments

            Activity

              People

              Assignee:
              srosse Stéphane Rossé
              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 - 35 minutes
                  35m