Don't block deleted accounts

setup_test
meskio 2 years ago
parent 003fbaacd8
commit 50a520dda3
Signed by: meskio
GPG Key ID: 52B8F5AC97A2DA86
  1. 2
      main.go

@ -93,7 +93,7 @@ func updateUsers(l ldap.Ldap) {
sinceLastLogin := time.Now().Sub(u.LastLogin)
if u.Locked != ldap.Deleted && sinceLastLogin > accountDeleteDuration {
newLocked = ldap.Deleted
} else if u.Locked != ldap.Blocked && sinceLastLogin > accountBlockDuration {
} else if u.Locked != ldap.Blocked && sinceLastLogin > accountBlockDuration && sinceLastLogin < accountDeleteDuration {
newLocked = ldap.Blocked
} else {
continue

Loading…
Cancel
Save