Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x] Add various events #10459

Merged
merged 17 commits into from
Jul 16, 2024
Merged

[5.x] Add various events #10459

merged 17 commits into from
Jul 16, 2024

Conversation

duncanmcclean
Copy link
Member

@duncanmcclean duncanmcclean commented Jul 15, 2024

This pull request implements various events, for some non-content related actions which are missing events for auditing purposes:

  • ImpersonationStarted and ImpersonationEnded events
    • These events will be dispatched whenever a user starts or finishes impersonating another user. Both the $impersonator and the $impersonated users are available in the event.
  • StacheCleared
    • This event will be dispatched after the Stache cache has been cleared, either via the php please stache:clear command or via the Cache Manager utility.
  • StacheWarmed
    • This event will be dispatched after the Stache cache has been warmed, either via the php please stache:warm command or via the Cache Manager utility.
  • StaticCacheCleared
    • This event will be dispatched after the Static cache has been cleared, via the php please static:clear command or via the Cache Manager utility.
  • GlideCacheCleared
    • This event will be dispatched after the Glide cache has been cleared, either via the php please glide:clear command or via the Cache Manager utility.
  • SearchIndexUpdated
    • This event will be dispatched when a search index is updated, either via the php please search:update command or via the Search utility.
    • The $index instance is available on the event.
  • UserPasswordChanged
    • This event will be dispatched when the password of another user is changed via the Control Panel.
    • This event won't be dispatched when a user's password is "reset" via the CP authentication pages, or via the {{ user:reset_password_form }} tag. In this case, Laravel's PasswordReset event would be dispatched.
  • LicenseSet
    • This event will be dispatched after a license key has been set via the php please license:set command.
    • This event won't be dispatched when the license key is manually added to a site's .env file.
  • LicensesRefreshed

As a note, this PR doesn't implement an event for when Laravel's application cache is cleared via the Cache Manager utility as Laravel provides its own cache:cleared event for this purpose.

Closes: #10403
Related: #10460

Copy link
Member

@jasonvarga jasonvarga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lookin' good

src/Http/Controllers/CP/LicensingController.php Outdated Show resolved Hide resolved
src/Search/Commands/Update.php Show resolved Hide resolved
src/Events/UserPasswordChanged.php Outdated Show resolved Hide resolved
@johncarter-
Copy link
Contributor

Useful stuff. Thanks.

@jasonvarga jasonvarga merged commit 0d42934 into 5.x Jul 16, 2024
17 checks passed
@jasonvarga jasonvarga deleted the more-events branch July 16, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More Events
3 participants