Make provider a select for identities form in admin area
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
8f89a48847
commit
b21390936a
2 changed files with 22 additions and 3 deletions
|
@ -8,11 +8,11 @@
|
|||
.form-group
|
||||
= f.label :provider, class: 'control-label'
|
||||
.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
|
||||
= f.label :extern_uid, class: 'control-label'
|
||||
= f.label :extern_uid, "Identifier", class: 'control-label'
|
||||
.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
|
||||
= f.submit 'Save changes', class: "btn btn-save"
|
||||
|
|
19
lib/gitlab/o_auth/provider.rb
Normal file
19
lib/gitlab/o_auth/provider.rb
Normal 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
|
Loading…
Reference in a new issue