lib/activeldap/configuration.rb in ruby-activeldap-debug-0.6.0 vs lib/activeldap/configuration.rb in ruby-activeldap-debug-0.7.0

- old
+ new

@@ -4,12 +4,28 @@ # # Configuration provides the default settings required for # ActiveLDAP to work with your LDAP server. All of these # settings can be passed in at initialization time. module Configuration - @@host = "127.0.0.1" - @@port = 389 - @@bind_format = "cn=%s,dc=localdomain" + DEFAULT_CONFIG = {} + DEFAULT_CONFIG[:host] = '127.0.0.1' + DEFAULT_CONFIG[:port] = 389 + DEFAULT_CONFIG[:method] = :plain # :ssl, :tls, :plain allowed + + DEFAULT_CONFIG[:bind_format] = "cn=%s,dc=localdomain" + DEFAULT_CONFIG[:user] = ENV['USER'] + DEFAULT_CONFIG[:password_block] = nil + DEFAULT_CONFIG[:password] = nil + DEFAULT_CONFIG[:store_password] = true + DEFAULT_CONFIG[:allow_anonymous] = true + DEFAULT_CONFIG[:sasl_quiet] = false + DEFAULT_CONFIG[:try_sasl] = false + + DEFAULT_CONFIG[:retries] = 3 + DEFAULT_CONFIG[:retry_wait] = 3 + + DEFAULT_CONFIG[:logger] = nil + DEFAULT_CONFIG[:ldap_scope] = LDAP::LDAP_SCOPE_ONELEVEL # Make the return value the string that is your LDAP base def Base.base 'dc=localdomain' end