Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
cf300443
Commit
cf300443
authored
May 04, 2016
by
Andrei Gliga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OAuth Providers disable from the ApplicationSettings page
parent
d8085d8e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
app/helpers/application_settings_helper.rb
app/helpers/application_settings_helper.rb
+15
-0
app/views/admin/application_settings/_form.html.haml
app/views/admin/application_settings/_form.html.haml
+10
-0
No files found.
app/helpers/application_settings_helper.rb
View file @
cf300443
...
@@ -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
app/views/admin/application_settings/_form.html.haml
View file @
cf300443
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment