diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2016-11-27 18:14:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-27 18:14:25 +0800 |
commit | 94da47271701401b6959bfd308d6c74fd30b22e2 (patch) | |
tree | 92a6c3298ab198efa04fbe4409d282da44736640 /modules/context/auth.go | |
parent | 0a76d260fa16764ab66bf1623b4cd9e9adfdac27 (diff) | |
download | gitea-94da47271701401b6959bfd308d6c74fd30b22e2.tar.gz gitea-94da47271701401b6959bfd308d6c74fd30b22e2.zip |
Golint fixed for modules/setting (#262)
* golint fixed for modules/setting
* typo fixed and renamed UNIXSOCKET to UnixSocket
Diffstat (limited to 'modules/context/auth.go')
-rw-r--r-- | modules/context/auth.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/context/auth.go b/modules/context/auth.go index 0e5ae93a87..372bcb187a 100644 --- a/modules/context/auth.go +++ b/modules/context/auth.go @@ -26,7 +26,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,14 +38,14 @@ 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)) + if !ctx.IsSigned && ctx.Req.RequestURI == "/" && setting.LandingPageURL != setting.LandingPageHome { + 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 } @@ -66,8 +66,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") @@ -79,8 +79,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 } |