From: Vincent M. <Vin...@un...> - 2002-01-31 09:12:12
|
The patch doesn't work. I propose another patch (diff LDAP.pm file from LDAP.pm) which works in the same way that the other API LDAP (netscape, openldap, perldap Mozilla, ...) Following syntaxes are possible: Net::LDAP->new(ldap.univ.fr); -> ldap on port 389 Net::LDAP->new(ldap.univ.fr, port => 392); -> ldap on port 392 Net::LDAP->new(ldap.univ.fr:392); -> ldap on port 392 Net::LDAP->new(ldap.univ.fr:392, port => 395); -> ldap on port 392 Net::LDAP->new(ldap.univ.fr, ldap2.univ.fr); -> ldap on port 389, then ldap2 on port 389 if impossible connection on ldap:389 Net::LDAP->new(ldap.univ.fr, ldap2.univ.fr, port => 395); -> ldap on port 395, then ldap2 on port 395 if impossible connection on ldap:395 Net::LDAP->new(ldap.univ.fr:392, ldap2.univ.fr); -> ldap on port 392, then ldap2 on port 389 if impossible connection on ldap:392 Net::LDAP->new(ldap.univ.fr:392, ldap2.univ.fr:395); -> ldap on port 392, then ldap2 on port 395 if impossible connection on ldap:392 Net::LDAP->new(ldap.univ.fr:392, ldap2.univ.fr, port => 395); -> ldap on port 392, then ldap2 on port 395 if impossible connection on ldap The other options are available. Vincent A 13:20 30/01/02 +0000, Graham Barr a écrit : >Several people have ask for this in the past. > >Try the attached patch. It accepts an array ref for the host and >will try each in turn. > >Graham. > >On Wed, Jan 30, 2002 at 11:22:01AM +0100, Vincent MATHIEU wrote: >> Hi, >> >> I use the perldap module to acces LDAP server (OpenLDAP). >> >> I use replica servers LDAP and I wish to be able to access the backup server in case of dysfunction >> of the master server. >> >> With other api, it is possible to indicate in the server names a list of servers. >> >> for exemple : >> $ldap = Net::LDAP->new(ldap.univ.fr:392,ldap2.univ-nancy2.fr:395); >> >> if ldap.univ-nancy2.fr:392 is unaccessible, then an attempt is made for access to ldap2.univ-nancy2.fr:395 >> >> It is not possible actualy do do this with the Net::LDAP module. >> >> Is it possible to modify the module so that it accepts this possibility (I can propose the patch) either I should create a class perl which inherits from the class Net::LDAP? >> >> Thanks >> >> >> -- >> Vincent MATHIEU >> CRI - Universite NANCY 2 | Email : Vin...@un... >> Pole Lorrain de Gestion | Tel : (33) 03.83.39.64.06 >> 13, Rue Michel Ney - C.O. 75 | Fax : (33) 03.83.39.64.43 >> 54013 Nancy Cedex. FRANCE |