Module: ActiveLdap::Operations::LDIF

Defined in:
lib/active_ldap/operations.rb

Instance Method Summary collapse

Instance Method Details

#dump(options = {}) ⇒ Object



296
297
298
299
300
301
302
303
304
# File 'lib/active_ldap/operations.rb', line 296

def dump(options={})
  ldifs = []
  options = {:base => base, :scope => scope}.merge(options)
  conn = options[:connection] || connection
  conn.search(options) do |dn, attributes|
    ldifs << to_ldif(dn, attributes)
  end
  ldifs.join("\n")
end

#load(ldifs, options = {}) ⇒ Object



311
312
313
314
# File 'lib/active_ldap/operations.rb', line 311

def load(ldifs, options={})
  conn = options[:connection] || connection
  conn.load(ldifs)
end

#to_ldif(dn, attributes, options = {}) ⇒ Object



306
307
308
309
# File 'lib/active_ldap/operations.rb', line 306

def to_ldif(dn, attributes, options={})
  conn = options[:connection] || connection
  conn.to_ldif(dn, unnormalize_attributes(attributes))
end