1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-03 13:47:01 +03:00

F #3366: allow alternative base for ldap groups (#3379)

Signed-off-by: Steven Armstrong <steven.armstrong@id.ethz.ch>
This commit is contained in:
Steven Armstrong 2019-06-03 13:39:51 +02:00 committed by Tino Vázquez
parent 26ed3d5570
commit 339a87475d

View File

@ -39,6 +39,7 @@ class OpenNebula::LdapAuth
:user => nil,
:password => nil,
:base => nil,
:group_base => nil,
:auth_method => :simple,
:user_field => 'cn',
:user_group_field => 'dn',
@ -198,9 +199,10 @@ class OpenNebula::LdapAuth
end
end
else
group_base = @options[:group_base] ? @options[:group_base] : @options[:base]
filter = Net::LDAP::Filter.equals(@options[:group_field], @user[@options[:user_group_field]].first)
@ldap.search(
:base => @options[:base],
:base => group_base,
:attributes => [ "dn" ],
:filter => filter
) do |entry|