1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

#697 disable captcha and new admin create user UI

This commit is contained in:
Unknwon
2015-09-13 09:51:51 -04:00
parent e2d6b0116e
commit 8e0a69f86a
19 changed files with 228 additions and 179 deletions

View File

@@ -58,12 +58,12 @@ func (f *InstallForm) Validate(ctx *macaron.Context, errs binding.Errors) bindin
// \/ \/
type RegisterForm struct {
UserName string `form:"uname" binding:"Required;AlphaDashDot;MaxSize(35)"`
Email string `form:"email" binding:"Required;Email;MaxSize(254)"`
Password string `form:"password" binding:"Required;MaxSize(255)"`
Retype string `form:"retype"`
LoginType string `form:"logintype"`
LoginName string `form:"loginname"`
UserName string `binding:"Required;AlphaDashDot;MaxSize(35)"`
Email string `binding:"Required;Email;MaxSize(254)"`
Password string `binding:"Required;MaxSize(255)"`
Retype string
LoginType string
LoginName string
}
func (f *RegisterForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {

File diff suppressed because one or more lines are too long

View File

@@ -27,6 +27,10 @@ type ToggleOptions struct {
// AutoSignIn reads cookie and try to auto-login.
func AutoSignIn(ctx *Context) (bool, error) {
if !models.HasEngine {
return false, nil
}
uname := ctx.GetCookie(setting.CookieUserName)
if len(uname) == 0 {
return false, nil

View File

@@ -421,6 +421,7 @@ var Service struct {
EnableReverseProxyAuth bool
EnableReverseProxyAutoRegister bool
DisableMinimumKeySizeCheck bool
DisableCaptcha bool
}
func newService() {
@@ -434,6 +435,7 @@ func newService() {
Service.EnableReverseProxyAuth = sec.Key("ENABLE_REVERSE_PROXY_AUTHENTICATION").MustBool()
Service.EnableReverseProxyAutoRegister = sec.Key("ENABLE_REVERSE_PROXY_AUTO_REGISTRATION").MustBool()
Service.DisableMinimumKeySizeCheck = sec.Key("DISABLE_MINIMUM_KEY_SIZE_CHECK").MustBool()
Service.DisableCaptcha = sec.Key("DISABLE_CAPTCHA").MustBool()
}
var logLevels = map[string]string{