From 3b708387049f2caed5cc7fa4707f08fccb3990d1 Mon Sep 17 00:00:00 2001
From: Xavier Guimard
Date: Tue, 15 May 2007 04:31:10 +0000
Subject: [PATCH] LEMONLDAP::NG : version 0.8.2.1. Bug correction in DBI
configuration access
---
build/lemonldap-ng/TODO | 2 +-
build/lemonldap-ng/debian/changelog | 4 +++-
.../lib/Lemonldap/NG/Manager/Conf/DBI.pm | 4 ++++
.../lib/Lemonldap/NG/Manager/Help.pm | 11 ++++++---
modules/lemonldap-ng-portal/Changes | 3 +++
.../lib/Lemonldap/NG/Portal.pm | 2 +-
.../lib/Lemonldap/NG/Portal/Simple.pm | 23 ++++++++++---------
7 files changed, 32 insertions(+), 17 deletions(-)
diff --git a/build/lemonldap-ng/TODO b/build/lemonldap-ng/TODO
index 623138e1e..9de628926 100644
--- a/build/lemonldap-ng/TODO
+++ b/build/lemonldap-ng/TODO
@@ -9,7 +9,7 @@ Modify example to use nameVirtualHost instead of 127.0.0.x adresses
- Priority: Low Status: In progress Created: 2007\05\03 10-41-36
Modify install to make a running example as debian install
- Priority: Low Status: Planning Created: 2007\04\23 21-26-18
-TLS in LDAP connection. SSL works, but start_tls cannot yet be called.
+TLS in LDAP connections
- Priority: Low Status: N/A Created: 2007\04\21 13-14-55
Simplified manager interface fo rules:
* simplified regexp (* instead of .*,...)
diff --git a/build/lemonldap-ng/debian/changelog b/build/lemonldap-ng/debian/changelog
index 6be4de2ef..4a3b0b155 100644
--- a/build/lemonldap-ng/debian/changelog
+++ b/build/lemonldap-ng/debian/changelog
@@ -2,8 +2,10 @@ lemonldap-ng (0.8.2.1) unstable; urgency=low
* More documentation
* Virtual host names control
+ * Portal can now use more than one LDAP server
+ * Bug in DBI.pm
- -- Xavier Guimard Fri, 11 May 2007 09:49:20 +0200
+ -- Xavier Guimard Tue, 15 May 2007 06:19:23 +0200
lemonldap-ng (0.8.2) unstable; urgency=low
diff --git a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/DBI.pm b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/DBI.pm
index d4548043d..187b40518 100644
--- a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/DBI.pm
+++ b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/DBI.pm
@@ -8,6 +8,10 @@ use Lemonldap::NG::Manager::Conf::Constants;
our $VERSION = 0.14;
+BEGIN {
+ *Lemonldap::NG::Manager::Conf::dbh = \&dbh;
+}
+
sub prereq {
my $self = shift;
unless ( $self->{dbiChain} ) {
diff --git a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Help.pm b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Help.pm
index 78e85a180..ca54e6be2 100644
--- a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Help.pm
+++ b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Help.pm
@@ -2,7 +2,7 @@ package Lemonldap::NG::Manager::Help;
use AutoLoader qw(AUTOLOAD);
use UNIVERSAL qw(can);
-our $VERSION = '0.33';
+our $VERSION = '0.34';
sub import {
my ($caller_package) = caller;
@@ -193,7 +193,9 @@ authentication is done by another system (SSL for example).
LDAP server : Name (or IP address) of the LDAP server. To use LDAPS, set
here :
ldaps://server/
- and don't forget to change port (636 for example)
+ and don't forget to change port (636 for example). You can specify more than
+ one server separated by commas. They will be tried in the specified order.
+
LDAP account : optional, must be set if anonymous connection cannot
access to the wanted LDAP attributes. This account is used before LDAP
authentication to find user's dn ;
@@ -217,7 +219,10 @@ réalisée par un autre moyen (SSL par exemple).
Serveur LDAP : Nom (ou adresse IP) du serveur LDAP. Pour une connexion
LDAPS, indiquez ici :
ldaps://server/
- et n'oubliez pas de changer le port (636 en général)
+ et n'oubliez pas de changer le port (636 en général). Vous
+ pouvez indiquer plusieurs serveurs ici séparés par des virgules. Ils seront
+ testés dans l'ordre indiqué.
+
Compte de connexion LDAP : optionnel, à renseigner si les attributs LDAP
utilisés ne sont pas accessibles par une session anonyme. Ce compte est
utilisé avant l'authentification pour trouver le dn de l'utilisateur ;
diff --git a/modules/lemonldap-ng-portal/Changes b/modules/lemonldap-ng-portal/Changes
index a6355ea8b..71a3b3a49 100644
--- a/modules/lemonldap-ng-portal/Changes
+++ b/modules/lemonldap-ng-portal/Changes
@@ -1,5 +1,8 @@
Revision history for Perl extension Lemonldap::NG::Portal.
+0.74 Mon May 14 7:04:48 2007
+ - Multiple ldap servers can be used
+
0.73 Fri Apr 20 8:48:06 2007
- Bug fix in test (AuthCAS failed)
diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal.pm
index 17180fde2..7e8255236 100644
--- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal.pm
+++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal.pm
@@ -2,7 +2,7 @@ package Lemonldap::NG::Portal;
print STDERR
"See Lemonldap::NG::Portal(3) to know which Lemonldap::NG::Portal::* module to use.";
-our $VERSION = "0.73";
+our $VERSION = "0.74";
1;
diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm
index 46e64c884..81900f959 100644
--- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm
+++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm
@@ -13,7 +13,7 @@ use CGI::Cookie;
require POSIX;
use Lemonldap::NG::Portal::_i18n;
-our $VERSION = '0.72';
+our $VERSION = '0.74';
our @ISA = qw(CGI Exporter);
@@ -263,15 +263,15 @@ sub formateFilter {
# 5. First LDAP connexion used to find user DN with the filter defined before.
sub connectLDAP {
my $self = shift;
- return PE_LDAPCONNECTFAILED
- unless (
- $self->{ldap}
- or $self->{ldap} = Net::LDAP->new(
- $self->{ldapServer},
+ return PE_OK if ( $self->{ldap} );
+ foreach my $server ( split /[\s,]+/, $self->{ldapServer} ) {
+ last if $self->{ldap} = Net::LDAP->new(
+ $server,
port => $self->{ldapPort},
onerror => undef,
- )
- );
+ );
+ }
+ return PE_LDAPCONNECTFAILED unless ( $self->{ldap} );
PE_OK;
}
@@ -457,7 +457,7 @@ Lemonldap::NG::Portal::Simple - Base module for building Lemonldap::NG compatibl
LockUserName => 'db_user',
LockPassword => 'db_password',
},
- ldapServer => 'ldap.domaine.com',
+ ldapServer => 'ldap.domaine.com,ldap-backup.domaine.com',
securedCookie => 1,
exportedVars => ["uid","cn","mail","appli"],
);
@@ -504,8 +504,9 @@ Lemonldap::Portal::* libraries.
=over
-=item * ldapServer: server used to retrive session informations and to valid
-credentials (localhost by default).
+=item * ldapServer: server(s) used to retrive session informations and to valid
+credentials (localhost by default). More than one server can be set here
+separated by commas. The servers will be tested in the specifies order.
=item * ldapPort: tcp port used by ldap server.