From 85e7acadfe81d1451bca379047894fae86655bfe Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Fri, 8 Feb 2008 15:33:32 +0000 Subject: [PATCH] LEMONLDAP::NG : some stupid bugs... --- build/lemonldap-ng/debian/README.Debian | 4 ++++ .../lib/Lemonldap/NG/Handler/Simple.pm | 8 +++----- .../lib/Lemonldap/NG/Portal/AuthSSL.pm | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/build/lemonldap-ng/debian/README.Debian b/build/lemonldap-ng/debian/README.Debian index a2ede43e0..d922db181 100644 --- a/build/lemonldap-ng/debian/README.Debian +++ b/build/lemonldap-ng/debian/README.Debian @@ -36,6 +36,10 @@ liblemonldap-ng-handler-perl installs a file named MyHandler.pm in /var/lib/lemonldap-ng/handler/. See handler-apache.conf or handler-apache2.conf in /etc/lemonldap-ng/ to know how to use it. +You can also copy /usr/share/doc/lemonldap-ng/examples/test.pl into +/var/lib/lemonldap-ng/index.pl to see how to use Lemonldap::NG with a Perl or +PHP application. + IV - LEMONLDAP::NG CONFIGURATION STORAGE --------------------------------------- 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 9d9ced22e..3360b0fb0 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm @@ -459,8 +459,8 @@ sub encodeUrl { my ( $class, $url ) = @_; my $portString = $port || $apacheRequest->get_server_port(); $portString = - ( $https && $port == 443 ) ? '' - : ( !$https && $port == 80 ) ? '' + ( $https && $portString == 443 ) ? '' + : ( !$https && $portString == 80 ) ? '' : ':' . $portString; my $u = encode_base64( "http" @@ -482,9 +482,7 @@ sub goToPortal() { 'debug' ); my $urlc_init = $class->encodeUrl ( $url ); - $apacheRequest->headers_out->set( - 'Location' => "$portal?url=$urlc_init" . ( $arg ? "&$arg" : "" ) - ); + lmSetHeaderOut( $apacheRequest, 'Location' => "$portal?url=$urlc_init" . ( $arg ? "&$arg" : "" ) ); return REDIRECT; } diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthSSL.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthSSL.pm index d95630e82..ad7343636 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthSSL.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthSSL.pm @@ -14,7 +14,7 @@ our $OVERRIDE = { # variable is present. Adapt it if you want extractFormInfo => sub { my $self = shift; - $self->{user} = $self->https( $self->{SSLVar} || 'SSL_CLIENT_S_DN_Email' ); + $self->{user} = $self->https( $self->{SSLVar} || $ENV{'SSL_CLIENT_S_DN_Email'} ); return PE_BADCREDENTIALS unless ( $self->{user} ); PE_OK; },