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

(-)a/debian/templates/apache-shared-intranet-plack.conf (+3 lines)
Lines 22-27 Link Here
22
        # Point the intranet site to Plack
22
        # Point the intranet site to Plack
23
        ProxyPass /index.html "unix:/var/run/koha/${instance}/plack.sock|http://localhost/intranet/mainpage.pl"
23
        ProxyPass /index.html "unix:/var/run/koha/${instance}/plack.sock|http://localhost/intranet/mainpage.pl"
24
        ProxyPassReverse /index.html "unix:/var/run/koha/${instance}/plack.sock|http://localhost/intranet/mainpage.pl"
24
        ProxyPassReverse /index.html "unix:/var/run/koha/${instance}/plack.sock|http://localhost/intranet/mainpage.pl"
25
        ProxyPass /cgi-bin/koha/svc "unix:/var/run/koha/${instance}/plack.sock|http://localhost/intranet_svc"
26
        ProxyPassReverse /cgi-bin/koha/svc "unix:/var/run/koha/${instance}/plack.sock|http://localhost/intranet_svc"
27
25
        ProxyPass /cgi-bin/koha "unix:/var/run/koha/${instance}/plack.sock|http://localhost/intranet"
28
        ProxyPass /cgi-bin/koha "unix:/var/run/koha/${instance}/plack.sock|http://localhost/intranet"
26
        ProxyPassReverse /cgi-bin/koha "unix:/var/run/koha/${instance}/plack.sock|http://localhost/intranet"
29
        ProxyPassReverse /cgi-bin/koha "unix:/var/run/koha/${instance}/plack.sock|http://localhost/intranet"
27
30
(-)a/debian/templates/plack.psgi (+12 lines)
Lines 56-61 my $intranet = Plack::App::CGIBin->new( Link Here
56
    root => $ENV{DEV_INSTALL}? $home: "$home/intranet/cgi-bin"
56
    root => $ENV{DEV_INSTALL}? $home: "$home/intranet/cgi-bin"
57
)->to_app;
57
)->to_app;
58
58
59
my $intranet_svc = Plack::App::CGIBin->new(
60
    root => $ENV{DEV_INSTALL}? "$home/svc": "$home/svc/cgi-bin"
61
)->to_app;
62
59
my $opac = Plack::App::CGIBin->new(
63
my $opac = Plack::App::CGIBin->new(
60
    root => $ENV{DEV_INSTALL}? "$home/opac": "$home/opac/cgi-bin/opac"
64
    root => $ENV{DEV_INSTALL}? "$home/opac": "$home/opac/cgi-bin/opac"
61
)->to_app;
65
)->to_app;
Lines 117-122 builder { Link Here
117
        enable "+Koha::Middleware::CSRF";
121
        enable "+Koha::Middleware::CSRF";
118
        $intranet;
122
        $intranet;
119
    };
123
    };
124
    mount '/intranet_svc'      => builder {
125
        if ( Log::Log4perl->get_logger('plack-intranet')->has_appenders ){
126
            enable 'Log4perl', category => 'plack-intranet';
127
            enable 'LogWarn';
128
        }
129
        enable "+Koha::Middleware::CSRF";
130
        $intranet_svc;
131
    };
120
    mount '/api/v1/app.pl' => builder {
132
    mount '/api/v1/app.pl' => builder {
121
        if ( Log::Log4perl->get_logger('plack-api')->has_appenders ){
133
        if ( Log::Log4perl->get_logger('plack-api')->has_appenders ){
122
            enable 'Log4perl', category => 'plack-api';
134
            enable 'Log4perl', category => 'plack-api';
(-)a/errors/403.pl (-3 / +3 lines)
Lines 33-41 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
33
        authnotrequired => 1,
33
        authnotrequired => 1,
34
    }
34
    }
35
);
35
);
36
$template->param (
36
$template->param(
37
    admin => $admin,
37
    admin      => $admin,
38
    errno => 403,
38
    errno      => 403,
39
    csrf_error => $ENV{'plack.middleware.Koha.CSRF'},
39
    csrf_error => $ENV{'plack.middleware.Koha.CSRF'},
40
);
40
);
41
41
(-)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', -status => '401 Unauthorized');
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