From a707666e46aa385fd0526cdce53c4d36f999d504 Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Mon, 30 Jul 2007 19:38:19 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.forge.objectweb.org/svnroot/lemonldap/branches/lemonldap-ng_version_0_8-bugfixes@178 1dbb9719-a921-0410-b57f-c3a383c2c641 --- lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/DBI.pm | 3 ++- lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/DBI.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/DBI.pm index 705ae3af7..d6ea51306 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/DBI.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/DBI.pm @@ -43,7 +43,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/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm index ca34355ef..af697cbf0 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm @@ -130,8 +130,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(@_); -- GitLab