User Suspension

Administration tool ::: tool_usersuspension
Maintained by Sebsoft BV, Rogier van Dongen
The Sebsoft User Suspension Plugin offers you the possibility to automate the process of suspending users and/or removing user accounts (using moodle's default methods to delete users).
Latest release:
514 sites
530 downloads
58 fans
Current versions available: 6

The Sebsoft User Suspension Plugin offers you the possibility to automate the process of suspending users and/or removing user accounts (using moodle's default methods to delete users).

Suspending users is provided in three different ways:

  • Using a folder
  • Using a file upload
  • Manually through a status table

Deleting users is, if configured to be enabled, provided by comparing the date of suspending to the configured period before removal. Once the configured interval has past and the user is deemed suspended for the configured period, the useraccount will be removed using moodle's standard methods.

Furthermore, there's extensive settings that can be configured to turn every feature on or off, as well as disabling the whole tool's features.

This tool also provides a way of excluding users to be suspended or processed in case of automated processing. There are two methods provided at the moment: single user exclusion and cohort exclusion. During all three different ways of automated suspending / deleting users, only users that have NOT been configured to be excluded, either by cohort or by single user, will be processed.

Important note

Site administrators and the default guest account are completely left out of this tool. For safety measures, it is not recommended to put any form of automation on suspending or deleting administrator accounts or the default guest account, hence the decision to exclude them in any processing.

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4
Screenshot #5
Screenshot #6
Screenshot #7
Screenshot #8

Contributors

Sebsoft BV (Lead maintainer)
Rogier van Dongen: Project leader
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Hemam Taleb
    Mon, Mar 14, 2022, 3:22 PM
    Hi,
    I use Moodle 3.11.4 (Build: 20211120)
    When accessing "Users to suspend" tab I got this error message:
    SQL Server][SQL Server]'GREATEST' is not a recognized built-in function name.
    SQL Server][SQL Server]Invalid usage of the option NEXT in the FETCH statement.
    User Suspension option 'smart detection' is disabled in global tool configuration

  • Rogier van Dongen
    Thu, Apr 14, 2022, 4:47 PM
    New release is here!

    @Larry, welcomed input. I'll take this into account for possible future extension because it seems like a neat feature!

    @Hemam, a modification has been made so the two tabs causing the error are now useable again. In other words: SQL Server should no longer be an issue and the tool now works on SQL Server as well.

    Cheers!
  • Ricardo Caiado
    Thu, Aug 4, 2022, 2:04 AM
    Hi, Rogier.

    I want to suspend a user not by inactivity but pure on a period of time. Is that something you'll add to functionality of your plugin?

    Ricardo
  • Rogier van Dongen
    Thu, Sep 29, 2022, 5:04 PM
    Hi @Ricardo,
    The question has been asked before but unfortunately without my desired feedback.
    I can see the added value here so not unwilling to implement.
    However, there can be a possible clashing of the titans without a specification/detection mechanism.
    There are some prerequisites I'd like to discuss, primarily how those users should be detected. It's more or less critical when using a combination of functionalities from the plugin.
    I.e.: the different processes shouldn't interfere with one another.
    Currently, all users are "under investigation" apart from those specifically excluded.
    So I'd need a way to identify the specific group of users you're intending to suspend.
    Another question that arises would be what happens when one of those intended users would be unsuspended again. You can see I most lilely cannot use the creation date of the account, so I can already see the need for some date-tracking there as well.
    In other words: this needs to be specified more. It'd be great to discuss through the issue tracker on github for this plugin.
    Thanks and cheers!
  • Elmar Schmidt
    Tue, Oct 25, 2022, 9:57 PM
    Hello, is there any documentation for this plugin? Asking about this:

    "Manually through a status table"

    How to configure this?
  • Rogier van Dongen
    Tue, Oct 25, 2022, 10:02 PM
    @Elmar,
    No need to configure anything. Regular Moodle users recognize the correct icon.
    Go to the tab stating "users to suspend". The eye icon can be used to immediately suspend the user (much like the same action type in Moodle's core user list).
    No documentation other than the readme is available at the moment (expecting the interface and alt/title attributes on icons etc to be self explanatory).
    Cheers smile
  • Elmar Schmidt
    Tue, Oct 25, 2022, 10:35 PM
    Hello Rogier,
    got it now, thanks for the reply.

    We sync an external User DB with Moddle. We have a table field "Status" which is 0, 1 or 2. I was thinking that we can disable the users according to this table field.
  • Jacques Meyer
    Fri, Mar 17, 2023, 3:36 PM
    Hi, where can I edit the message that is sent on email to inform the user of suspension? using moodle 4.
  • Rogier van Dongen
    Fri, Mar 17, 2023, 4:48 PM
    Hi Jacques,
    Modifying the messages can be done using the language customisation options from within core Moodle.
    The string IDs you're looking for all start with "email:user:"
    Cheers,
    Rogier
  • Rob Willemse
    Thu, May 16, 2024, 3:26 PM
    This is a great plug-in. Managing old accounts is quite a lot of work, and this plug-in helps a lot. I have two remarks:

    1) It would be beneficial to have a grace period after activation. When I activated the plug-in, several users were immediately suspended, and some responded to my notification email. To address this, it would be helpful if the plug-in first sent warning emails to users who are to be immediately suspended, then waited for a specified period (e.g., 2 weeks) before actually suspending them. This grace period should apply only to users who would be immediately suspended upon activation of the plug-in.
    2) I read in a previous comment that there is a way to see the messages sent to users, but I do not understand where to find this. I am using Moodle 3.11.

    Again, I think the plug-in is very useful, and I am happy with it.
  • Annie H.
    Sat, Jun 1, 2024, 11:21 PM
    Hi, does this plugin will be upgraded to 4.3 or 4.4+? This would be a real benefit.
  • Rogier van Dongen
    Mon, Sep 23, 2024, 4:43 PM
    @Rob The grace period is somewhat tricky to implement (i.e.: mainly the case where the plugin is enabled/disabled). I'll take it into consideration but it might not make it to the new version.
    Regarding your other question:
    This is what the log tables are for, see the "Logs" tab. It does not, however, display the contents of the sent mail, but it logs the traffic. After many complaints of mails "not sending" in the past this was added back then to have some sort of insight in the mails that may have been sent (this still does not tell you anything if the mail was received or possibly even dropped by the gateway or lost along the way, this is completely out of scope. ALso, this type of information is typically not tracked in Moodle itself).
    Please be aware that your logs may be "cleaned out" according to plugin settings.

    @Annie, we're working on it. There also is a critical issue in version 4.0.1 we're resolving.
    New version will be landing ASAP.
  • Melvyn Gomez
    Thu, Oct 10, 2024, 2:57 AM
    I'm getting this message in the cron, i realized the tool is not working properly after check the task logs

    Execute scheduled task: Usersuspension task: automatic suspension of users (tool_usersuspension\task\suspend\mark)
    ... started 11:32:02. Current memory use 4.2 MB.
    Debugging increased temporarily due to faildelay of 60
    ... used 5 dbqueries
    ... used 1.2918848991394 seconds
    Scheduled task failed: Usersuspension task: automatic suspension of users (tool_usersuspension\task\suspend\mark),The given username contains invalid characters
    Backtrace:
    * line 310 of /admin/tool/usersuspension/classes/util.php: call to user_update_user()
    * line 189 of /admin/tool/usersuspension/classes/util.php: call to tool_usersuspension\util::do_suspend_user()
    * line 64 of /admin/tool/usersuspension/classes/task/suspend/mark.php: call to tool_usersuspension\util::mark_users_to_suspend()
    * line 263 of /lib/cronlib.php: call to tool_usersuspension\task\suspend\mark->execute()
    * line 120 of /lib/cronlib.php: call to cron_run_inner_scheduled_task()
    * line 73 of /lib/cronlib.php: call to cron_run_scheduled_tasks()
    * line 178 of /admin/cli/cron.php: call to cron_run()
  • Rogier van Dongen
    Thu, Oct 10, 2024, 4:42 PM
    @Melvyn Gomez
    This rather implies you have a user with an invalid username in your list of users which needs investigating.
    Having said that, we'll look into skipping those users so the background task can finish running and won't cause problems.
    However, my advice is that you also looks in the list of user accounts and verify that all usernames conform to the usernaming scheme (which is, to my best recollection, configurable in Moodle).

  • Rogier van Dongen
    Thu, Oct 10, 2024, 9:37 PM
    @Melvyn after careful consideration, we've decided not to do anything about this. The error message is a clear example of some of your usernames not being in line with those allowed (which, as stated, can ore or less be configured. You may wish to review config option "extendedusernamechars" as well as the convention in use for usernames).
    Since implementing a workaround in our scope has the potential of interfering with the suspension process, we don't think it's wise to provide one.
    The other reason is that the user with the invalid username can't login either way (unless logging in with email an address is allowed).

    Please validate the following setting to be enabled in your installation to work around the issue: /admin/search.php?query=extendedusernamechars
1 2 3 4
Please login to post comments