aboutsummaryrefslogtreecommitdiffstats
path: root/modules/auth/user_form.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/auth/user_form.go')
-rw-r--r--modules/auth/user_form.go57
1 files changed, 33 insertions, 24 deletions
diff --git a/modules/auth/user_form.go b/modules/auth/user_form.go
index b616a460ff..0d6987ad82 100644
--- a/modules/auth/user_form.go
+++ b/modules/auth/user_form.go
@@ -12,27 +12,36 @@ import (
)
type InstallForm struct {
- DbType string `binding:"Required"`
- DbHost string
- DbUser string
- DbPasswd string
- DbName string
- SSLMode string
- DbPath string
- RepoRootPath string `binding:"Required"`
- RunUser string `binding:"Required"`
- Domain string `binding:"Required"`
- HTTPPort string `binding:"Required"`
- AppUrl string `binding:"Required"`
- SMTPHost string
- SMTPEmail string
- SMTPPasswd string
- RegisterConfirm string
- MailNotify string
- AdminName string `binding:"Required;AlphaDashDot;MaxSize(30)"`
- AdminPasswd string `binding:"Required;MinSize(6);MaxSize(255)"`
- AdminConfirmPasswd string `binding:"Required;MinSize(6);MaxSize(255)"`
- AdminEmail string `binding:"Required;Email;MaxSize(50)"`
+ DbType string `binding:"Required"`
+ DbHost string
+ DbUser string
+ DbPasswd string
+ DbName string
+ SSLMode string
+ DbPath string
+
+ AppName string `binding:"Required" locale:"install.app_name"`
+ RepoRootPath string `binding:"Required"`
+ RunUser string `binding:"Required"`
+ Domain string `binding:"Required"`
+ HTTPPort string `binding:"Required"`
+ AppUrl string `binding:"Required"`
+
+ SMTPHost string
+ SMTPFrom string
+ SMTPEmail string `binding:"OmitEmpty;Email;MaxSize(50)" locale:"install.mailer_user"`
+ SMTPPasswd string
+ RegisterConfirm bool
+ MailNotify bool
+
+ OfflineMode bool
+ DisableRegistration bool
+ RequireSignInView bool
+
+ AdminName string `binding:"OmitEmpty;AlphaDashDot;MaxSize(30)" locale:"install.admin_name"`
+ AdminPasswd string `binding:"OmitEmpty;MinSize(6);MaxSize(255)" locale:"install.admin_password"`
+ AdminConfirmPasswd string
+ AdminEmail string `binding:"OmitEmpty;Email;MaxSize(50)" locale:"install.admin_email"`
}
func (f *InstallForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
@@ -107,7 +116,7 @@ func (f *AddEmailForm) Validate(ctx *macaron.Context, errs binding.Errors) bindi
}
type ChangePasswordForm struct {
- OldPassword string `form:"old_password" binding:"Required;MinSize(6);MaxSize(255)"`
+ OldPassword string `form:"old_password" binding:"Required;MinSize(1);MaxSize(255)"`
Password string `form:"password" binding:"Required;MinSize(6);MaxSize(255)"`
Retype string `form:"retype"`
}
@@ -117,8 +126,8 @@ func (f *ChangePasswordForm) Validate(ctx *macaron.Context, errs binding.Errors)
}
type AddSSHKeyForm struct {
- SSHTitle string `form:"title" binding:"Required"`
- Content string `form:"content" binding:"Required"`
+ Title string `binding:"Required;MaxSize(50)"`
+ Content string `binding:"Required"`
}
func (f *AddSSHKeyForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {