Force a delay between notification and user expiration

Created on 29 January 2022, over 3 years ago
Updated 17 July 2025, 11 days ago

This may be a very specific edge case but the end of Drupal 7 support in November may increase the chances somebody else have the same problem. I don't know if this is something that should be merged in the module as a feature though.

Problem/Motivation

When this module is installed on a website that already have tons of users created like N years ago the notification for both the expiration warning and the expiration itself are triggered at the same time. This means that a user to be expired will have no time to eventually connect to the website before its account is disabled as the warning email will be sent when the expiration is already done.

Steps to reproduce

Have a fresh Drupal instance, populate it with a few random test users, set their creation/access/login dates to someting far in the past.
Install the module, run the cron.
Check that users are all expired at the same time they are warned.

Proposed resolution

I added a new "Expiration offset" setting that allow to set a delay between the warning and the expiration.
This setting, if set with a non zero value, will set the expiration date on users to be expired the first time they are processed.

User interface changes

Added a textfield in the configuration form for convenience.

✨ Feature request
Status

Active

Version

1.5

Component

Code

Created by

πŸ‡«πŸ‡·France nicoloye

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024