diff options
author | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-05-01 20:57:11 +0800 |
---|---|---|
committer | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-05-01 20:57:11 +0800 |
commit | cc1eb5643e3d28b6e23d3642bdf93670c33fa9c5 (patch) | |
tree | 7adfbed18647baf9d3e281b7f23c0dcd0828cc7d /modules/auth/auth.go | |
parent | 52fbb9788aa80adb56c96389f73c878cc0fe8b42 (diff) | |
parent | a2333d95d594a6aa4e77e78c2efe32991d3cf1ef (diff) |
Merge branch 'dev' of https://github.com/gogits/gogs into dev
Diffstat (limited to 'modules/auth/auth.go')
-rw-r--r-- | modules/auth/auth.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/auth/auth.go b/modules/auth/auth.go index e493faef..96e3868f 100644 --- a/modules/auth/auth.go +++ b/modules/auth/auth.go @@ -21,7 +21,7 @@ type Form interface { } type RegisterForm struct { - UserName string `form:"username" binding:"Required;AlphaDash;MaxSize(30)"` + UserName string `form:"username" binding:"Required;AlphaDashDot;MaxSize(30)"` Email string `form:"email" binding:"Required;Email;MaxSize(50)"` Password string `form:"passwd" binding:"Required;MinSize(6);MaxSize(30)"` RetypePasswd string `form:"retypepasswd"` @@ -123,6 +123,8 @@ func validate(errors *base.BindingErrors, data base.TmplData, form Form) { data["ErrorMsg"] = form.Name(field.Name) + " cannot be empty" case base.BindingAlphaDashError: data["ErrorMsg"] = form.Name(field.Name) + " must be valid alpha or numeric or dash(-_) characters" + case base.BindingAlphaDashDotError: + data["ErrorMsg"] = form.Name(field.Name) + " must be valid alpha or numeric or dash(-_) or dot characters" case base.BindingMinSizeError: data["ErrorMsg"] = form.Name(field.Name) + " must contain at least " + getMinMaxSize(field) + " characters" case base.BindingMaxSizeError: @@ -174,7 +176,7 @@ type InstallForm struct { RunUser string `form:"run_user"` Domain string `form:"domain"` AppUrl string `form:"app_url"` - AdminName string `form:"admin_name" binding:"Required"` + AdminName string `form:"admin_name" binding:"Required;AlphaDashDot;MaxSize(30)"` AdminPasswd string `form:"admin_pwd" binding:"Required;MinSize(6);MaxSize(30)"` AdminEmail string `form:"admin_email" binding:"Required;Email;MaxSize(50)"` SmtpHost string `form:"smtp_host"` |