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.

Command icon 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

vbouchet created an issue. See original summary.

dabley’s picture

This request is very similar to #3201601: Allow multiple purge cron jobs

mably’s picture

mably’s picture

@vbouchet @dabley are you still interested in this feature?

mably’s picture

StatusFileSize
new181.6 KB

Work in progress:

Purge Users Policy

Only local images are allowed.

Code mostly inspired from the Password Policy module.

Feedback welcome!

mably’s picture

All conditions have been implemented:

All conditions implemented

mably’s picture

Status: Active » Needs review
mably’s picture

Policies can inherit from the module's main settings:

Inheritance

And the policy email notification settings are also translatable.

mably’s picture

Anyone interested in a 5.x-dev release?

mably’s picture

A 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.

mably’s picture

Version: 4.x-dev » 5.x-dev

  • mably committed a037d466 on 5.x
    Issue #3427680 by mably: Use plugins and condition to create advanced...
mably’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

vbouchet’s picture

Merci 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.

mably’s picture

Thanks @vbouchet!