mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 18:58:38 +00:00
config option: Require sign in to view repository
This commit is contained in:
@@ -41,6 +41,7 @@ var (
|
||||
var Service struct {
|
||||
RegisterEmailConfirm bool
|
||||
DisenableRegisteration bool
|
||||
RequireSignInView bool
|
||||
ActiveCodeLives int
|
||||
ResetPwdCodeLives int
|
||||
}
|
||||
@@ -70,6 +71,7 @@ func newService() {
|
||||
Service.ActiveCodeLives = Cfg.MustInt("service", "ACTIVE_CODE_LIVE_MINUTES", 180)
|
||||
Service.ResetPwdCodeLives = Cfg.MustInt("service", "RESET_PASSWD_CODE_LIVE_MINUTES", 180)
|
||||
Service.DisenableRegisteration = Cfg.MustBool("service", "DISENABLE_REGISTERATION", false)
|
||||
Service.RequireSignInView = Cfg.MustBool("service", "REQUIRE_SIGNIN_VIEW", false)
|
||||
}
|
||||
|
||||
func newLogService() {
|
||||
|
@@ -15,7 +15,7 @@ func SignInRequire(redirect bool) martini.Handler {
|
||||
return func(ctx *Context) {
|
||||
if !ctx.IsSigned {
|
||||
if redirect {
|
||||
ctx.Redirect("/")
|
||||
ctx.Redirect("/user/login")
|
||||
}
|
||||
return
|
||||
} else if !ctx.User.IsActive && base.Service.RegisterEmailConfirm {
|
||||
|
Reference in New Issue
Block a user