Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Devise::LdapAdapter.get_ldap_param return nil when array passed #69
I have in ldap user with two 'mail' attribute
When I try to search it using get_ldap_param I get nil. When user has only one attribute all ok.
Here is a little test i wrote in irb:
irb(main):006:0> a = [1,2]
I think you're right. Do you mind preparing a test case and a fix for this? Let me know. If not, I'll get to it when I get the chance. In the meantime, adding this to an initializer should fix it:
If this doesn't address your issue, let me know and I'll poke around further.
Thank you for reply.
I also propose to change the behavior of ldap_param_value to always return array. It related to ldap nature that you can have several same params with different values and NET::LDAP::Entry always return array. This helps developers to keep in mind that they suddenly can get array of values.
If the get_ldap_param will always return array I can safely write:
I looked at this topic: http://stackoverflow.com/a/5684335/1111202