Bug 41594: Disable access to invoice-files.pl if AcqEnableFiles disabled
This patch makes it so that invoice-files.pl returns 404 if AcqEnableFiles is disabled Test plan: 0. Apply the patch 1. koha-plack --restart kohadev 2. Go to /cgi-bin/koha/acqui/invoice-files.pl?invoiceid=999 3. Note that you see a 404 page 4. Change "AcqEnableFiles" syspref to "Do" 5. Go to /cgi-bin/koha/acqui/invoice-files.pl?invoiceid=999 6. Note that you now see a "Files for invoice" page Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
This commit is contained in:
parent
808385ea57
commit
bcf64aeeb8
|
|
@ -30,8 +30,8 @@ Manage files associated with invoice
|
|||
use Modern::Perl;
|
||||
|
||||
use CGI;
|
||||
use C4::Auth qw( get_template_and_user );
|
||||
use C4::Output qw( output_html_with_http_headers );
|
||||
use C4::Auth qw( get_template_and_user );
|
||||
use C4::Output qw( output_html_with_http_headers output_error );
|
||||
use C4::Acquisition qw( GetInvoice GetInvoiceDetails );
|
||||
use Koha::Misc::Files;
|
||||
|
||||
|
|
@ -45,6 +45,10 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
|
|||
}
|
||||
);
|
||||
|
||||
if ( !C4::Context->preference('AcqEnableFiles') ) {
|
||||
output_error( $input, '404' );
|
||||
}
|
||||
|
||||
my $invoiceid = $input->param('invoiceid') // '';
|
||||
my $op = $input->param('op') // '';
|
||||
my %errors;
|
||||
|
|
|
|||
Loading…
Reference in New Issue