File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -828,6 +828,7 @@ func LinkAccount(ctx *context.Context) {
828
828
ctx .Data ["RecaptchaSitekey" ] = setting .Service .RecaptchaSitekey
829
829
ctx .Data ["HcaptchaSitekey" ] = setting .Service .HcaptchaSitekey
830
830
ctx .Data ["DisableRegistration" ] = setting .Service .DisableRegistration
831
+ ctx .Data ["AllowOnlyInternalRegistration" ] = setting .Service .AllowOnlyInternalRegistration
831
832
ctx .Data ["ShowRegistrationButton" ] = false
832
833
833
834
// use this to set the right link into the signIn and signUp templates in the link_account template
@@ -993,7 +994,7 @@ func LinkAccountPostRegister(ctx *context.Context) {
993
994
return
994
995
}
995
996
996
- if setting .Service .DisableRegistration {
997
+ if setting .Service .DisableRegistration || setting . Service . AllowOnlyInternalRegistration {
997
998
ctx .Error (http .StatusForbidden )
998
999
return
999
1000
}
Original file line number Diff line number Diff line change 3
3
<div class="ui secondary pointing tabular top attached borderless menu new-menu navbar">
4
4
<div class="new-menu-inner">
5
5
<!-- TODO handle .ShowRegistrationButton once other login bugs are fixed -->
6
- <a class="item {{if not .user_exists}}active{{end}}"
7
- data-tab="auth-link-signup-tab">
8
- {{.i18n.Tr "auth.oauth_signup_tab"}}
9
- </a>
6
+ {{if not .AllowOnlyInternalRegistration}}
7
+ <a class="item {{if not .user_exists}}active{{end}}"
8
+ data-tab="auth-link-signup-tab">
9
+ {{.i18n.Tr "auth.oauth_signup_tab"}}
10
+ </a>
11
+ {{end}}
10
12
<a class="item {{if .user_exists}}active{{end}}"
11
13
data-tab="auth-link-signin-tab">
12
14
{{.i18n.Tr "auth.oauth_signin_tab"}}
You can’t perform that action at this time.
0 commit comments