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 <gmcharlt@gmail.com>
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');
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);