diff options
author | Unknwon <u@gogs.io> | 2016-07-16 10:22:16 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-07-16 10:22:16 +0800 |
commit | c083d7656794ec0b4d856994daddd27e98841d70 (patch) | |
tree | bb1625b4bf3df63fe5f49de2b316765ca6de5569 /modules/context/auth.go | |
parent | 52322ef62457541fb914f8e929b2dcd01915c8bc (diff) |
#2937 able to prohibit user login
Diffstat (limited to 'modules/context/auth.go')
-rw-r--r-- | modules/context/auth.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/context/auth.go b/modules/context/auth.go index 422869db..bc19467d 100644 --- a/modules/context/auth.go +++ b/modules/context/auth.go @@ -29,7 +29,14 @@ func Toggle(options *ToggleOptions) macaron.Handler { return } - // Checking non-logged users landing page. + // Check prohibit login users. + if ctx.IsSigned && ctx.User.ProhibitLogin { + ctx.Data["Title"] = ctx.Tr("auth.prohibit_login") + ctx.HTML(200, "user/auth/prohibit_login") + return + } + + // 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)) return |