Commit b2139093 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Make provider a select for identities form in admin area

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 8f89a488
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
.form-group .form-group
= f.label :provider, class: 'control-label' = f.label :provider, class: 'control-label'
.col-sm-10 .col-sm-10
= f.text_field :provider, required: true, autocomplete: "off", class: 'form-control', required: true = f.select :provider, Gitlab::OAuth::Provider.names, { allow_blank: false }, class: 'form-control'
.form-group .form-group
= f.label :extern_uid, class: 'control-label' = f.label :extern_uid, "Identifier", class: 'control-label'
.col-sm-10 .col-sm-10
= f.text_field :extern_uid, required: true, autocomplete: "off", class: 'form-control', required: true = f.text_field :extern_uid, required: true, class: 'form-control', required: true
.form-actions .form-actions
= f.submit 'Save changes', class: "btn btn-save" = f.submit 'Save changes', class: "btn btn-save"
......
module Gitlab
module OAuth
class Provider
def self.names
providers = []
Gitlab.config.ldap.servers.values.each do |server|
providers << server['provider_name']
end
Gitlab.config.omniauth.providers.each do |provider|
providers << provider['name']
end
providers
end
end
end
end
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