diff options
author | 无闻 <u@gogs.io> | 2014-12-20 22:47:05 -0500 |
---|---|---|
committer | 无闻 <u@gogs.io> | 2014-12-20 22:47:05 -0500 |
commit | a18decf4ccc9498f5fd394b03f77744bab89081b (patch) | |
tree | 63352d102a17c4c45f5bdfd376b415da1901db31 /routers/user/auth.go | |
parent | e6e2cf7855b61f6acd7bc98b6757f99846038365 (diff) | |
parent | 20b5c23a192b3a87b4fdac724c5be705588e461c (diff) | |
download | gitea-a18decf4ccc9498f5fd394b03f77744bab89081b.tar.gz gitea-a18decf4ccc9498f5fd394b03f77744bab89081b.zip |
Merge pull request #755 from phsmit/multiple_emails
Multiple emails
Diffstat (limited to 'routers/user/auth.go')
-rw-r--r-- | routers/user/auth.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/routers/user/auth.go b/routers/user/auth.go index e576e6af9c..9ed44e353c 100644 --- a/routers/user/auth.go +++ b/routers/user/auth.go @@ -345,6 +345,27 @@ func Activate(ctx *middleware.Context) { ctx.HTML(200, ACTIVATE) } +func ActivateEmail(ctx *middleware.Context) { + code := ctx.Query("code") + email_string := ctx.Query("email") + + // Verify code. + if email := models.VerifyActiveEmailCode(code, email_string); email != nil { + err := email.Activate() + if err != nil { + ctx.Handle(500, "ActivateEmail", err) + } + + log.Trace("Email activated: %s", email.Email) + + ctx.Flash.Success(ctx.Tr("settings.activate_email_success")) + + } + + ctx.Redirect(setting.AppSubUrl + "/user/settings/email") + return +} + func ForgotPasswd(ctx *middleware.Context) { ctx.Data["Title"] = ctx.Tr("auth.forgot_password") |