insaniac has asked for the wisdom of the Perl Monks concerning the following question:
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
So, in both cases (OpenLDAP, Netscape LDAP), this goes perfect.$VAR1 = bless( { 'uid' => 'someuid' }, 'MVG::User' );
Now here it comes: in the template I do stuff like this:
Like I said before, the template code works perfect for OpenLDAP, for Netscape LDAP wicked stuff happens![% FOREACH method IN user.columns.sort -%] <tr> <th> [% method -%]: </th> [%- IF method == "mail"-%] <td> <a href="mailto:[% user.$method || " " -%]"> +[% user.$method || " " -%] </td> [%- ELSE -%] <td> [% user.$method || " " -%] </td> [%- END -%] </tr> [%- END -%]
__PACKAGE__->columns(All => qw/uid dn cn sn name telephonenumber objec +tclass title ou description departement givenname mobile postaladdress employeenumber room +number mail/ );
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBD::LDAP and Class::DBI situation
by g0n (Priest) on Apr 07, 2005 at 14:29 UTC | |
by insaniac (Friar) on Apr 07, 2005 at 14:40 UTC | |
by g0n (Priest) on Apr 07, 2005 at 14:52 UTC | |
by insaniac (Friar) on Apr 07, 2005 at 15:07 UTC | |
|
Re: DBD::LDAP and Class::DBI situation
by perrin (Chancellor) on Apr 07, 2005 at 16:33 UTC | |
by insaniac (Friar) on Apr 07, 2005 at 17:44 UTC | |
by insaniac (Friar) on Apr 08, 2005 at 08:17 UTC | |
|
Re: DBD::LDAP and Class::DBI situation
by insaniac (Friar) on Apr 07, 2005 at 15:03 UTC | |
|
Re: DBD::LDAP and Class::DBI situation
by insaniac (Friar) on Apr 07, 2005 at 18:11 UTC |