From 4a8c99c7b02bfa5d3049a0bc2c54e59b464851ea Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Mon, 23 Apr 2007 19:23:35 +0000 Subject: [PATCH] LEMONLDAP::NG : new: port is now checked in HTTP redirections. --- build/lemonldap-ng/debian/changelog | 3 ++- .../lib/Lemonldap/NG/Handler/Simple.pm | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/build/lemonldap-ng/debian/changelog b/build/lemonldap-ng/debian/changelog index 2554437da..35f4fc709 100644 --- a/build/lemonldap-ng/debian/changelog +++ b/build/lemonldap-ng/debian/changelog @@ -2,8 +2,9 @@ lemonldap-ng (0.8.1.2) unstable; urgency=low * Little bug fix if whatToTrace parameter is not defined and display it in Manager interface + * New: port is now checked in portal redirection - -- Xavier Guimard Sat, 21 Apr 2007 15:05:19 +0200 + -- Xavier Guimard Mon, 23 Apr 2007 21:20:24 +0200 lemonldap-ng (0.8.1.1) unstable; urgency=low 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 84cacfd38..6a8e50219 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm @@ -332,9 +332,9 @@ sub defaultValuesInit { my ( $class, $args ) = @_; # Other values - $cookieName = $args->{cookieName} || 'lemonldap'; - $cookieSecured = $args->{cookieSecured} || 0; - $whatToTrace = $args->{whatToTrace} || '$uid'; + $cookieName = $args->{cookieName} || 'lemonldap'; + $cookieSecured = $args->{cookieSecured} || 0; + $whatToTrace = $args->{whatToTrace} || '$uid'; $whatToTrace =~ s/\$//g; $https = $args->{https} unless defined($https); $https = 1 unless defined($https); @@ -429,12 +429,18 @@ sub hideCookie { # Redirect non-authenticated users to the portal sub goToPortal() { my ( $class, $url, $arg ) = @_; + my $port = $apacheRequest->get_server_port(); + $port = + ( $https && $port == 443 ) ? '' + : ( !$https && $port == 80 ) ? '' + : ':' . $apacheRequest->get_server_port(); my $urlc_init = encode_base64( "http" . ( $https ? "s" : "" ) . "://" . $apacheRequest->get_server_name() + . $port . $url ); - $urlc_init =~ s/[\n\s]//g; + $urlc_init =~ s/[\n\s]//sg; $class->lmLog( "Redirect " . $apacheRequest->connection->remote_ip