mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
EventManager: allow to check for inactive users
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -2312,6 +2312,13 @@ func getEventActionOptionsFromPostFields(r *http.Request) (dataprovider.BaseEven
|
||||
if err != nil {
|
||||
return dataprovider.BaseEventActionOptions{}, fmt.Errorf("invalid password expiration threshold: %w", err)
|
||||
}
|
||||
var disableThreshold, deleteThreshold int
|
||||
if val, err := strconv.Atoi(r.Form.Get("inactivity_disable_threshold")); err == nil {
|
||||
disableThreshold = val
|
||||
}
|
||||
if val, err := strconv.Atoi(r.Form.Get("inactivity_delete_threshold")); err == nil {
|
||||
deleteThreshold = val
|
||||
}
|
||||
var emailAttachments []string
|
||||
if r.Form.Get("email_attachments") != "" {
|
||||
emailAttachments = getSliceFromDelimitedValues(r.Form.Get("email_attachments"), ",")
|
||||
@@ -2373,6 +2380,10 @@ func getEventActionOptionsFromPostFields(r *http.Request) (dataprovider.BaseEven
|
||||
PwdExpirationConfig: dataprovider.EventActionPasswordExpiration{
|
||||
Threshold: pwdExpirationThreshold,
|
||||
},
|
||||
UserInactivityConfig: dataprovider.EventActionUserInactivity{
|
||||
DisableThreshold: disableThreshold,
|
||||
DeleteThreshold: deleteThreshold,
|
||||
},
|
||||
IDPConfig: dataprovider.EventActionIDPAccountCheck{
|
||||
Mode: idpMode,
|
||||
TemplateUser: strings.TrimSpace(r.Form.Get("idp_user")),
|
||||
|
||||
Reference in New Issue
Block a user