From 96bf6a607aefd03f45e54aa09bab781e19e8cb26 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Tue, 11 Feb 2020 19:48:30 +0000 Subject: [PATCH] Bug 4461: (follow-up) Redirect to 404 if OPACProblemReport not enabled --- .../bootstrap/en/modules/opac-reportproblem.tt | 98 ++++++++++------------ opac/opac-reportproblem.pl | 4 + 2 files changed, 50 insertions(+), 52 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reportproblem.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reportproblem.tt index 51c037f..102f63c 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reportproblem.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reportproblem.tt @@ -27,60 +27,54 @@ [% END %]

Report a problem

- [% IF Koha.Preference('OPACReportProblem') %] - - [% IF ( successfuladd ) %] -
Your problem report has been sent to the [% IF ( recipient == 'admin' ) %]Koha Administrator[% ELSE %][% recipient %][% END %].
- [% END %] - [% IF ( ( nolibemail and noadminemail ) or norecipients ) %] -
Unable to send problem reports.
- [% ELSE %] -
-
- -
-
    -
  1. - - [% IF !nolibemail and noadminemail %] + [% IF ( successfuladd ) %] +
    Your problem report has been sent to the [% IF ( recipient == 'admin' ) %]Koha Administrator[% ELSE %][% recipient %][% END %].
    + [% END %] + [% IF ( ( nolibemail and noadminemail ) or norecipients ) %] +
    Unable to send problem reports.
    + [% ELSE %] +
    + + +
    +
      +
    1. + + [% IF !nolibemail and noadminemail %] + + [% ELSIF !noadminemail and nolibemail %] + + [% ELSE %] + - - - - [% END %] -
    2. -
    3. - - - [% probpage | html %] -
    4. -
    5. - - - [% username | html %] -
    6. - - -
    7. -
    8. - - -
    9. -
    -
    -
    - -
    - -
    - [% END %] - - [% ELSE %] -
    Your library has not activated this feature.
    + + [% END %] +
  2. +
  3. + + + [% probpage | html %] +
  4. +
  5. + + + [% username | html %] +
  6. + + +
  7. +
  8. + + +
  9. +
+
+
+ +
+ +
[% END %] diff --git a/opac/opac-reportproblem.pl b/opac/opac-reportproblem.pl index d09afe2..7660e6c 100644 --- a/opac/opac-reportproblem.pl +++ b/opac/opac-reportproblem.pl @@ -39,6 +39,10 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( } ); +if ( !C4::Context->preference('OPACReportProblem') ){ + print $input->redirect("/cgi-bin/koha/errors/404.pl"); +} + my $problempage = $ENV{HTTP_REFERER}; my $member = Koha::Patrons->find($borrowernumber); my $username = $member->userid; -- 2.1.4