mirror of
https://github.com/go-gitea/gitea.git
synced 2025-06-20 21:18:00 +02:00
Add active page
This commit is contained in:
@ -39,3 +39,20 @@ func SendRegisterMail(user *models.User) {
|
||||
// async send mail
|
||||
mailer.SendAsync(msg)
|
||||
}
|
||||
|
||||
// Send email verify active email.
|
||||
func SendActiveMail(user *models.User) {
|
||||
code := CreateUserActiveCode(user, nil)
|
||||
|
||||
subject := "Verify your email address"
|
||||
|
||||
data := mailer.GetMailTmplData(user)
|
||||
data["Code"] = code
|
||||
body := base.RenderTemplate("mail/auth/active_email.html", data)
|
||||
|
||||
msg := mailer.NewMailMessage([]string{user.Email}, subject, body)
|
||||
msg.Info = fmt.Sprintf("UID: %d, send email verify mail", user.Id)
|
||||
|
||||
// async send mail
|
||||
mailer.SendAsync(msg)
|
||||
}
|
||||
|
@ -16,6 +16,10 @@ func SignInRequire(redirect bool) martini.Handler {
|
||||
ctx.Render.Redirect("/")
|
||||
}
|
||||
return
|
||||
} else if !ctx.User.IsActive {
|
||||
ctx.Data["Title"] = "Activate Your Account"
|
||||
ctx.Render.HTML(200, "user/active", ctx.Data)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user