From 13ab69ae08f962760c21ef4c52c3591c766a7fe1 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 10 Feb 2010 07:11:17 -0500 Subject: [PATCH] bug 4122: make WebBasedSelfCheck functional The WebBasedSelfCheck preference is now functional - if a user tries to use /cgi-bin/koha/sco/sco-main.pl if the preference is not on, they get redirected to the OPAC home page. Also, the patron image web service now returns HTTP 403 (forbidden) unless both WebBasedSelfCheck and ShowPatronImageInWebBasedSelfCheck are on. Signed-off-by: Galen Charlton --- opac/sco/sco-main.pl | 7 +++++++ opac/sco/sco-patron-image.pl | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl index 3295a9240c..98958920fe 100755 --- a/opac/sco/sco-main.pl +++ b/opac/sco/sco-main.pl @@ -31,6 +31,13 @@ use C4::Biblio; use C4::Items; my $query = new CGI; + +unless (C4::Context->preference('WebBasedSelfCheck')) { + # redirect to OPAC home if self-check is not enabled + print $query->redirect("/cgi-bin/koha/opac-main.pl"); + exit; +} + if (C4::Context->preference('AutoSelfCheckAllowed')) { my $AutoSelfCheckID = C4::Context->preference('AutoSelfCheckID'); diff --git a/opac/sco/sco-patron-image.pl b/opac/sco/sco-patron-image.pl index a383afddfc..d7802b21e2 100755 --- a/opac/sco/sco-patron-image.pl +++ b/opac/sco/sco-patron-image.pl @@ -23,6 +23,16 @@ use C4::Service; use C4::Members; my ($query, $response) = C4::Service->init(circulate => 'circulate_remaining_permissions'); + +unless (C4::Context->preference('WebBasedSelfCheck')) { + print $query->header(status => '403 Forbidden - web-based self-check not enabled'); + exit; +} +unless (C4::Context->preference('ShowPatronImageInWebBasedSelfCheck')) { + print $query->header(status => '403 Forbidden - displaying patron images in self-check not enabled'); + exit; +} + my ($cardnumber) = C4::Service->require_params('cardnumber'); my ($imagedata, $dberror) = GetPatronImage($cardnumber); -- 2.39.2