diff --git a/build/lemonldap-ng/Makefile b/build/lemonldap-ng/Makefile index 561af1fc5..bde996ce2 100644 --- a/build/lemonldap-ng/Makefile +++ b/build/lemonldap-ng/Makefile @@ -131,7 +131,7 @@ dist: clean - $(MAKE) clean mkdir -p lemonldap-ng-$(VERSION) - cp -pR lemonldap-ng-manager/ lemonldap-ng-portal/ lemonldap-ng-handler/ * lemonldap-ng-$(VERSION) - - dir=lemonldap-ng-$(VERSION); find $$dir -name .svn -exec rm -rf {} \;# 2>/dev/null + - dir=lemonldap-ng-$(VERSION); find $$dir -name .svn -exec rm -rf {} \; 2>/dev/null rm -rf lemonldap-ng-$(VERSION)/lemonldap-ng-$(VERSION) tar czf lemonldap-ng-$(VERSION).tar.gz lemonldap-ng-$(VERSION) rm -rf lemonldap-ng-$(VERSION) diff --git a/modules/lemonldap-ng-handler/Changes b/modules/lemonldap-ng-handler/Changes index 8c487386e..6c7adc5f9 100644 --- a/modules/lemonldap-ng-handler/Changes +++ b/modules/lemonldap-ng-handler/Changes @@ -1,5 +1,8 @@ Revision history for Perl extension Lemonldap::NG::Handler. +0.84 Mon Jul 30 21:26:19 2007 + - New parameter to fix port in redirections. + 0.83 Sun Jul 22 22:19:12 2007 - New logout system : URL can now be declared in Manager interface diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler.pm index 3c74d70d6..e8567e797 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler.pm @@ -2,7 +2,7 @@ package Lemonldap::NG::Handler; print STDERR "See Lemonldap::NG::Handler(3) to know which Lemonldap::NG::Handler::* module to use."; -our $VERSION = "0.83"; +our $VERSION = "0.84"; 1; diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm index 9ae66e854..98b1133ca 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm @@ -7,7 +7,7 @@ use Exporter 'import'; use Safe; require POSIX; -our $VERSION = '0.83'; +our $VERSION = '0.84'; our %EXPORT_TAGS = ( localStorage => @@ -23,15 +23,9 @@ our %EXPORT_TAGS = ( import => [ qw( import @EXPORT_OK @EXPORT %EXPORT_TAGS ) ], headers => [ qw( - $forgeHeaders - lmHeaderIn - lmSetHeaderIn - lmHeaderOut - lmSetHeaderOut - lmSetErrHeaderOut - $cookieName - $cookieSecured - $https + $forgeHeaders lmHeaderIn lmSetHeaderIn lmHeaderOut + lmSetHeaderOut lmSetErrHeaderOut $cookieName $cookieSecured + $https $port ) ], traces => [ qw( $whatToTrace ) ], @@ -56,7 +50,7 @@ our ( $globalStorage, $globalStorageOptions, $localStorage, $localStorageOptions, $whatToTrace, $https, $refLocalStorage, $safe, $cookieSecured, - $logout, + $logout, $port ); ########################################## @@ -78,12 +72,8 @@ BEGIN { if ( MP() == 2 ) { require Apache2::RequestRec; Apache2::RequestRec->import(); - - #require Apache2::RequestIO; require Apache2::Log; require Apache2::Const; - - #Apache2::Const->import('-compile', 'FORBIDDEN'); Apache2::Const->import( '-compile', qw(:common :log) ); *FORBIDDEN = \&Apache2::Const::FORBIDDEN; *REDIRECT = \&Apache2::Const::REDIRECT; @@ -108,6 +98,7 @@ BEGIN { threads::shared::share($localStorageOptions); threads::shared::share($whatToTrace); threads::shared::share($https); + threads::shared::share($port); threads::shared::share($refLocalStorage); }; } @@ -369,8 +360,8 @@ sub defaultValuesInit { $cookieSecured = $args->{cookieSecured} || 0; $whatToTrace = $args->{whatToTrace} || '$uid'; $whatToTrace =~ s/\$//g; - $https = $args->{https} unless defined($https); - $https = 1 unless defined($https); + $https = $args->{https} || 1 unless defined($https); + $port = $args->{port} || 0 unless defined($port); 1; } @@ -465,16 +456,16 @@ sub hideCookie { sub encodeUrl { my ( $class, $url ) = @_; - my $port = $apacheRequest->get_server_port(); - $port = + my $portString = $port || $apacheRequest->get_server_port(); + $portString = ( $https && $port == 443 ) ? '' : ( !$https && $port == 80 ) ? '' - : ':' . $apacheRequest->get_server_port(); + : ':' . $portString; my $u = encode_base64( "http" . ( $https ? "s" : "" ) . "://" . $apacheRequest->get_server_name() - . $port + . $portString . $url ); $u =~ s/[\r\n\s]//sg; return $u; @@ -781,6 +772,10 @@ Indicates if the protected server is protected by SSL. It is used to build redirections, so you have to set it to avoid bad redirections after authentication. +=item B (default: undef) + +If port is not well defined in redirection, you can fix listen port here. + =back =head2 EXPORT 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 5c69dd1c3..5c0b3308a 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 @@ -5,7 +5,7 @@ use DBI; use MIME::Base64; use Lemonldap::NG::Manager::Conf::Constants; -our $VERSION = 0.15; +our $VERSION = 0.16; BEGIN { *Lemonldap::NG::Manager::Conf::dbh = \&dbh; @@ -46,7 +46,8 @@ sub lastCfg { sub dbh { my $self = shift; $self->{dbiTable} ||= "lmconfig"; - return $self->{dbh} ||= DBI->connect_cached( + return $self->{dbh} if ( $self->{dbh} and $self->{dbh}->ping ); + return DBI->connect_cached( $self->{dbiChain}, $self->{dbiUser}, $self->{dbiPassword}, { RaiseError => 1 } ); diff --git a/modules/lemonldap-ng-portal/Changes b/modules/lemonldap-ng-portal/Changes index e0df387a6..9cebbafc6 100644 --- a/modules/lemonldap-ng-portal/Changes +++ b/modules/lemonldap-ng-portal/Changes @@ -1,5 +1,9 @@ Revision history for Perl extension Lemonldap::NG::Portal. +0.77 Mon Jul 30 21:27:08 2007 + - Little bug fix in javascript + - DBI::ping is now called each time to avoid timeout + 0.76 Sat Jul 21 15:21:57 2007 - LDAP+TLS support (thanks to Baptiste Grenier) - New logout system: URL can now be declared in Manager interface diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal.pm index 4b84048ff..cf2ff37df 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.76"; +our $VERSION = "0.77"; 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 f1b108c98..9e2b999d2 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.76'; +our $VERSION = '0.77'; our @ISA = qw(CGI Exporter); @@ -131,8 +131,8 @@ sub header { # CGI.pm overload to add Lemonldap::NG cookie sub redirect { my $self = shift; - if ( $_[0]->{cookie} ) { - $self->SUPER::redirect( @_, -cookie => $_[0]->{cookie} ); + if ( $self->{cookie} ) { + $self->SUPER::redirect( @_, -cookie => $self->{cookie} ); } else { $self->SUPER::redirect(@_);