mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-13 13:17:39 +03:00
Revert "feature #1916: add user_group_field support to ldap"
This reverts commit d30b0f1bd1
.
This commit is contained in:
parent
eb6dba41d5
commit
583eef9867
@ -68,7 +68,7 @@ order.each do |server_name|
|
||||
begin
|
||||
ldap=OpenNebula::LdapAuth.new(server_conf)
|
||||
|
||||
user_name, user_group=ldap.find_user(user)
|
||||
user_name=ldap.find_user(user)
|
||||
|
||||
if !user_name
|
||||
STDERR.puts "User #{user} not found"
|
||||
@ -76,10 +76,8 @@ begin
|
||||
end
|
||||
|
||||
if server_conf[:group]
|
||||
group=server_conf[:group]
|
||||
if (server_conf[:user_group_field] && group!=user_group) ||
|
||||
!ldap.is_in_group?(user_name, group)
|
||||
STDERR.puts "User #{user} is not in group #{group}"
|
||||
if !ldap.is_in_group?(user_name, server_conf[:group])
|
||||
STDERR.puts "User #{user} is not in group #{server_conf[:group]}"
|
||||
next
|
||||
end
|
||||
end
|
||||
|
@ -56,29 +56,18 @@ class OpenNebula::LdapAuth
|
||||
:filter => "#{@options[:user_field]}=#{name}")
|
||||
|
||||
if result && result.first
|
||||
n=result.first.dn
|
||||
if @options[:user_group_field]
|
||||
g=result.first[:user_group_field]
|
||||
else
|
||||
g=nil
|
||||
end
|
||||
[n, g]
|
||||
result.first.dn
|
||||
else
|
||||
result=@ldap.search(:base => name)
|
||||
|
||||
if result && result.first
|
||||
if @options[:user_group_field]
|
||||
g=result.first[:user_group_field]
|
||||
else
|
||||
g=nil
|
||||
end
|
||||
[name, g]
|
||||
name
|
||||
else
|
||||
[nil, nil]
|
||||
nil
|
||||
end
|
||||
end
|
||||
rescue
|
||||
[nil, nil]
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user