From 660252a004f51bedb321d878af4f6a328c884b80 Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Tue, 15 May 2007 18:06:24 +0000 Subject: [PATCH] LEMONLDAP::NG : little bug correction in configuration syntax control (Closes: #307044) and more tests in Manager --- build/lemonldap-ng/debian/changelog | 3 +-- modules/lemonldap-ng-manager/Changes | 3 +++ .../lib/Lemonldap/NG/Manager.pm | 4 ++-- .../lib/Lemonldap/NG/Manager/Conf/SOAP.pm | 2 +- .../t/Lemonldap-NG-Manager-Conf-DBI.t | 4 +++- .../t/Lemonldap-NG-Manager-Conf-SOAP.t | 17 ++++++++++++++--- 6 files changed, 24 insertions(+), 9 deletions(-) diff --git a/build/lemonldap-ng/debian/changelog b/build/lemonldap-ng/debian/changelog index 4a3b0b155..645180bd4 100644 --- a/build/lemonldap-ng/debian/changelog +++ b/build/lemonldap-ng/debian/changelog @@ -3,9 +3,8 @@ 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 Tue, 15 May 2007 06:19:23 +0200 + -- Xavier Guimard Mon, 14 May 2007 07:14:10 +0200 lemonldap-ng (0.8.2) unstable; urgency=low diff --git a/modules/lemonldap-ng-manager/Changes b/modules/lemonldap-ng-manager/Changes index 2a3d50e17..f9b725bbf 100644 --- a/modules/lemonldap-ng-manager/Changes +++ b/modules/lemonldap-ng-manager/Changes @@ -1,5 +1,8 @@ Revision history for Perl extension Lemonldap::NG::Manager. +0.66 Tue May 15 19:53:40 2007 + - Little bug correction: '-' is authorized in domain names + 0.65 Sun May 6 16:15:49 2007 - SOAP: HTTP basic authentication and little bug correction in 'sessions' mode diff --git a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm index 314faaa05..5334c2d99 100644 --- a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm +++ b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm @@ -16,7 +16,7 @@ use MIME::Base64; our @ISA = qw(Lemonldap::NG::Manager::Base); -our $VERSION = '0.65'; +our $VERSION = '0.66'; sub new { my ( $class, $args ) = @_; @@ -408,7 +408,7 @@ sub checkConf { # Check cookie name return 0 unless( $config->{cookieName} =~ /^\w+$/ ); # Check domain name - return 0 unless( $config->{domain} =~ /^[\w\.]+$/ ); + return 0 unless( $config->{domain} =~ /^\w[\w\.\-]*\w$/ ); # Load variables foreach(keys %{ $config->{exportedVars} }) { # Reserved words diff --git a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/SOAP.pm b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/SOAP.pm index 9e9c1d893..b61698df0 100644 --- a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/SOAP.pm +++ b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/SOAP.pm @@ -18,7 +18,7 @@ our ( $username, $password ) = ( '', '' ); sub prereq { my $self = shift; unless ( $self->{proxy} ) { - print STDERR 'No SOAP parameters found (proxy and uri)'; + print STDERR 'No SOAP parameters found (proxy)'; return 0; } 1; diff --git a/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf-DBI.t b/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf-DBI.t index b979caaaf..33926b844 100644 --- a/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf-DBI.t +++ b/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf-DBI.t @@ -5,7 +5,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; -use Test::More tests => 2; +use Test::More tests => 3; BEGIN { use_ok('Lemonldap::NG::Manager::Conf') } ######################### @@ -24,3 +24,5 @@ ok( } ) ); + +ok( $h->can( 'dbh' ) ); diff --git a/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf-SOAP.t b/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf-SOAP.t index 61c32ea53..59560e962 100644 --- a/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf-SOAP.t +++ b/modules/lemonldap-ng-manager/t/Lemonldap-NG-Manager-Conf-SOAP.t @@ -5,7 +5,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; -use Test::More tests => 1; +use Test::More tests => 4; # SOAP::Lite is not required, so Lemonldap::NG::Manager::Conf::SOAP may # not run. @@ -13,9 +13,20 @@ SKIP: { eval { require SOAP::Lite }; skip "SOAP::Lite is not installed, so SOAP configuration access will not work", - 1 + 4 if ($@); - use_ok('Lemonldap::NG::Manager::Conf::SOAP'); + use_ok('Lemonldap::NG::Manager::Conf'); + my $h; + ok( + $h = new Lemonldap::NG::Manager::Conf( + { + type => 'SOAP', + proxy => 'http://localhost', + } + ) + ); + ok( $h->can( '_connect' ) ); + ok( $h->can( '_soapCall' ) ); } #########################