1
0
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:
Javi Fontan 2013-04-26 17:16:32 +02:00
parent eb6dba41d5
commit 583eef9867
2 changed files with 7 additions and 20 deletions

View File

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

View File

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