diff options
Diffstat (limited to 'modules/auth/admin.go')
-rw-r--r-- | modules/auth/admin.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/auth/admin.go b/modules/auth/admin.go index 58d1a027fc..033dfe9388 100644 --- a/modules/auth/admin.go +++ b/modules/auth/admin.go @@ -10,7 +10,8 @@ import ( "github.com/go-macaron/binding" ) -type AdminCrateUserForm struct { +// AdminCreateUserForm form for admin to create user +type AdminCreateUserForm struct { LoginType string `binding:"Required"` LoginName string UserName string `binding:"Required;AlphaDashDot;MaxSize(35)"` @@ -19,10 +20,12 @@ type AdminCrateUserForm struct { SendNotify bool } -func (f *AdminCrateUserForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { +// Validate validates form fields +func (f *AdminCreateUserForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { return validate(errs, ctx.Data, f, ctx.Locale) } +// AdminEditUserForm form for admin to create user type AdminEditUserForm struct { LoginType string `binding:"Required"` LoginName string @@ -39,6 +42,7 @@ type AdminEditUserForm struct { ProhibitLogin bool } +// Validate validates form fields func (f *AdminEditUserForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { return validate(errs, ctx.Data, f, ctx.Locale) } |