Sophie

Sophie

distrib > Mandriva > 2009.0 > x86_64 > media > contrib-release > by-pkgid > 1e7e9638edf0671daaacd16b3392c029 > files > 56

ruby-ldap-0.9.7-3mdv2008.1.x86_64.rpm

# -*- ruby -*-
# This file is a part of test scripts of LDAP extension module.

$test = File.dirname($0)
require "#{$test}/conf"
require "./ldap"

$KCODE = "UTF8"

conn = LDAP::Conn.new($HOST, $PORT)
conn.perror("bind")
conn.bind{
  # search2 returns an array of hash
  print("search2 without a block:\n")
  conn.search2("dc=localhost, dc=localdomain", LDAP::LDAP_SCOPE_SUBTREE,
	       "(objectclass=*)", nil, false, 0, 0).each{|ent|
    ent.each{|attr,vals|
      print("#{attr}: #{vals.join(', ')}\n")
    }
    print("\n")
  }
  GC.start()
}