diff --git a/modules/context/auth.go b/modules/context/auth.go index 9e84bc35b..efde3bc2e 100755 --- a/modules/context/auth.go +++ b/modules/context/auth.go @@ -53,7 +53,7 @@ func Toggle(options *ToggleOptions) macaron.Handler { ctx.Data["Title"] = ctx.Tr("auth.prohibit_login") ctx.HTML(200, "user/auth/prohibit_login") return - } else if ctx.User.IsActive && ctx.User.PhoneNumber == "" && ctx.Req.URL.Path != "/bindPhone" { + } else if setting.PhoneService.Enabled && ctx.User.IsActive && ctx.User.PhoneNumber == "" && ctx.Req.URL.Path != "/bindPhone" { ctx.Data["Title"] = ctx.Tr("phone.bind_phone") ctx.HTML(200, "user/auth/bind_phone") return diff --git a/routers/home.go b/routers/home.go index 518507495..b6f8e4d41 100755 --- a/routers/home.go +++ b/routers/home.go @@ -117,7 +117,7 @@ func Dashboard(ctx *context.Context) { ctx.Data["ChangePasscodeLink"] = setting.AppSubURL + "/user/change_password" ctx.SetCookie("redirect_to", setting.AppSubURL+ctx.Req.URL.RequestURI(), 0, setting.AppSubURL) ctx.Redirect(setting.AppSubURL + "/user/settings/change_password") - }else if ctx.User.IsActive && ctx.User.PhoneNumber == "" { + } else if setting.PhoneService.Enabled && ctx.User.IsActive && ctx.User.PhoneNumber == "" { ctx.Data["Title"] = ctx.Tr("phone.bind_phone") ctx.HTML(200, "user/auth/bind_phone") return