From 414da449ddc341624c8ae35ebb1e86f07ecf70fb 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 Signed-off-by: David Nind Signed-off-by: Martin Renvoize Signed-off-by: David Nind Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- .../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 51c037fc16..102f63cf58 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 d09afe265d..7660e6c5eb 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.39.5