class LdapFluff::Config

Module class definitions

Attributes

ad_domain[RW]
anon_queries[RW]
base_dn[RW]
encryption[RW]
group_base[RW]
host[RW]
port[RW]
server_type[RW]
service_pass[RW]
service_user[RW]

Public Class Methods

new() click to toggle source
# File lib/ldap_fluff/config.rb, line 25
def initialize
  begin
    config = YAML.load_file(LdapFluff::CONFIG)
    @host = config["host"]
    @port = config["port"]
    if config["encryption"].respond_to? :to_sym
      @encryption = config["encryption"].to_sym
    else
      @encryption = nil
    end
    @base_dn = config["base_dn"]
    @group_base = config["group_base"]
    @ad_domain = config["ad_domain"]
    @service_user = config["service_user"]
    @service_pass = config["service_pass"]
    @anon_queries = config["anon_queries"]
    @server_type = config["server_type"]
  rescue Errno::ENOENT
    $stderr.puts("The #{LdapFluff::CONFIG} config file you specified was not found")
    exit
  rescue Errno::EACCES
    $stderr.puts("The #{LdapFluff::CONFIG} config file you specified is not readable")
    exit
  end
end