Keep your Joomla site secure and tidy by automatically managing inactive user accounts with the free Task - Inactive Users plugin.
The Task - Inactive Users plugin empowers Joomla administrators to maintain a clean and secure user base by automating the management of inactive accounts. Commissioned by an anonymous member of the Joomla community, who generously offered this tool to the Joomla community for free, it identifies users who haven’t logged in for a specified period and either deactivates them or triggers custom actions like notifications. Whether you run a community site, membership platform, or e-commerce portal, this free task plugin integrates with Joomla’s task scheduler, CLI, and event system to offer flexibility and extensibility for sites of all sizes.
Overview
Task - Inactive Users is a Joomla task plugin designed to handle inactive user accounts. It provides two tasks: deactivating users after a set period of inactivity and warning users via customizable events. With configurable options to exclude user groups and categorize user notes, it’s ideal for maintaining compliance with data retention policies while keeping your site secure. Tasks can be run via Joomla’s scheduler or triggered manually using the Joomla CLI. Released for free thanks to an anonymous contribution, Task - Inactive Users reflects RicheyWeb’s commitment to open-source excellence.
How It Works
- Task Configuration: Install the plugin and create a task in Joomla’s scheduler. Choose between Deactivate Inactive Users or Warn Inactive Users, and set the inactivity period (e.g., 1 year) using ISO 8601 duration format.
- User Identification: The plugin queries the Joomla database to find users who haven’t logged in or who registered long ago without activity.
- Task Execution:
- Deactivate Task: Blocks inactive users, adds a note to their account, and triggers the
onInactiveUserDeactivateevent. - Warn Task: Triggers the
onInactiveUserWarnevent, allowing other plugins to send notifications or perform actions.
- Deactivate Task: Blocks inactive users, adds a note to their account, and triggers the
- Execution Options: Run tasks automatically or manually via Joomla’s scheduler or manually using the Joomla CLI command:
php joomla.php scheduler:run -i <task id>
- Customization: Exclude specific user groups (e.g., administrators) and assign notes to a user category for better organization.
- Extensibility: Use the plugin’s events to integrate with notification plugins, logging systems, or other Joomla extensions.
Features
- Flexible Inactivity Periods: Define inactivity duration using ISO 8601 format (e.g., P1Y for 1 year, P6M for 6 months).
- Two Task Options: Deactivate users or warn them via events, giving admins control over account management.
- Event-Driven Design: Leverage
onInactiveUserDeactivateandonInactiveUserWarnevents for custom actions like email notifications. - CLI Support: Execute tasks manually or via cron with
php joomla.php scheduler:run -i <task id>for flexible automation. - User Group Exclusions: Protect specific groups (e.g., admins) from deactivation or warnings.
- User Notes: Automatically add categorized notes to deactivated users’ accounts for audit trails.
- Free and Open-Source: Available at no cost under the GPL license, thanks to an anonymous contribution.
- Joomla 5.x Integration: Built for Joomla’s task scheduler, CLI, and user management system, ensuring compatibility and performance.
You could do this job by hand, but how will the machines ever learn to hate us unless we make them do all of the boring tasks?
Download
Frequently Asked Questions:
What is Task - Inactive Users?
Task - Inactive Users is a free Joomla task plugin that automates the management of inactive user accounts by deactivating them or triggering warnings after a specified period of inactivity.
What Joomla version is required for this plugin?
The plugin is built for Joomla 4+ and integrates with its task scheduler, CLI, and user management system.
How do I install Task - Inactive Users?
Download the plugin from the Joomla Extensions Directory or RicheyWeb repository, then in the Joomla administrator panel go to System > Install > Extensions, upload the package, and install it. Enable it under System > Manage > Plugins.
What are the two task types available?
Deactivate Inactive Users blocks inactive accounts and adds notes, while Warn Inactive Users triggers an event for custom actions like notifications.
How do I set the inactivity period?
Use ISO 8601 duration format in the task parameters, such as P1Y for one year, P6M for six months, or P1Y2M3D for one year, two months, and three days.
Can I exclude certain user groups from being affected?
Yes, in the plugin settings under System > Manage > Plugins, select groups like Administrators in the Ignored User Groups multi-select field.
How are tasks executed?
Tasks run automatically via the Joomla scheduler based on the set schedule, or manually using the CLI command php joomla.php scheduler:run -i task-id.
What happens when the Deactivate task runs?
It blocks the user by setting block = 1, adds a categorized note to their account with details like the deactivation date and reason, and triggers the onInactiveUserDeactivate event.
What does the Warn task do?
It identifies inactive users and triggers the onInactiveUserWarn event without modifying accounts, allowing companion plugins to handle actions like sending emails.
How do I create a companion plugin for notifications?
Develop a plugin in the inactiveusers group that implements SubscriberInterface and listens for onInactiveUserWarn or onInactiveUserDeactivate events, then use Joomla's MailTemplate to send emails with user data. RicheyWeb offers this kind of development service.
Why are user notes added during deactivation?
Notes provide an audit trail, including the deactivation timestamp and inactivity reason, and are assigned to a category selected in the plugin settings.
Can I run tasks via cron?
Yes, set up a cron job like 0 0 * * * php /path/to/joomla/joomla.php scheduler:run -i 1 to execute a specific task daily.
What criteria determine an inactive user?
Users with a lastvisitDate older than the inactivity period, or a registerDate older than the period with lastvisitDate as NULL if they never logged in.
Is the plugin free to use?
Yes, it is released under the GPL license at no cost, thanks to an anonymous community contribution.
How do I troubleshoot if no users are processed?
Check that the inactivity period is valid, users meet the criteria, the task is enabled, and excluded groups are correctly set. Review Joomla logs for errors.
What should I do if CLI execution fails?
Verify the path to joomla.php, ensure PHP version is 8.0 to 8.2, check server permissions, and confirm the task ID is correct.
How can I customize actions for warnings or deactivations?
Create event listener plugins in the inactiveusers group to handle onInactiveUserWarn or onInactiveUserDeactivate, integrating with email systems, logging, or other extensions.
Where can I find the plugin download?
Download Task - Inactive Users from the RicheyWeb website or Joomla Extensions Directory.
Why is there no catch for this being free?
The developer aims to support the Joomla community, reduce fragmentation, and focus on innovation and custom paid work, encouraging reviews in the Joomla Extension Directory instead.