From 36f1fb630852ce33f23299e530c2d9633455ee77 Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Mon, 25 Jun 2012 12:11:35 -0400 Subject: [PATCH] Bug 8311: Fix scoping error in C4::Auth There is a mis-scoped function call in C4::Auth, on line 154, where GetMembers is called without explicit scoping and before 'require C4::Members;'. This does not actually have any functional ramifications as far as I can tell, but it would be a good idea to fix it. This patch also corrects a bit of indenting in that area, because it was an unnecessary challenge to understand the code with the mis-indenting. Signed-off-by: Marc Veron Signed-off-by: Paul Poulain --- C4/Auth.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index f796d118d5..b6dc2f5ad2 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -146,14 +146,15 @@ sub get_template_and_user { my $borrowernumber; my $insecure = C4::Context->preference('insecure'); if ($user or $insecure) { + require C4::Members; # It's possible for $user to be the borrowernumber if they don't have a # userid defined (and are logging in through some other method, such # as SSL certs against an email address) $borrowernumber = getborrowernumber($user) if defined($user); if (!defined($borrowernumber) && defined($user)) { - my $borrower = GetMember(borrowernumber => $user); - if ($borrower) { - $borrowernumber = $user; + my $borrower = C4::Members::GetMember(borrowernumber => $user); + if ($borrower) { + $borrowernumber = $user; # A bit of a hack, but I don't know there's a nicer way # to do it. $user = $borrower->{firstname} . ' ' . $borrower->{surname}; @@ -172,7 +173,6 @@ sub get_template_and_user { barshelvesloop => $barshelves, ); - require C4::Members; my ( $borr ) = C4::Members::GetMemberDetails( $borrowernumber ); my @bordat; $bordat[0] = $borr; -- 2.39.5