From a0775299e2109fb54fef1c104616290a5b2d929e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 26 Feb 2020 11:41:39 +0100 Subject: [PATCH] Bug 4461: Redirect to 404 if KohaAdminEmailAddress is not defined Signed-off-by: Martin Renvoize Signed-off-by: David Nind Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- .../intranet-tmpl/prog/en/modules/admin/preferences/opac.pref | 2 ++ opac/opac-reportproblem.pl | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 7a813f33c0..c705a288c3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -383,6 +383,8 @@ OPAC: yes: Allow no: "Don't allow" - patrons to submit problem reports for OPAC pages to the library or Koha Administrator. + - "
" + - "NOTE: You must have KohaAdminEmailAddress enabled." - - pref: opacuserlogin choices: diff --git a/opac/opac-reportproblem.pl b/opac/opac-reportproblem.pl index 9934ccc6b8..e12c5d5562 100644 --- a/opac/opac-reportproblem.pl +++ b/opac/opac-reportproblem.pl @@ -40,7 +40,9 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( } ); -if ( !C4::Context->preference('OPACReportProblem') ){ +if ( !C4::Context->preference('OPACReportProblem') + || !C4::Context->preference('KohaAdminEmailAddress') ) +{ print $input->redirect("/cgi-bin/koha/errors/404.pl"); } -- 2.39.5