From 90b9f7e08ca2e027cc587199537aa653ddd94d91 Mon Sep 17 00:00:00 2001 From: Unknwon <u@gogs.io> Date: Thu, 6 Apr 2017 17:27:57 -0400 Subject: pkg/setting: rename {AppUrl, AppSubUrl} -> {AppURL, AppSubURL} --- pkg/context/auth.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'pkg/context/auth.go') diff --git a/pkg/context/auth.go b/pkg/context/auth.go index 642a320b..d2bfe603 100644 --- a/pkg/context/auth.go +++ b/pkg/context/auth.go @@ -25,7 +25,7 @@ func Toggle(options *ToggleOptions) macaron.Handler { return func(ctx *Context) { // Cannot view any page before installation. if !setting.InstallLock { - ctx.Redirect(setting.AppSubUrl + "/install") + ctx.Redirect(setting.AppSubURL + "/install") return } @@ -38,13 +38,13 @@ func Toggle(options *ToggleOptions) macaron.Handler { // Check non-logged users landing page. if !ctx.IsSigned && ctx.Req.RequestURI == "/" && setting.LandingPageURL != setting.LANDING_PAGE_HOME { - ctx.Redirect(setting.AppSubUrl + string(setting.LandingPageURL)) + ctx.Redirect(setting.AppSubURL + string(setting.LandingPageURL)) return } // Redirect to dashboard if user tries to visit any non-login page. if options.SignOutRequired && ctx.IsSigned && ctx.Req.RequestURI != "/" { - ctx.Redirect(setting.AppSubUrl + "/") + ctx.Redirect(setting.AppSubURL + "/") return } @@ -65,8 +65,8 @@ func Toggle(options *ToggleOptions) macaron.Handler { return } - ctx.SetCookie("redirect_to", url.QueryEscape(setting.AppSubUrl+ctx.Req.RequestURI), 0, setting.AppSubUrl) - ctx.Redirect(setting.AppSubUrl + "/user/login") + ctx.SetCookie("redirect_to", url.QueryEscape(setting.AppSubURL+ctx.Req.RequestURI), 0, setting.AppSubURL) + ctx.Redirect(setting.AppSubURL + "/user/login") return } else if !ctx.User.IsActive && setting.Service.RegisterEmailConfirm { ctx.Data["Title"] = ctx.Tr("auth.active_your_account") @@ -78,8 +78,8 @@ func Toggle(options *ToggleOptions) macaron.Handler { // Redirect to log in page if auto-signin info is provided and has not signed in. if !options.SignOutRequired && !ctx.IsSigned && !auth.IsAPIPath(ctx.Req.URL.Path) && len(ctx.GetCookie(setting.CookieUserName)) > 0 { - ctx.SetCookie("redirect_to", url.QueryEscape(setting.AppSubUrl+ctx.Req.RequestURI), 0, setting.AppSubUrl) - ctx.Redirect(setting.AppSubUrl + "/user/login") + ctx.SetCookie("redirect_to", url.QueryEscape(setting.AppSubURL+ctx.Req.RequestURI), 0, setting.AppSubURL) + ctx.Redirect(setting.AppSubURL + "/user/login") return } -- cgit v1.2.3