Commit cf300443 authored by Andrei Gliga's avatar Andrei Gliga

OAuth Providers disable from the ApplicationSettings page

parent d8085d8e
...@@ -60,4 +60,19 @@ module ApplicationSettingsHelper ...@@ -60,4 +60,19 @@ module ApplicationSettingsHelper
end end
end end
end end
def oauth_providers_checkboxes(help_block_id)
button_based_providers.map do |source|
checked = current_application_settings.disabled_oauth_sign_in_sources.include?(source.to_s)
css_class = 'btn'
css_class += ' active' if checked
checkbox_name = 'application_setting[disabled_oauth_sign_in_sources][]'
label_tag(checkbox_name, class: css_class) do
check_box_tag(checkbox_name, source, checked,
autocomplete: 'off',
'aria-describedby' => help_block_id) + Gitlab::OAuth::Provider.label_for(source)
end
end
end
end end
...@@ -109,6 +109,16 @@ ...@@ -109,6 +109,16 @@
= f.label :signin_enabled do = f.label :signin_enabled do
= f.check_box :signin_enabled = f.check_box :signin_enabled
Sign-in enabled Sign-in enabled
.form-group
= f.label :disable_oauth_signin_sources, class: 'control-label col-sm-2'
.col-sm-10
- data_attrs = { toggle: 'buttons' }
.btn-group{ data: data_attrs }
- oauth_providers_checkboxes('oauth-providers-help').each do |source|
= source
%span.help-block#oauth-providers-help
Enabled OmniAuth must be configured for GitHub
= link_to "(?)", help_page_path("integration", "github")
.form-group .form-group
= f.label :two_factor_authentication, 'Two-factor authentication', class: 'control-label col-sm-2' = f.label :two_factor_authentication, 'Two-factor authentication', class: 'control-label col-sm-2'
.col-sm-10 .col-sm-10
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment