From 5a2ea86adf89ef594209ebf1c196a1484f6ddf33 Mon Sep 17 00:00:00 2001 From: Lanre Adelowo Date: Sat, 21 Jul 2018 17:29:08 +0100 Subject: [PATCH] fix pending issues with translation and wrong routes --- options/locale/locale_en-US.ini | 1 + routers/admin/users.go | 2 +- routers/routes/routes.go | 2 ++ routers/user/auth.go | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 629d84e05..b7273feff 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -201,6 +201,7 @@ forgot_password_title= Forgot Password forgot_password = Forgot password? sign_up_now = Need an account? Register now. confirmation_mail_sent_prompt = A new confirmation email has been sent to %s. Please check your inbox within the next %s to complete the registration process. +must_change_password = Update your password reset_password_mail_sent_prompt = A confirmation email has been sent to %s. Please check your inbox within the next %s to complete the password reset process. active_your_account = Activate Your Account prohibit_login = Sign In Prohibited diff --git a/routers/admin/users.go b/routers/admin/users.go index bc7850d7a..ae8882ac1 100644 --- a/routers/admin/users.go +++ b/routers/admin/users.go @@ -82,7 +82,7 @@ func NewUserPost(ctx *context.Context, form auth.AdminCreateUserForm) { Passwd: form.Password, IsActive: true, LoginType: models.LoginPlain, - MustChangePassword: false, + MustChangePassword: true, } if len(form.LoginType) > 0 { diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 3eaaff60b..991033cde 100644 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -203,6 +203,8 @@ func RegisterRoutes(m *macaron.Macaron) { }, openIDSignInEnabled) m.Get("/sign_up", user.SignUp) m.Post("/sign_up", bindIgnErr(auth.RegisterForm{}), user.SignUpPost) + m.Get("/change_password", user.MustChangePassword) + m.Post("/change_password", bindIgnErr(auth.MustChangePasswordForm{}), user.MustChangePasswordPost) m.Get("/reset_password", user.ResetPasswd) m.Post("/reset_password", user.ResetPasswdPost) m.Group("/oauth2", func() { diff --git a/routers/user/auth.go b/routers/user/auth.go index 184b374f3..b5e5c50ae 100644 --- a/routers/user/auth.go +++ b/routers/user/auth.go @@ -1200,7 +1200,7 @@ func MustChangePassword(ctx *context.Context) { func MustChangePasswordPost(ctx *context.Context, cpt *captcha.Captcha, form auth.MustChangePasswordForm) { ctx.Data["Title"] = ctx.Tr("auth.must_change_password") - ctx.Data["ChangePasscodeLink"] = setting.AppSubURL + "/user/sign_up" + ctx.Data["ChangePasscodeLink"] = setting.AppSubURL + "/user/change_password" if ctx.HasError() { ctx.HTML(200, tplMustChangePassword)