diff --git a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm index 81d704118..121d9ab47 100644 --- a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm +++ b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm @@ -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 is configured to use the real session storage type (DBI or File for example). See L for more. +=item * B: + $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 diff --git a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/LDAP.pm b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/LDAP.pm index 5bf2b8337..8c957358f 100644 --- a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/LDAP.pm +++ b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/LDAP.pm @@ -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 ); } diff --git a/modules/lemonldap-ng-common/storage.conf b/modules/lemonldap-ng-common/storage.conf index 912a47696..58f5144ab 100644 --- a/modules/lemonldap-ng-common/storage.conf +++ b/modules/lemonldap-ng-common/storage.conf @@ -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