Commit 57bb1df1 authored by Xavier Guimard's avatar Xavier Guimard

LEMONLDAP::NG : little bug in Portal/Simple.pm, timeout avoidance in

                Manager/Conf/DBI.pm and new feature in Handler: port can
                be fixed in redirection to avoid some Apache problems.
parent 7213be43
...@@ -131,7 +131,7 @@ dist: clean ...@@ -131,7 +131,7 @@ dist: clean
- $(MAKE) clean - $(MAKE) clean
mkdir -p lemonldap-ng-$(VERSION) mkdir -p lemonldap-ng-$(VERSION)
- cp -pR lemonldap-ng-manager/ lemonldap-ng-portal/ lemonldap-ng-handler/ * 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) rm -rf lemonldap-ng-$(VERSION)/lemonldap-ng-$(VERSION)
tar czf lemonldap-ng-$(VERSION).tar.gz lemonldap-ng-$(VERSION) tar czf lemonldap-ng-$(VERSION).tar.gz lemonldap-ng-$(VERSION)
rm -rf lemonldap-ng-$(VERSION) rm -rf lemonldap-ng-$(VERSION)
......
Revision history for Perl extension Lemonldap::NG::Handler. 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 0.83 Sun Jul 22 22:19:12 2007
- New logout system : URL can now be declared in Manager - New logout system : URL can now be declared in Manager
interface interface
......
...@@ -2,7 +2,7 @@ package Lemonldap::NG::Handler; ...@@ -2,7 +2,7 @@ package Lemonldap::NG::Handler;
print STDERR print STDERR
"See Lemonldap::NG::Handler(3) to know which Lemonldap::NG::Handler::* module to use."; "See Lemonldap::NG::Handler(3) to know which Lemonldap::NG::Handler::* module to use.";
our $VERSION = "0.83"; our $VERSION = "0.84";
1; 1;
......
...@@ -7,7 +7,7 @@ use Exporter 'import'; ...@@ -7,7 +7,7 @@ use Exporter 'import';
use Safe; use Safe;
require POSIX; require POSIX;
our $VERSION = '0.83'; our $VERSION = '0.84';
our %EXPORT_TAGS = ( our %EXPORT_TAGS = (
localStorage => localStorage =>
...@@ -23,15 +23,9 @@ our %EXPORT_TAGS = ( ...@@ -23,15 +23,9 @@ our %EXPORT_TAGS = (
import => [ qw( import @EXPORT_OK @EXPORT %EXPORT_TAGS ) ], import => [ qw( import @EXPORT_OK @EXPORT %EXPORT_TAGS ) ],
headers => [ headers => [
qw( qw(
$forgeHeaders $forgeHeaders lmHeaderIn lmSetHeaderIn lmHeaderOut
lmHeaderIn lmSetHeaderOut lmSetErrHeaderOut $cookieName $cookieSecured
lmSetHeaderIn $https $port
lmHeaderOut
lmSetHeaderOut
lmSetErrHeaderOut
$cookieName
$cookieSecured
$https
) )
], ],
traces => [ qw( $whatToTrace ) ], traces => [ qw( $whatToTrace ) ],
...@@ -56,7 +50,7 @@ our ( ...@@ -56,7 +50,7 @@ our (
$globalStorage, $globalStorageOptions, $localStorage, $globalStorage, $globalStorageOptions, $localStorage,
$localStorageOptions, $whatToTrace, $https, $localStorageOptions, $whatToTrace, $https,
$refLocalStorage, $safe, $cookieSecured, $refLocalStorage, $safe, $cookieSecured,
$logout, $logout, $port
); );
########################################## ##########################################
...@@ -78,12 +72,8 @@ BEGIN { ...@@ -78,12 +72,8 @@ BEGIN {
if ( MP() == 2 ) { if ( MP() == 2 ) {
require Apache2::RequestRec; require Apache2::RequestRec;
Apache2::RequestRec->import(); Apache2::RequestRec->import();
#require Apache2::RequestIO;
require Apache2::Log; require Apache2::Log;
require Apache2::Const; require Apache2::Const;
#Apache2::Const->import('-compile', 'FORBIDDEN');
Apache2::Const->import( '-compile', qw(:common :log) ); Apache2::Const->import( '-compile', qw(:common :log) );
*FORBIDDEN = \&Apache2::Const::FORBIDDEN; *FORBIDDEN = \&Apache2::Const::FORBIDDEN;
*REDIRECT = \&Apache2::Const::REDIRECT; *REDIRECT = \&Apache2::Const::REDIRECT;
...@@ -108,6 +98,7 @@ BEGIN { ...@@ -108,6 +98,7 @@ BEGIN {
threads::shared::share($localStorageOptions); threads::shared::share($localStorageOptions);
threads::shared::share($whatToTrace); threads::shared::share($whatToTrace);
threads::shared::share($https); threads::shared::share($https);
threads::shared::share($port);
threads::shared::share($refLocalStorage); threads::shared::share($refLocalStorage);
}; };
} }
...@@ -369,8 +360,8 @@ sub defaultValuesInit { ...@@ -369,8 +360,8 @@ sub defaultValuesInit {
$cookieSecured = $args->{cookieSecured} || 0; $cookieSecured = $args->{cookieSecured} || 0;
$whatToTrace = $args->{whatToTrace} || '$uid'; $whatToTrace = $args->{whatToTrace} || '$uid';
$whatToTrace =~ s/\$//g; $whatToTrace =~ s/\$//g;
$https = $args->{https} unless defined($https); $https = $args->{https} || 1 unless defined($https);
$https = 1 unless defined($https); $port = $args->{port} || 0 unless defined($port);
1; 1;
} }
...@@ -465,16 +456,16 @@ sub hideCookie { ...@@ -465,16 +456,16 @@ sub hideCookie {
sub encodeUrl { sub encodeUrl {
my ( $class, $url ) = @_; my ( $class, $url ) = @_;
my $port = $apacheRequest->get_server_port(); my $portString = $port || $apacheRequest->get_server_port();
$port = $portString =
( $https && $port == 443 ) ? '' ( $https && $port == 443 ) ? ''
: ( !$https && $port == 80 ) ? '' : ( !$https && $port == 80 ) ? ''
: ':' . $apacheRequest->get_server_port(); : ':' . $portString;
my $u = my $u =
encode_base64( "http" encode_base64( "http"
. ( $https ? "s" : "" ) . "://" . ( $https ? "s" : "" ) . "://"
. $apacheRequest->get_server_name() . $apacheRequest->get_server_name()
. $port . $portString
. $url ); . $url );
$u =~ s/[\r\n\s]//sg; $u =~ s/[\r\n\s]//sg;
return $u; return $u;
...@@ -781,6 +772,10 @@ Indicates if the protected server is protected by SSL. It is used to build ...@@ -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 redirections, so you have to set it to avoid bad redirections after
authentication. authentication.
=item B<port> (default: undef)
If port is not well defined in redirection, you can fix listen port here.
=back =back
=head2 EXPORT =head2 EXPORT
......
...@@ -5,7 +5,7 @@ use DBI; ...@@ -5,7 +5,7 @@ use DBI;
use MIME::Base64; use MIME::Base64;
use Lemonldap::NG::Manager::Conf::Constants; use Lemonldap::NG::Manager::Conf::Constants;
our $VERSION = 0.15; our $VERSION = 0.16;
BEGIN { BEGIN {
*Lemonldap::NG::Manager::Conf::dbh = \&dbh; *Lemonldap::NG::Manager::Conf::dbh = \&dbh;
...@@ -46,7 +46,8 @@ sub lastCfg { ...@@ -46,7 +46,8 @@ sub lastCfg {
sub dbh { sub dbh {
my $self = shift; my $self = shift;
$self->{dbiTable} ||= "lmconfig"; $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->{dbiChain}, $self->{dbiUser},
$self->{dbiPassword}, { RaiseError => 1 } $self->{dbiPassword}, { RaiseError => 1 }
); );
......
Revision history for Perl extension Lemonldap::NG::Portal. 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 0.76 Sat Jul 21 15:21:57 2007
- LDAP+TLS support (thanks to Baptiste Grenier) - LDAP+TLS support (thanks to Baptiste Grenier)
- New logout system: URL can now be declared in Manager interface - New logout system: URL can now be declared in Manager interface
......
...@@ -2,7 +2,7 @@ package Lemonldap::NG::Portal; ...@@ -2,7 +2,7 @@ package Lemonldap::NG::Portal;
print STDERR print STDERR
"See Lemonldap::NG::Portal(3) to know which Lemonldap::NG::Portal::* module to use."; "See Lemonldap::NG::Portal(3) to know which Lemonldap::NG::Portal::* module to use.";
our $VERSION = "0.76"; our $VERSION = "0.77";
1; 1;
......
...@@ -13,7 +13,7 @@ use CGI::Cookie; ...@@ -13,7 +13,7 @@ use CGI::Cookie;
require POSIX; require POSIX;
use Lemonldap::NG::Portal::_i18n; use Lemonldap::NG::Portal::_i18n;
our $VERSION = '0.76'; our $VERSION = '0.77';
our @ISA = qw(CGI Exporter); our @ISA = qw(CGI Exporter);
...@@ -131,8 +131,8 @@ sub header { ...@@ -131,8 +131,8 @@ sub header {
# CGI.pm overload to add Lemonldap::NG cookie # CGI.pm overload to add Lemonldap::NG cookie
sub redirect { sub redirect {
my $self = shift; my $self = shift;
if ( $_[0]->{cookie} ) { if ( $self->{cookie} ) {
$self->SUPER::redirect( @_, -cookie => $_[0]->{cookie} ); $self->SUPER::redirect( @_, -cookie => $self->{cookie} );
} }
else { else {
$self->SUPER::redirect(@_); $self->SUPER::redirect(@_);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment