Auto-suspend inactive users

A very simple plugin which automatically suspends users after they haven’t logged in for a while. It has a very narrow use case, but thought I’d share it in case someone else finds it useful.

The plugin simply uses the built-in suspension functionality, so once the users are suspended you can safely uninstall the plugin and they will remain suspended.

Options available:

Installing a plugin

8 Likes

I am curious what the use case is here?

Our forum is for a university society, we get lots of students joining every year, who sign up for the forum.

The things discussed can be (very slightly) sensitive, and so we want to restrict access to those people who are actually involved. People who haven’t been involved for more than a year likely aren’t coming back, so we want to remove their access.

I guess it’s kinda similar to this use case in this thread, but not quite as strictly defined:

4 Likes

It seems to me that 100 years as a default should suffice given that…

4 Likes

Also why suspend, which requires manual moderator intervention to remove?

Why not just invalidate the email after long periods of inactivity (a year? two years?), so if they want to log in again, they can simply self-service to revalidate their email cc @tgxworld

1 Like

The idea is we’d want a human to “re approve” them manually, before they can see the content again. Self service would kinda defeat the point of that.

A better solution would be to stick the user back in the approval queue when they attempt to login again, but since there’s no UI in discourse for doing that, I decided to go with suspending instead.

Purely out of interest: I see the plugin has been forked under the Discourse organisation on GitHub - is there a plan to use it internally for something?

1 Like

Are you restricting registration to school email addresses? You should make sure only students can register.

2 Likes

Sadly wouldn’t quite work with the nature of our group, but yeah that is probably a good solution for most people :slight_smile:

Cool, sounds similar to our use case here:

Is there any visible indication for other users that a user has been suspended?

There’s the standard suspension banner on their user profile, showing some ridiculous date, and the suspension message.

2 Likes

Another forum is using the plugin.

4 Likes

I’m not a huge fan of this approach, because a suspended user should mean they did something wrong.

Having a ton of auto-suspended users mixed in randomly with users who were suspended for, I don’t know, abusive behavior or what have you, is quite far from ideal.

4 Likes

I agree. In my scenario the community maps to a real-world community, so suspensions for things like abusive behaviour aren’t something we have to deal with.

Do you think there is a better way we could handle this using the existing infrastructure in core? Deleting/anonymising users is one option, but I don’t think that’s a good idea because it removes a lot of context from archived discussions.

For that specific use case it is fine, if you are 100% absolutely sure nobody will ever be suspended for any other reason.

1 Like

The somewhat harsh “suspended” wording can be changed to “inactive” in Customize > Text content and the date removed if it’s not needed.

/admin/customize/site_texts

7 Likes

Is there a way to do just that??? Invalidate only so users have to revalidate their email? That’s exactly what I’m trying to accomplish.

Yes there is:

7 Likes

Sorry for the delay. Thank you!!!

3 Likes