require 'activeldap'
require 'examples/objects/user'
require 'password'

# Instantiate Ruby/ActiveLDAP connection, etc
ActiveLDAP::Base.connect(:password_block => Proc.new {
  Password.get('Password: ') }, :allow_anonymous => false)

# Load a user record (Class defined in the examples)
wad = User.new('wad')

# Print the common name
p wad.cn

# Change the common name
wad.cn = "Will"

# Save it back to LDAP
wad.write

