My customer has some complex requirements where they want to behave differently based on the roles.
Blocked users with role A should be deleted after X days.
Inactive users with role A should be deleted after Y days.
Inactive users with role B should be deleted after Z days.
Ideally, this module should allow to create different policies for users to be deleted. A good example I have in mind is Password Policy.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | Capture d’écran 2025-04-07 à 20.32.38.png | 190.58 KB | mably |
| #7 | Capture d’écran 2025-04-06 à 17.04.30.png | 239.05 KB | mably |
| #6 | screenshot-2025-04-06-00.23.13.jpeg | 181.6 KB | mably |
Issue fork purge_users-3427680
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
dabley commentedThis request is very similar to #3201601: Allow multiple purge cron jobs
Comment #3
mably commentedComment #4
mably commented@vbouchet @dabley are you still interested in this feature?
Comment #6
mably commentedWork in progress:
Code mostly inspired from the Password Policy module.
Feedback welcome!
Comment #7
mably commentedAll conditions have been implemented:
Comment #8
mably commentedComment #9
mably commentedPolicies can inherit from the module's main settings:
And the policy email notification settings are also translatable.
Comment #10
mably commentedAnyone interested in a 5.x-dev release?
Comment #11
mably commentedA new condition has been added to allow postponing deletion until the user has been properly notified, even if the standard notification period has already passed.
This can be useful when you enable the purge on an existing site and have a lot of old accounts to delete.
Once the notification delay has passed, you can disable this condition. This will allow users without email addresses or with invalid email addresses to be deleted.
Comment #12
mably commentedComment #14
mably commentedComment #16
vbouchetMerci Frank
I am not working on the project which requested this feature anymore but it seems you developed it in a very flexible, configurable and plugable way. I am sure I will recommend your module in the future.
Comment #17
mably commentedThanks @vbouchet!