Make provider a select for identities form in admin area

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2015-06-22 16:53:11 +02:00
parent 8f89a48847
commit b21390936a
No known key found for this signature in database
GPG key ID: 161B5D6A44D3D88A
2 changed files with 22 additions and 3 deletions

View file

@ -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"

View file

@ -0,0 +1,19 @@
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