Hi,
Can I get help at this?

The code:

require 'rubygems'
require 'activeldap'

ActiveLDAP::Base.connect(
  :host => '127.0.0.1',
  :base => 'dc=test,dc=com',
  :bind_format => 'cn=Manager,dc=test,dc=com',
  :password_block => Proc.new { 'xxxxx' },
  :allow_anonymous => false
)


class User < ActiveLDAP::Base
        ldap_mapping :dnattr => 'cn', :prefix => 'ou=users', :classes => 
['inetOrgPerson']
end

user = User.new('tony')
user.objectClass = user.objectClass  << 'inetOrgPerson'
user.cn = 'Tony'
user.userPassword = 'yeahbaby'
user.write

puts "User created"

and the error is:


/usr/pkg/lib/ruby/gems/1.8/gems/ruby-activeldap-0.7.4/lib/activeldap/base.rb:1377:in 
`attribute_method=': cannot modify the DN attribute value 
(ActiveLDAP::AttributeAssignmentError)
        from 
/usr/pkg/lib/ruby/gems/1.8/gems/ruby-activeldap-0.7.4/lib/activeldap/base.rb:957:in 
`method_missing'
        from ldapadd.rb:19

What am I doing wrong?

-- 
Posted via http://www.ruby-forum.com/.