From: Francis Cianfrocca Date: 2007-06-28T01:19:54+09:00 Subject: Re: Net::LDAP and telephonenumber attribute ------=_Part_27933_30141377.1182961192553 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 6/26/07, pearly wrote: > > Hi, > > Using the LDAP service of a Lotus Notes / Domino server, I cannot > get the telephone attribute for people. Sad it is but Lotus like M$ > call it telephonenumber. I use 'net/ldap' for this which works fine > for > other attributes. Net::LDAP#search delivers an Array of > Net::LDAP::Entry objects, and I can call attributes like the > following simplified example shows: > > ldap.search( :base => base, :filter => ldap_filter ) do |entry| > puts "DN: #{entry.dn} Name: #{entry.givenname} #{entry.sn}" > end > > Now, it looks like the telephonenumber attribute is not delivered. > Having done a simillar application in Perl (using Net::LDAP) which > still works with the same LDAP server and parameters, I know the > attribute should be there. But the following results in a > NoMethodError exception. > > ldap.search( :base => base, :filter => ldap_filter ) do |entry| > puts "Phone: #{entry.telephonenumber}" > end > > Using entry.telephone doesn't help, and adding the attribute > list to the Net::LDAP#search (e.g. [:dn, :sn, :telephonenumber]) > doesn't help. > > Btw: In the above code block I tried entry.methods.sort > and was really surprised it did not show things like 'dn' or > 'mail' as its methods; however they are working. > > Any idea how to get this telephonenumber attribute? > > MP > > > What happens if you use Net::LDAP::Entry#each to dump out all of the attributes that were returned from the server? ------=_Part_27933_30141377.1182961192553--