hi fellas and felines,

I've got the weirdest situation problem. Last week, I've started playing with DBD::LDAP together with Class::DBI. Well, I want to use DBD::LDAP as datasource for Class::DBI because I was creating a web based LDAP browser. I'm using the Class::DBI since I was too lazy to create all the search and search_like subs.

So, OKAY, all goes perfect and smoothly and jiggy when I query a OpenLDAP server. It even works very fast!
But here it comes: when I try to query a Netscape LDAP server (that's the one their using at my work), it returns very weird stuff.

Some more information. I'm building the webpages with Template. I can see when I use the retrieve() method of Class::DBI that it retrieves that uid I've asked for

eval { $vars->{user} = MVG::User->retrieve( %data ) ; }; # %data contains keys/values from q->params # MVG::User isa class with Class::DBI as base # $vars->{user} is the var I'm passing to Template

This works! The object passed to the template looks like this (in Dumper):
$VAR1 = bless( { 'uid' => 'someuid' }, 'MVG::User' );
So, in both cases (OpenLDAP, Netscape LDAP), this goes perfect.

Now here it comes: in the template I do stuff like this:

[% FOREACH method IN user.columns.sort -%] <tr> <th> [% method -%]: </th> [%- IF method == "mail"-%] <td> <a href="mailto:[% user.$method || "&nbsp;" -%]"> +[% user.$method || "&nbsp;" -%] </td> [%- ELSE -%] <td> [% user.$method || "&nbsp;" -%] </td> [%- END -%] </tr> [%- END -%]
Like I said before, the template code works perfect for OpenLDAP, for Netscape LDAP wicked stuff happens!
Lemme elaborate:

I've been testing and testing for about 4 days now.. and I haven't got a clue what's wrong!

Oh yeah: you need to patch/hack the DBD::LDAP (mostly JLdap.pm) a little bit before it works nicely with Class::DBI.. a lot of the match and substitute actions need an extra i (case insensitive) at the end ;-) I've mailed the author about this, but he's not reacting on my mails..

So.. if someone can think of some more test I can do, maybe some experiences he had about this... ANYTHING is welcome! I just don't understand why the code works perfect on a OpenLDAP server, and it doesn't on Netscape (well, it does according to Ethereal..).

Sorry for the very long post... but i needed to talk to someone.
Many thanks in advance for bearing with me..

to ask a question is a moment of shame
to remain ignorant is a lifelong shame


In reply to DBD::LDAP and Class::DBI situation by insaniac

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.