@@ -192,6 +192,8 @@ func Contexter() macaron.Handler { | |||||
ctx.Data["CsrfToken"] = x.GetToken() | ctx.Data["CsrfToken"] = x.GetToken() | ||||
ctx.Data["CsrfTokenHtml"] = template.HTML(`<input type="hidden" name="_csrf" value="` + x.GetToken() + `">`) | ctx.Data["CsrfTokenHtml"] = template.HTML(`<input type="hidden" name="_csrf" value="` + x.GetToken() + `">`) | ||||
ctx.Data["ShowRegistrationButton"] = setting.Service.ShowRegistrationButton | |||||
c.Map(ctx) | c.Map(ctx) | ||||
} | } | ||||
} | } |
@@ -325,7 +325,7 @@ func newService() { | |||||
Service.ActiveCodeLives = Cfg.Section("service").Key("ACTIVE_CODE_LIVE_MINUTES").MustInt(180) | Service.ActiveCodeLives = Cfg.Section("service").Key("ACTIVE_CODE_LIVE_MINUTES").MustInt(180) | ||||
Service.ResetPwdCodeLives = Cfg.Section("service").Key("RESET_PASSWD_CODE_LIVE_MINUTES").MustInt(180) | Service.ResetPwdCodeLives = Cfg.Section("service").Key("RESET_PASSWD_CODE_LIVE_MINUTES").MustInt(180) | ||||
Service.DisableRegistration = Cfg.Section("service").Key("DISABLE_REGISTRATION").MustBool() | Service.DisableRegistration = Cfg.Section("service").Key("DISABLE_REGISTRATION").MustBool() | ||||
Service.ShowRegistrationButton = Cfg.Section("service").Key("SHOW_REGISTRATION_BUTTON").MustBool() | |||||
Service.ShowRegistrationButton = Cfg.Section("service").Key("SHOW_REGISTRATION_BUTTON").MustBool(!Service.DisableRegistration) | |||||
Service.RequireSignInView = Cfg.Section("service").Key("REQUIRE_SIGNIN_VIEW").MustBool() | Service.RequireSignInView = Cfg.Section("service").Key("REQUIRE_SIGNIN_VIEW").MustBool() | ||||
Service.EnableCacheAvatar = Cfg.Section("service").Key("ENABLE_CACHE_AVATAR").MustBool() | Service.EnableCacheAvatar = Cfg.Section("service").Key("ENABLE_CACHE_AVATAR").MustBool() | ||||
Service.EnableReverseProxyAuth = Cfg.Section("service").Key("ENABLE_REVERSE_PROXY_AUTHENTICATION").MustBool() | Service.EnableReverseProxyAuth = Cfg.Section("service").Key("ENABLE_REVERSE_PROXY_AUTHENTICATION").MustBool() | ||||
@@ -41,7 +41,6 @@ func Home(ctx *middleware.Context) { | |||||
ctx.Data["OauthEnabled"] = true | ctx.Data["OauthEnabled"] = true | ||||
ctx.Data["OauthService"] = setting.OauthService | ctx.Data["OauthService"] = setting.OauthService | ||||
} | } | ||||
ctx.Data["ShowRegistrationButton"] = setting.Service.ShowRegistrationButton | |||||
ctx.Data["PageIsHome"] = true | ctx.Data["PageIsHome"] = true | ||||
ctx.HTML(200, HOME) | ctx.HTML(200, HOME) | ||||
@@ -49,10 +49,12 @@ | |||||
<li class="right" id="header-nav-sign-in"> | <li class="right" id="header-nav-sign-in"> | ||||
<a href="{{AppSubUrl}}/user/login" title="Sign In"><i class="octicon octicon-sign-in"></i> {{.i18n.Tr "sign_in"}}</a> | <a href="{{AppSubUrl}}/user/login" title="Sign In"><i class="octicon octicon-sign-in"></i> {{.i18n.Tr "sign_in"}}</a> | ||||
</li> | </li> | ||||
{{if .ShowRegistrationButton}} | |||||
<li class="right"> | <li class="right"> | ||||
<a href="{{AppSubUrl}}/user/sign_up" title="Account Settings"><i class="octicon octicon-person-add"></i> {{.i18n.Tr "register"}}</a> | <a href="{{AppSubUrl}}/user/sign_up" title="Account Settings"><i class="octicon octicon-person-add"></i> {{.i18n.Tr "register"}}</a> | ||||
</li> | </li> | ||||
{{end}} | {{end}} | ||||
{{end}} | |||||
{{end}} | {{end}} | ||||
</ul> | </ul> | ||||
</header> | </header> |