Skip to content
Browse files

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 <veron@veron.ch>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
  • Loading branch information...
1 parent 3ba8426 commit 36f1fb630852ce33f23299e530c2d9633455ee77 @jcamins jcamins committed with PaulPoulain Jun 25, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 C4/Auth.pm
View
8 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;

0 comments on commit 36f1fb6

Please sign in to comment.
Something went wrong with that request. Please try again.