Net::LDAP and telephonenumber attribute

Discussion in 'Ruby' started by pearly, Jun 26, 2007.

  1. pearly

    pearly Guest

    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
     
    pearly, Jun 26, 2007
    #1
    1. Advertising

  2. pearly

    pearly Guest

    Hi. Strange: Looks like somebody posted a reply
    which I could not see - neither in the news reader
    nor in groups.google.com.
    The sender's ID was 'garbagecat10'.
    I found the reply when giving it another trial
    under "Forbiddenweb Archive". Anybody any idea
    what happened there?

    Ok, here is the contributor's question back to me,
    so he/her or anybody else may have further ideas:

    > What happens if you use Net::LDAP::Entry#each to dump
    > out all of the attributes that were returned from the
    > server?


    This results in the following list:

    roaminguser
    mailsystem
    sn
    checkpassword
    cn
    messagestorage
    passwordchangeinterval
    displayname
    encryptincomingmail
    uid
    passwordgraceperiod
    originalmodtime
    roamcleansetting
    givenname
    objectclass
    roamcleanper
    mail
    maildomain
    personaltitle
    availablefordirsync
    dn

    So no telephonenumber, no telephone.

    Any further ideas?
    Thanks to all of you.
    MP
     
    pearly, Jul 17, 2007
    #2
    1. Advertising

  3. pearly

    barjunk Guest

    On Jul 17, 8:15 am, pearly <> wrote:
    > Hi. Strange: Looks like somebody posted a reply
    > which I could not see - neither in the news reader
    > nor in groups.google.com.
    > The sender's ID was 'garbagecat10'.
    > I found the reply when giving it another trial
    > under "Forbiddenweb Archive". Anybody any idea
    > what happened there?
    >
    > Ok, here is the contributor's question back to me,
    > so he/her or anybody else may have further ideas:
    >
    > > What happens if you use Net::LDAP::Entry#each to dump
    > > out all of the attributes that were returned from the
    > > server?

    >
    > This results in the following list:
    >
    > roaminguser
    > mailsystem
    > sn
    > checkpassword
    > cn
    > messagestorage
    > passwordchangeinterval
    > displayname
    > encryptincomingmail
    > uid
    > passwordgraceperiod
    > originalmodtime
    > roamcleansetting
    > givenname
    > objectclass
    > roamcleanper
    > mail
    > maildomain
    > personaltitle
    > availablefordirsync
    > dn
    >
    > So no telephonenumber, no telephone.
    >
    > Any further ideas?
    > Thanks to all of you.
    > MP



    The first thing that jumps to my mind is rights...have you tried this
    code as the "manager"?

    Anyway to turn logging way up on the server side so you can compare
    the requests that work against those that don't?

    Mike B.
     
    barjunk, Jul 20, 2007
    #3
  4. pearly

    Ted Knab Guest

    If you have access to the LDAP server admin, you might want to ask if
    there is a filter preventing anonymous binds from revealing the telephone
    attribute.

    Your code seems to imply that your are doing anonymous binds.


    pearly wrote:
    > Hi. Strange: Looks like somebody posted a reply
    > which I could not see - neither in the news reader
    > nor in groups.google.com.
    > The sender's ID was 'garbagecat10'.
    > I found the reply when giving it another trial
    > under "Forbiddenweb Archive". Anybody any idea
    > what happened there?
    >
    > Ok, here is the contributor's question back to me,
    > so he/her or anybody else may have further ideas:
    >
    >
    >> What happens if you use Net::LDAP::Entry#each to dump
    >> out all of the attributes that were returned from the
    >> server?
    >>

    >
    > This results in the following list:
    >
    > roaminguser
    > mailsystem
    > sn
    > checkpassword
    > cn
    > messagestorage
    > passwordchangeinterval
    > displayname
    > encryptincomingmail
    > uid
    > passwordgraceperiod
    > originalmodtime
    > roamcleansetting
    > givenname
    > objectclass
    > roamcleanper
    > mail
    > maildomain
    > personaltitle
    > availablefordirsync
    > dn
    >
    > So no telephonenumber, no telephone.
    >
    > Any further ideas?
    > Thanks to all of you.
    > MP
    >
    >
    >
     
    Ted Knab, Jul 20, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    533
    Raymond DeCampo
    Feb 21, 2006
  2. rcmn
    Replies:
    1
    Views:
    339
    =?ISO-8859-1?Q?Michael_Str=F6der?=
    Nov 6, 2006
  3. Jason Wold

    using LDAP Controls in ruby-ldap

    Jason Wold, Nov 4, 2004, in forum: Ruby
    Replies:
    5
    Views:
    254
  4. Replies:
    1
    Views:
    211
    Austin Ziegler
    Oct 11, 2006
  5. dacat

    Net::LDAP vs ruby/ldap

    dacat, Apr 27, 2007, in forum: Ruby
    Replies:
    3
    Views:
    299
    Ian Macdonald
    May 18, 2007
Loading...

Share This Page