You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
853 B

  1. // Copyright 2014 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package auth
  5. import (
  6. "github.com/Unknwon/macaron"
  7. "github.com/macaron-contrib/binding"
  8. )
  9. type AdminEditUserForm struct {
  10. FullName string `form:"fullname" binding:"MaxSize(100)"`
  11. Email string `binding:"Required;Email;MaxSize(50)"`
  12. Password string `binding:"OmitEmpty;MinSize(6);MaxSize(255)"`
  13. Website string `binding:"MaxSize(50)"`
  14. Location string `binding:"MaxSize(50)"`
  15. Avatar string `binding:"Required;Email;MaxSize(50)"`
  16. Active bool
  17. Admin bool
  18. AllowGitHook bool
  19. LoginType int
  20. }
  21. func (f *AdminEditUserForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
  22. return validate(errs, ctx.Data, f, ctx.Locale)
  23. }