I get an error when I am attempting to add a user to a group they already belong to:
group.has_member?(user)
TypeError: can't convert Symbol into Integer
from /home/acaeti/.rvm/gems/ruby-1.9.3-p392/gems/active_directory-1.5.5/lib/active_directory/base.rb:345:in []' from /home/acaeti/.rvm/gems/ruby-1.9.3-p392/gems/active_directory-1.5.5/lib/active_directory/base.rb:345:in=='
from /home/acaeti/.rvm/gems/ruby-1.9.3-p392/gems/active_directory-1.5.5/lib/active_directory/member.rb:31:in include?' from /home/acaeti/.rvm/gems/ruby-1.9.3-p392/gems/active_directory-1.5.5/lib/active_directory/member.rb:31:inmember_of?'
from /home/acaeti/.rvm/gems/ruby-1.9.3-p392/gems/active_directory-1.5.5/lib/active_directory/group.rb:48:in has_member?' from (irb):31 from /home/acaeti/.rvm/rubies/ruby-1.9.3-p392/bin/irb:13:in'
It seems to stem from code in the member.rb function "member_of?".
At line 28 in member.rb it seems you set a variable "group_dns":
group_dns = memberOf
And at line 31 you see if this "includes?" the DN of the group in question:
group_dns.include?(usergroup.dn)
However, the "group_dns" is an Array of ActiveDirectory::Group objects, which is being compared by the include?() to a Net::BER::BerIdentifiedString. This isn't going to work :).
I think the line 31 code should be "group_dns.include?(usergroup)" instead.
I get an error when I am attempting to add a user to a group they already belong to:
group.has_member?(user) TypeError: can't convert Symbol into Integer from /home/acaeti/.rvm/gems/ruby-1.9.3-p392/gems/active_directory-1.5.5/lib/active_directory/base.rb:345:in'
[]' from /home/acaeti/.rvm/gems/ruby-1.9.3-p392/gems/active_directory-1.5.5/lib/active_directory/base.rb:345:in
==' from /home/acaeti/.rvm/gems/ruby-1.9.3-p392/gems/active_directory-1.5.5/lib/active_directory/member.rb:31:ininclude?' from /home/acaeti/.rvm/gems/ruby-1.9.3-p392/gems/active_directory-1.5.5/lib/active_directory/member.rb:31:in
member_of?' from /home/acaeti/.rvm/gems/ruby-1.9.3-p392/gems/active_directory-1.5.5/lib/active_directory/group.rb:48:inhas_member?' from (irb):31 from /home/acaeti/.rvm/rubies/ruby-1.9.3-p392/bin/irb:13:in
It seems to stem from code in the member.rb function "member_of?".
At line 28 in member.rb it seems you set a variable "group_dns": group_dns = memberOf And at line 31 you see if this "includes?" the DN of the group in question: group_dns.include?(usergroup.dn)
However, the "group_dns" is an Array of ActiveDirectory::Group objects, which is being compared by the include?() to a Net::BER::BerIdentifiedString. This isn't going to work :).
I think the line 31 code should be "group_dns.include?(usergroup)" instead.