mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
EventManager: filter action execution based on event status
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -2597,6 +2597,11 @@ func executeUserCheckAction(c *dataprovider.EventActionIDPAccountCheck, params *
|
||||
func executeRuleAction(action dataprovider.BaseEventAction, params *EventParams, //nolint:gocyclo
|
||||
conditions dataprovider.ConditionOptions,
|
||||
) error {
|
||||
if len(conditions.EventStatuses) > 0 && !slices.Contains(conditions.EventStatuses, params.Status) {
|
||||
eventManagerLog(logger.LevelDebug, "skipping action %s, event status %d does not match: %v",
|
||||
action.Name, params.Status, conditions.EventStatuses)
|
||||
return nil
|
||||
}
|
||||
var err error
|
||||
|
||||
switch action.Type {
|
||||
|
||||
Reference in New Issue
Block a user