1
0

Disable the user account after 10 failed password attempts

This commit is contained in:
kolaente
2021-07-29 18:45:22 +02:00
parent 3572ac4b82
commit 5cfc9bf2f9
7 changed files with 122 additions and 10 deletions

View File

@ -458,3 +458,13 @@ func UpdateUserPassword(s *xorm.Session, user *User, newPassword string) (err er
return err
}
// SetStatus sets a users status in the database
func (u *User) SetStatus(s *xorm.Session, status Status) (err error) {
u.Status = status
_, err = s.
Where("id = ?", u.ID).
Cols("status").
Update(u)
return
}