Skip to content

Instantly share code, notes, and snippets.

@gustaflindqvist
Last active December 11, 2015 21:29
Show Gist options
  • Save gustaflindqvist/4662838 to your computer and use it in GitHub Desktop.
Save gustaflindqvist/4662838 to your computer and use it in GitHub Desktop.
def check_ldap_user(name)
filter = Net::LDAP::Filter.eq("cn", name)
treebase = "dc=foo, dc=bar"
ldap.search(:base => treebase, :filter => filter, :attributes => attrs,
:return_result => false) do |entry|
entry.each do |attribute, values|
values.each do |value|
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment