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.
environments/ppa-mbqj77/deployments/1
Xavier Guimard 18 years ago
parent 7213be43bd
commit 57bb1df1b4
  1. 2
      build/lemonldap-ng/Makefile
  2. 3
      modules/lemonldap-ng-handler/Changes
  3. 2
      modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler.pm
  4. 37
      modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm
  5. 5
      modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/DBI.pm
  6. 4
      modules/lemonldap-ng-portal/Changes
  7. 2
      modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal.pm
  8. 6
      modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm

@ -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)

@ -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

@ -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;

@ -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<port> (default: undef)
If port is not well defined in redirection, you can fix listen port here.
=back
=head2 EXPORT

@ -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 }
);

@ -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

@ -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;

@ -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(@_);

Loading…
Cancel
Save