mirror of
https://github.com/h44z/wg-portal
synced 2025-02-26 05:49:14 +00:00
fix peer disable if ldap user is disabled (#343)
This commit is contained in:
parent
7ccec5db8d
commit
6523a87dfb
@ -567,10 +567,13 @@ func (m Manager) disableMissingLdapUsers(
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
now := time.Now()
|
||||||
|
user.Disabled = &now
|
||||||
|
user.DisabledReason = domain.DisabledReasonLdapMissing
|
||||||
|
|
||||||
err := m.users.SaveUser(ctx, user.Identifier, func(u *domain.User) (*domain.User, error) {
|
err := m.users.SaveUser(ctx, user.Identifier, func(u *domain.User) (*domain.User, error) {
|
||||||
now := time.Now()
|
u.Disabled = user.Disabled
|
||||||
u.Disabled = &now
|
u.DisabledReason = user.DisabledReason
|
||||||
u.DisabledReason = "missing in ldap"
|
|
||||||
return u, nil
|
return u, nil
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user