diff options
Diffstat (limited to 'modules/auth')
-rw-r--r-- | modules/auth/user_form.go | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/modules/auth/user_form.go b/modules/auth/user_form.go index 57451d9eb6..7bd6c7b9bc 100644 --- a/modules/auth/user_form.go +++ b/modules/auth/user_form.go @@ -36,11 +36,12 @@ type InstallForm struct { RegisterConfirm bool MailNotify bool - OfflineMode bool - DisableGravatar bool - DisableRegistration bool - EnableCaptcha bool - RequireSignInView bool + OfflineMode bool + DisableGravatar bool + EnableFederatedAvatar bool + DisableRegistration bool + EnableCaptcha bool + RequireSignInView bool AdminName string `binding:"OmitEmpty;AlphaDashDot;MaxSize(30)" locale:"install.admin_name"` AdminPasswd string `binding:"OmitEmpty;MaxSize(255)" locale:"install.admin_password"` @@ -93,19 +94,25 @@ type UpdateProfileForm struct { Email string `binding:"Required;Email;MaxSize(254)"` Website string `binding:"Url;MaxSize(100)"` Location string `binding:"MaxSize(50)"` - Gravatar string `binding:"OmitEmpty;Email;MaxSize(254)"` } func (f *UpdateProfileForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { return validate(errs, ctx.Data, f, ctx.Locale) } -type UploadAvatarForm struct { - Enable bool - Avatar *multipart.FileHeader +const ( + AVATAR_LOCAL string = "local" + AVATAR_BYMAIL string = "bymail" +) + +type AvatarForm struct { + Source string + Avatar *multipart.FileHeader + Gravatar string `binding:"OmitEmpty;Email;MaxSize(254)"` + Federavatar bool } -func (f *UploadAvatarForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { +func (f *AvatarForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { return validate(errs, ctx.Data, f, ctx.Locale) } |