summaryrefslogtreecommitdiffstats
path: root/routers/user
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-04-09 21:42:25 -0400
committerUnknown <joe2010xtmf@163.com>2014-04-09 21:42:25 -0400
commit5d4025cb5a629716bf84f4f5bf3baa97af716df4 (patch)
tree0302bc6bc306df2f400b8b19fb9531918e09c7ca /routers/user
parent3487f1728530fd2b0a447fe6fd7ef079cb53eed4 (diff)
downloadgitea-5d4025cb5a629716bf84f4f5bf3baa97af716df4.tar.gz
gitea-5d4025cb5a629716bf84f4f5bf3baa97af716df4.zip
Add go get meta support
Diffstat (limited to 'routers/user')
-rw-r--r--routers/user/user.go14
1 files changed, 14 insertions, 0 deletions
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