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

(-)a/C4/Context.pm (-2 / +1 lines)
Lines 853-860 Destroys the hash for activeuser user environment variables. Link Here
853
853
854
sub _unset_userenv
854
sub _unset_userenv
855
{
855
{
856
    my ($sessionID)= @_;
856
    delete $context->{activeuser};
857
    undef $context->{activeuser} if $sessionID && $context->{activeuser} && $context->{activeuser} eq $sessionID;
858
}
857
}
859
858
860
859
(-)a/Koha/Middleware/UserEnv.pm (+18 lines)
Line 0 Link Here
1
package Koha::Middleware::UserEnv;
2
use Modern::Perl;
3
4
use parent qw(Plack::Middleware);
5
6
use C4::Context;
7
8
sub call {
9
    my ( $self, $env ) =@_;
10
11
    my $req = Plack::Request->new($env);
12
13
    C4::Context->_unset_userenv;
14
15
    return $self->app->($env);
16
}
17
18
1;
(-)a/debian/templates/plack.psgi (-1 / +1 lines)
Lines 73-78 builder { Link Here
73
    enable "Plack::Middleware::Static";
73
    enable "Plack::Middleware::Static";
74
74
75
    # + is required so Plack doesn't try to prefix Plack::Middleware::
75
    # + is required so Plack doesn't try to prefix Plack::Middleware::
76
    enable "+Koha::Middleware::UserEnv";
76
    enable "+Koha::Middleware::SetEnv";
77
    enable "+Koha::Middleware::SetEnv";
77
    enable "+Koha::Middleware::RealIP";
78
    enable "+Koha::Middleware::RealIP";
78
79
79
- 

Return to bug 36149