View | Details | Raw Unified | Return to bug 37056
Collapse All | Expand All

(-)a/svc/report (-11 / +8 lines)
Lines 20-29 Link Here
20
20
21
use Modern::Perl;
21
use Modern::Perl;
22
22
23
use C4::Auth qw( get_template_and_user );
23
use C4::Auth qw( check_api_auth );
24
use C4::Reports::Guided qw( execute_query );
24
use C4::Reports::Guided qw( execute_query );
25
use Koha::Reports;
25
use Koha::Reports;
26
use JSON qw( encode_json decode_json );
26
use JSON qw( encode_json decode_json to_json );
27
use CGI qw ( -utf8 );
27
use CGI qw ( -utf8 );
28
28
29
use Koha::Caches;
29
use Koha::Caches;
Lines 44-57 $report_id = $report_rec->id; Link Here
44
my @sql_params  = $query->multi_param('sql_params');
44
my @sql_params  = $query->multi_param('sql_params');
45
my @param_names  = $query->multi_param('param_names');
45
my @param_names  = $query->multi_param('param_names');
46
46
47
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
47
my ($status, $cookie, $sessionID) = check_api_auth($query, { catalogue => '1'} );
48
    {
48
unless ($status eq "ok") {
49
        template_name   => "intranet-main.tt",
49
    print $query->header(-type => 'application/json', -charset => 'UTF-8');
50
        query           => $query,
50
    print to_json({ auth_status => $status });
51
        type            => "intranet",
51
    exit 0;
52
        flagsrequired   => { catalogue => 1, },
52
}
53
    }
54
);
55
53
56
my $cache = Koha::Caches->get_instance();
54
my $cache = Koha::Caches->get_instance();
57
my $cache_active = $cache->is_cache_active;
55
my $cache_active = $cache->is_cache_active;
58
- 

Return to bug 37056