Actionlog plugin - user action logging #31

Open
opened 2026-06-04 17:15:58 +00:00 by jmiller · 0 comments
Owner

Summary

New plg_actionlog_mokobackup plugin that logs MokoJoomBackup actions to Joomla's User Action Logs.

Logged Events

Event Trigger
Profile created onContentAfterSave (context: com_mokobackup.profile, isNew=true)
Profile updated onContentAfterSave (context: com_mokobackup.profile, isNew=false)
Profile deleted onContentAfterDelete (context: com_mokobackup.profile)
Backup record deleted onContentAfterDelete (context: com_mokobackup.backup)
Backup completed onMokoBackupAfterRun (success=true)
Backup failed onMokoBackupAfterRun (success=false)

Implementation

  • Writes directly to #__action_logs with parameterized language keys
  • BackupEngine dispatches onMokoBackupAfterRun event after both success and failure paths
  • Event payload: success, record_id, description, profile_id, origin

Files

New

  • src/packages/plg_actionlog_mokobackup/ (full plugin directory)

Modified

  • src/packages/com_mokobackup/src/Engine/BackupEngine.php - added dispatchAfterRun() and Event import
## Summary New `plg_actionlog_mokobackup` plugin that logs MokoJoomBackup actions to Joomla's User Action Logs. ## Logged Events | Event | Trigger | |---|---| | Profile created | `onContentAfterSave` (context: `com_mokobackup.profile`, isNew=true) | | Profile updated | `onContentAfterSave` (context: `com_mokobackup.profile`, isNew=false) | | Profile deleted | `onContentAfterDelete` (context: `com_mokobackup.profile`) | | Backup record deleted | `onContentAfterDelete` (context: `com_mokobackup.backup`) | | Backup completed | `onMokoBackupAfterRun` (success=true) | | Backup failed | `onMokoBackupAfterRun` (success=false) | ## Implementation - Writes directly to `#__action_logs` with parameterized language keys - `BackupEngine` dispatches `onMokoBackupAfterRun` event after both success and failure paths - Event payload: `success`, `record_id`, `description`, `profile_id`, `origin` ## Files ### New - `src/packages/plg_actionlog_mokobackup/` (full plugin directory) ### Modified - `src/packages/com_mokobackup/src/Engine/BackupEngine.php` - added `dispatchAfterRun()` and `Event` import
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoJoomBackup#31