Skip to content

Commit

Permalink
applied changes from ssl branch
Browse files Browse the repository at this point in the history
  • Loading branch information
dpmcnevin committed Aug 5, 2010
2 parents 1effe5a + 0452883 commit d966b02
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/devise_ldap_authenticatable/ldap_adapter.rb
Expand Up @@ -27,12 +27,14 @@ class LdapConnect

def initialize(params = {})
ldap_config = YAML.load(ERB.new(File.read(::Devise.ldap_config || "#{Rails.root}/config/ldap.yml")).result)[Rails.env]
ldap_options = params
ldap_options[:encryption] = :simple_tls if ldap_config["ssl"]

@ldap = Net::LDAP.new # (ldap_options)
@ldap = Net::LDAP.new(ldap_options)
@ldap.host = ldap_config["host"]
@ldap.port = ldap_config["port"]
@ldap.base = ldap_config["base"]
@ldap.encryption(:simple_tls) if ldap_config["ssl"]
@attribute = ldap_config["attribute"]

@group_base = ldap_config["group_base"]
Expand Down

0 comments on commit d966b02

Please sign in to comment.