diff options
author | Unknown <joe2010xtmf@163.com> | 2014-04-09 21:42:25 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-04-09 21:42:25 -0400 |
commit | 5d4025cb5a629716bf84f4f5bf3baa97af716df4 (patch) | |
tree | 0302bc6bc306df2f400b8b19fb9531918e09c7ca /routers | |
parent | 3487f1728530fd2b0a447fe6fd7ef079cb53eed4 (diff) | |
download | gitea-5d4025cb5a629716bf84f4f5bf3baa97af716df4.tar.gz gitea-5d4025cb5a629716bf84f4f5bf3baa97af716df4.zip |
Add go get meta support
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/repo.go | 1 | ||||
-rw-r--r-- | routers/user/user.go | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go index 32c198f2f4..aebaa65a45 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -427,6 +427,7 @@ func SettingPost(ctx *middleware.Context) { ctx.Repo.Repository.Description = ctx.Query("desc") ctx.Repo.Repository.Website = ctx.Query("site") + ctx.Repo.Repository.IsGoget = ctx.Query("goget") == "on" if err := models.UpdateRepository(ctx.Repo.Repository); err != nil { ctx.Handle(404, "repo.SettingPost(update)", err) return diff --git a/routers/user/user.go b/routers/user/user.go index f6a39b86c7..084d0bbde2 100644 --- a/routers/user/user.go +++ b/routers/user/user.go @@ -396,6 +396,10 @@ func Activate(ctx *middleware.Context) { } else { ctx.Data["Hours"] = base.Service.ActiveCodeLives / 60 mailer.SendActiveMail(ctx.Render, ctx.User) + + if err := ctx.Cache.Put("MailResendLimit_"+ctx.User.LowerName, ctx.User.LowerName, 180); err != nil { + log.Error("Set cache(MailResendLimit) fail: %v", err) + } } } else { ctx.Data["ServiceNotEnabled"] = true @@ -451,7 +455,17 @@ func ForgotPasswd(ctx *middleware.Context) { return } + if ctx.Cache.IsExist("MailResendLimit_" + u.LowerName) { + ctx.Data["ResendLimited"] = true + ctx.HTML(200, "user/forgot_passwd") + return + } + mailer.SendResetPasswdMail(ctx.Render, u) + if err = ctx.Cache.Put("MailResendLimit_"+u.LowerName, u.LowerName, 180); err != nil { + log.Error("Set cache(MailResendLimit) fail: %v", err) + } + ctx.Data["Email"] = email ctx.Data["Hours"] = base.Service.ActiveCodeLives / 60 ctx.Data["IsResetSent"] = true |