From d5b98d3bb07fc8951c30afe07bde9d0472446d6e Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 5 Dec 2008 17:17:02 -0600 Subject: [PATCH] bug 2613: allow web self-check to accept patron ID Use 'patronid' instead of 'userid' as the query parameter for passing the patron userid or barcode around; 'userid' is claimed by C4::Auth and should be used only for authentication pages. Fixes the problem where entering a patron's card number would cause a redirect to the OPAC login page. Signed-off-by: Galen Charlton --- koha-tmpl/opac-tmpl/prog/en/css/sco.css | 4 ++-- .../prog/en/modules/sco/sco-main.tmpl | 21 +++++++++--------- opac/sco/sco-main.pl | 22 +++++++++---------- 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/css/sco.css b/koha-tmpl/opac-tmpl/prog/en/css/sco.css index eb1c019ff0..e31db2339e 100644 --- a/koha-tmpl/opac-tmpl/prog/en/css/sco.css +++ b/koha-tmpl/opac-tmpl/prog/en/css/sco.css @@ -180,7 +180,7 @@ em { margin-top : 1em; } #barcode, -#userid { +#patronid { font-size : 125%; padding-bottom : 3px; } @@ -212,4 +212,4 @@ div.button a:active { } div.button a:active { border : 1px inset #666; -} \ No newline at end of file +} diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tmpl index f362df91c6..2b085faac9 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tmpl @@ -28,7 +28,7 @@

Error type:

-" /> +" /> " /> @@ -42,7 +42,7 @@ -" /> +" /> " /> @@ -73,13 +73,13 @@ Sorry, This Self-Checkout Station has lost authentication. Please contact the a HELP with the self checkout system - +

You are logged in as .

-

Sorry

The userid was not found in the database. Please try again.

+

Sorry

The userid was not found in the database. Please try again.


@@ -90,9 +90,8 @@ Sorry, This Self-Checkout Station has lost authentication. Please contact the a
- -
- +
+ " value="">
@@ -100,13 +99,13 @@ Sorry, This Self-Checkout Station has lost authentication. Please contact the a
-
.')){ this.op.value='logout'; this.userid.value=''; } return true;}; " > + .')){ this.op.value='logout'; this.patronid.value=''; } return true;}; " >
Check out or return an item: - " /> - + " /> +

Scan next item, or

@@ -143,4 +142,4 @@ Sorry, This Self-Checkout Station has lost authentication. Please contact the a
- \ No newline at end of file + diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl index 12e1a3e5e5..2c2f2f4b3d 100755 --- a/opac/sco/sco-main.pl +++ b/opac/sco/sco-main.pl @@ -2,7 +2,7 @@ # This code has been modified by Trendsetters (originally from opac-user.pl) # This code has been modified by rch # 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. so the selfcheck station will accept a userid and +# We're in a controlled environment; we trust the user. so the selfcheck station will accept a patronid and # issue items to that borrower. # use strict; @@ -34,8 +34,8 @@ my ($template, $loggedinuser, $cookie) my $dbh = C4::Context->dbh; my $issuerid = $loggedinuser; -my ($op, $userid, $barcode, $confirmed, $timedout )= ($query->param("op"), - $query->param("userid"), +my ($op, $patronid, $barcode, $confirmed, $timedout )= ($query->param("op"), + $query->param("patronid"), $query->param("barcode"), $query->param( "confirmed"), $query->param( "timedout"), #not actually using this... @@ -47,7 +47,7 @@ my $cnt = 0; my ($issuer) = GetMemberDetails($issuerid); my $item = GetItem(undef,$barcode); my $borrower; -($borrower) = GetMemberDetails(undef,$userid); +($borrower) = GetMemberDetails(undef,$patronid); my $branch = $issuer->{branchcode}; my $confirm_required = 0; @@ -55,12 +55,12 @@ my $return_only = 0; #warn "issuer cardnum: " . $issuer->{cardnumber}; #warn "cardnumber= ".$borrower->{cardnumber}; if ($op eq "logout") { - $query->param( userid => undef ); + $query->param( patronid => undef ); } if ($op eq "returnbook") { my ($doreturn ) = AddReturn($barcode, $branch); #warn "returnbook: " . $doreturn; - ($borrower) = GetMemberDetails(undef, $userid); + ($borrower) = GetMemberDetails(undef, $patronid); } if ($op eq "checkout" ) { @@ -109,9 +109,9 @@ if ($op eq "logout") { if ( $confirmed || $issuenoconfirm ) { # we'll want to call getpatroninfo again to get updated issues. #warn "issuing book?"; AddIssue($borrower,$barcode); - # ($borrower, $flags) = getpatroninformation(undef,undef, $userid); + # ($borrower, $flags) = getpatroninformation(undef,undef, $patronid); - # $template->param( userid => $userid, + # $template->param( patronid => $patronid, # validuser => 1, # ); } else { @@ -142,7 +142,7 @@ if ($borrower->{cardnumber}) { borrowername => $borrowername, issues_count => $cnt, ISSUES => \@issues,, - userid => $userid , + patronid => $patronid , noitemlinks => 1 , ); $cnt = 0; @@ -161,8 +161,8 @@ $template->param( inputfocus => $inputfocus, } else { - $template->param( userid => $userid, nouser => $userid, - inputfocus => 'userid', ); + $template->param( patronid => $patronid, nouser => $patronid, + inputfocus => 'patronid', ); } output_html_with_http_headers $query, $cookie, $template->output; -- 2.39.5