-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 15.1.3
-
Fix Version/s: 15.2.3
-
Component/s: Administration, Usermanagement
-
Labels:None
-
Funded by:
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");