LEMONLDAP::NG : correct little bug in LDAP config backend, and add examples of LDAP configuration backend

This commit is contained in:
Clément Oudot 2009-04-06 10:11:05 +00:00
parent d51cf49d21
commit 67c921f62a
3 changed files with 23 additions and 1 deletions

View File

@ -17,6 +17,7 @@ use Regexp::Assemble;
#inherits Lemonldap::NG::Common::Conf::File
#inherits Lemonldap::NG::Common::Conf::DBI
#inherits Lemonldap::NG::Common::Conf::SOAP
#inherits Lemonldap::NG::Common::Conf::LDAP
use constant DEFAULTCONFFILE => "/etc/lemonldap-ng/storage.conf";
@ -35,6 +36,8 @@ our %_confFiles;
# - { Type => "DBI", dbiChain => "DBI:mysql:database=lemonldap-ng;host=1.2.3.4",
# dbiUser => "user", dbiPassword => "password" },
# - { Type => "SOAP", proxy => "https://manager.example.com/soapmanager.pl" },
# - { Type => "LDAP", ldapServer => "ldap://localhost", ldapConfBranch => "ou=conf,ou=applications,dc=example,dc=com",
# ldapBindDN => "cn=manager,dc=example,dc=com", ldapBindPassword => "secret"},
#
# $self->{type} contains the type of configuration access system and the
# corresponding package is loaded.
@ -415,6 +418,16 @@ L<Lemonldap::NG::Manager::SOAPServer> is configured to use the real session
storage type (DBI or File for example). See L<Lemonldap::NG::Conf::SOAP> for
more.
=item * B<LDAP>:
$confAccess = new Lemonldap::NG::Common::Conf(
{
type => 'LDAP',
ldapServer => 'ldap://localhost',
ldapConfBranch => 'ou=conf,ou=applications,dc=example,dc=com',
ldapBindDN => 'cn=manager,dc=example,dc=com",
ldapBindPassword => 'secret'
});
=back
WARNING: You have to use the same storage type on all Lemonldap::NG parts in

View File

@ -163,7 +163,7 @@ sub load {
my $entry = $search->shift_entry();
my @confValues = $entry->get_value('description');
foreach (@confValues) {
my ( $k, $v ) = ( $_ =~ /\{(.*)\}(.*)/);
my ( $k, $v ) = ( $_ =~ /\{(.*?)\}(.*)/);
if ($fields) {
$f->{$k} = $v if ( grep { $_ eq $k } @$fields );
}

View File

@ -29,6 +29,15 @@
# User = lemonldap
# Password = mypassword
#
# * LDAP: you have to set ldapServer, ldapConfBranch, ldapBindDN and ldapBindPassword.
#
# type = LDAP
# ldapServer = ldap://localhost
# ldapConfBase = ou=conf,ou=applications,dc=example,dc=com
# ldapBindDN = cn=manager,dc=example,dc=com
# ldapBindPassword = secret
#
#
# 2 - LocalStorage
#
# To increase performances, use a local cache for the configuration. You have