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

User life cycle workflow does not work as expected

    XMLWordPrintable

    Details

      Description

      The user life cycle with automatically (cron job once a day) generated mails and so on does not work as expected. If a user should be deactivated after a year of inactivity and 30 days before an email should be sent the following happens:

      The email is sent correctly and database entry is made (inactivationemaildate). If the cron job starts the next time the user is deactivated immedialtly one day after the reminder email is sent but the period should be 30 days.

      If there's a list of users to deactivate they can not be deactivated when the vetoed list is empty.

      This fixes both problems. Users are deactivated after a period of 30 days (for example) and if the vetoed list is empty:

      diff --git a/src/main/java/org/olat/user/manager/lifecycle/UserLifecycleManagerImpl.java b/src/main/java/org/olat/user/manager/lifecycle/UserLifecycleManagerImpl.java
      index 59f35b3..9e3d5aa 100644
      --- a/src/main/java/org/olat/user/manager/lifecycle/UserLifecycleManagerImpl.java
      +++ b/src/main/java/org/olat/user/manager/lifecycle/UserLifecycleManagerImpl.java
      @@ -193,7 +253,7 @@
       
       		Date lastLoginDate = getDate(numOfDaysBeforeDeactivation);
       		List<Identity> identities;
      -		if(sendMailBeforeDeactivation) {
      +		if(!sendMailBeforeDeactivation) {
       			identities = getIdentitiesToInactivate(lastLoginDate, null);
       		} else {
       			Date emailBeforeDate = getDate(numOfDaysBeforeEmail);
      @@ -201,7 +261,7 @@
       		}
       		
       		for(Identity identity:identities) {
      -			if(!vetoed.contains(identity)) {
      +			if(vetoed.isEmpty() || !vetoed.contains(identity)) {
       				identity = setIdentityAsInactive(identity);
       				if(userModule.isMailAfterDeactivation()) {
       					sendEmail(identity, "mail.after.deactivation.subject", "mail.after.deactivation.body", "after deactiviation");
      

       

       

        Attachments

          Activity

            People

            Assignee:
            srosse Stéphane Rossé
            Reporter:
            stephan Stephan Clemenz
            Tester:
            Florian Gnägi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: