Bug 30952: Show the search catalog form by default in cat-search.inc
[koha-ffzg.git] / errors / 403.pl
index dbb6ee6..33706a6 100755 (executable)
 
 use Modern::Perl;
 use CGI qw ( -utf8 );
-use C4::Auth;
-use C4::Output;
+use C4::Auth qw( get_template_and_user );
+use C4::Output qw( output_with_http_headers );
 use C4::Context;
-use List::MoreUtils qw(any);
+use List::MoreUtils qw( any );
 
 my $query = CGI->new;
 my $admin = C4::Context->preference('KohaAdminEmailAddress');
@@ -31,7 +31,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         query           => $query,
         type            => 'intranet',
         authnotrequired => 1,
-        debug           => 1,
     }
 );
 $template->param (
@@ -39,7 +38,7 @@ $template->param (
     errno => 403,
 );
 my $status = '403 Forbidden';
-if ( any { /(^psgi\.|^plack\.)/i } keys %ENV ) {
+if ( C4::Context->is_internal_PSGI_request() ) {
     $status = '200 OK';
 }
 output_with_http_headers $query, $cookie, $template->output, 'html', $status;