Bug 5995 Follow up: variable scope in koha/sco/sco-main.pl
authorIan Walls <ian.walls@bywatersolutions.com>
Tue, 18 Oct 2011 14:18:14 +0000 (10:18 -0400)
committerChris Cormack <chrisc@catalyst.net.nz>
Fri, 21 Oct 2011 17:32:03 +0000 (06:32 +1300)
The patronid value (cardnumber) set by checkpw in the case of SelfCheckoutByLogin
was improperly scoped with 'my' inside a conditional.  The changes followup to 5995
made this more apparent, causing logins to fail.

Also added "parts copyright" statement to the script, since ByWater Solutions did make some
significant contributions to the operations of the page

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
opac/sco/sco-main.pl

index b36ff64..427d995 100755 (executable)
@@ -2,6 +2,7 @@
 #
 # This code has been modified by Trendsetters (originally from opac-user.pl)
 # This code has been modified by rch
+# Parts Copyright 2010-2011, ByWater Solutions (those related to username/password auth)
 # We're going to authenticate a self-check user.  we'll add a flag to borrowers 'selfcheck'
 #
 # We're in a controlled environment; we trust the user.
@@ -92,7 +93,8 @@ my $issuer   = GetMemberDetails($issuerid);
 my $item     = GetItem(undef,$barcode);
 if (C4::Context->preference('SelfCheckoutByLogin') && !$patronid) {
     my $dbh = C4::Context->dbh;
-    my $resval, $patronid = checkpw($dbh, $patronlogin, $patronpw);
+    my $resval;
+    ($resval, $patronid) = checkpw($dbh, $patronlogin, $patronpw);
 }
 my $borrower = GetMemberDetails(undef,$patronid);