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

(-)a/C4/Context.pm (-2 / +16 lines)
Lines 682-694 set_userenv is called in Auth.pm Link Here
682
=cut
682
=cut
683
683
684
#'
684
#'
685
sub set_userenv_from_session {
686
    my ( $class, $session ) = @_;
687
    return $class->set_userenv(
688
        $session->param('number'),       $session->param('id') // '',
689
        $session->param('cardnumber'),   $session->param('firstname'),
690
        $session->param('surname'),      $session->param('branch'),
691
        $session->param('branchname'),   $session->param('flags'),
692
        $session->param('emailaddress'), $session->param('shibboleth'),
693
        $session->param('desk_id'),      $session->param('desk_name'),
694
        $session->param('register_id'),  $session->param('register_name'),
695
        $session->id,
696
    );
697
}
685
sub set_userenv {
698
sub set_userenv {
686
    shift @_;
699
    shift @_;
687
    my (
700
    my (
688
        $usernum,      $userid,     $usercnum,   $userfirstname,
701
        $usernum,      $userid,     $usercnum,   $userfirstname,
689
        $usersurname,  $userbranch, $branchname, $userflags,
702
        $usersurname,  $userbranch, $branchname, $userflags,
690
        $emailaddress, $shibboleth, $desk_id,    $desk_name,
703
        $emailaddress, $shibboleth, $desk_id,    $desk_name,
691
        $register_id,  $register_name
704
        $register_id,  $register_name, $session_id,
692
    ) = @_;
705
    ) = @_;
693
706
694
    my $cell = {
707
    my $cell = {
Lines 707-713 sub set_userenv { Link Here
707
        "desk_id"       => $desk_id,
720
        "desk_id"       => $desk_id,
708
        "desk_name"     => $desk_name,
721
        "desk_name"     => $desk_name,
709
        "register_id"   => $register_id,
722
        "register_id"   => $register_id,
710
        "register_name" => $register_name
723
        "register_name" => $register_name,
724
        "session_id"    => $session_id,
711
    };
725
    };
712
    $context->{userenv} = $cell;
726
    $context->{userenv} = $cell;
713
    return $cell;
727
    return $cell;
(-)a/C4/InstallAuth.pm (-11 / +1 lines)
Lines 254-270 sub checkauth { Link Here
254
254
255
    if ($session) {
255
    if ($session) {
256
        if ( $session->param('cardnumber') ) {
256
        if ( $session->param('cardnumber') ) {
257
            C4::Context->set_userenv(
257
            C4::Context->set_userenv_from_session($session);
258
                $session->param('number'),
259
                $session->param('id'),
260
                $session->param('cardnumber'),
261
                $session->param('firstname'),
262
                $session->param('surname'),
263
                $session->param('branch'),
264
                $session->param('branchname'),
265
                $session->param('flags'),
266
                $session->param('emailaddress')
267
            );
268
            $cookie = $query->cookie(
258
            $cookie = $query->cookie(
269
                -name     => 'CGISESSID',
259
                -name     => 'CGISESSID',
270
                -value    => $session->id,
260
                -value    => $session->id,
(-)a/cataloguing/value_builder/barcode_manual.pl (-1 / +1 lines)
Lines 31-37 use CGI qw ( -utf8 ); Link Here
31
use C4::Auth qw( check_cookie_auth );
31
use C4::Auth qw( check_cookie_auth );
32
my $input = CGI->new;
32
my $input = CGI->new;
33
my ($auth_status) =
33
my ($auth_status) =
34
    check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => 1 } );
34
    check_cookie_auth( C4::Context->userenv->{session_id}, { catalogue => 1 } );
35
if ( $auth_status ne "ok" ) {
35
if ( $auth_status ne "ok" ) {
36
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
36
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
37
    exit 0;
37
    exit 0;
(-)a/cataloguing/value_builder/dateaccessioned.pl (-1 / +3 lines)
Lines 23-31 Link Here
23
use Modern::Perl;
23
use Modern::Perl;
24
use CGI      qw ( -utf8 );
24
use CGI      qw ( -utf8 );
25
use C4::Auth qw( check_cookie_auth );
25
use C4::Auth qw( check_cookie_auth );
26
use C4::Context;
27
26
my $input = CGI->new;
28
my $input = CGI->new;
27
my ($auth_status) =
29
my ($auth_status) =
28
    check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => 1 } );
30
    check_cookie_auth( C4::Context->userenv->{session_id}, { catalogue => 1 } );
29
if ( $auth_status ne "ok" ) {
31
if ( $auth_status ne "ok" ) {
30
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
32
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
31
    exit 0;
33
    exit 0;
(-)a/cataloguing/value_builder/marc21_field_005.pl (-1 / +3 lines)
Lines 23-31 use Modern::Perl; Link Here
23
23
24
use CGI      qw ( -utf8 );
24
use CGI      qw ( -utf8 );
25
use C4::Auth qw( check_cookie_auth );
25
use C4::Auth qw( check_cookie_auth );
26
use C4::Context;
27
26
my $input = CGI->new;
28
my $input = CGI->new;
27
my ($auth_status) =
29
my ($auth_status) =
28
    check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => 1 } );
30
    check_cookie_auth( C4::Context->userenv->{session_id}, { catalogue => 1 } );
29
if ( $auth_status ne "ok" ) {
31
if ( $auth_status ne "ok" ) {
30
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
32
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
31
    exit 0;
33
    exit 0;
(-)a/cataloguing/value_builder/marc21_field_245h.pl (-1 / +3 lines)
Lines 23-31 use Modern::Perl; Link Here
23
23
24
use CGI      qw ( -utf8 );
24
use CGI      qw ( -utf8 );
25
use C4::Auth qw( check_cookie_auth );
25
use C4::Auth qw( check_cookie_auth );
26
use C4::Context;
27
26
my $input = CGI->new;
28
my $input = CGI->new;
27
my ($auth_status) =
29
my ($auth_status) =
28
    check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => 1 } );
30
    check_cookie_auth( C4::Context->userenv->{session_id}, { catalogue => 1 } );
29
if ( $auth_status ne "ok" ) {
31
if ( $auth_status ne "ok" ) {
30
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
32
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
31
    exit 0;
33
    exit 0;
(-)a/cataloguing/value_builder/marc21_field_260b.pl (-1 / +3 lines)
Lines 29-37 use C4::Context; Link Here
29
29
30
use CGI      qw ( -utf8 );
30
use CGI      qw ( -utf8 );
31
use C4::Auth qw( check_cookie_auth );
31
use C4::Auth qw( check_cookie_auth );
32
use C4::Context;
33
32
my $input = CGI->new;
34
my $input = CGI->new;
33
my ($auth_status) =
35
my ($auth_status) =
34
    check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => 1 } );
36
    check_cookie_auth( C4::Context->userenv->{session_id}, { catalogue => 1 } );
35
if ( $auth_status ne "ok" ) {
37
if ( $auth_status ne "ok" ) {
36
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
38
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
37
    exit 0;
39
    exit 0;
(-)a/cataloguing/value_builder/marc21_orgcode.pl (-1 / +2 lines)
Lines 26-34 use C4::Context; Link Here
26
use Koha::Libraries;
26
use Koha::Libraries;
27
use CGI      qw ( -utf8 );
27
use CGI      qw ( -utf8 );
28
use C4::Auth qw( check_cookie_auth );
28
use C4::Auth qw( check_cookie_auth );
29
29
my $input = CGI->new;
30
my $input = CGI->new;
30
my ($auth_status) =
31
my ($auth_status) =
31
    check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => 1 } );
32
    check_cookie_auth( C4::Context->userenv->{session_id}, { catalogue => 1 } );
32
if ( $auth_status ne "ok" ) {
33
if ( $auth_status ne "ok" ) {
33
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
34
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
34
    exit 0;
35
    exit 0;
(-)a/cataloguing/value_builder/stocknumber.pl (-1 / +1 lines)
Lines 25-31 use CGI qw ( -utf8 ); Link Here
25
use C4::Auth qw( check_cookie_auth );
25
use C4::Auth qw( check_cookie_auth );
26
my $input = CGI->new;
26
my $input = CGI->new;
27
my ($auth_status) =
27
my ($auth_status) =
28
    check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => 1 } );
28
    check_cookie_auth( C4::Context->userenv->{session_id}, { catalogue => 1 } );
29
if ( $auth_status ne "ok" ) {
29
if ( $auth_status ne "ok" ) {
30
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
30
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
31
    exit 0;
31
    exit 0;
(-)a/cataloguing/value_builder/upload.pl (-2 / +2 lines)
Lines 32-40 use Modern::Perl; Link Here
32
32
33
use CGI      qw ( -utf8 );
33
use CGI      qw ( -utf8 );
34
use C4::Auth qw( check_cookie_auth );
34
use C4::Auth qw( check_cookie_auth );
35
use C4::Context;
35
my $input = CGI->new;
36
my $input = CGI->new;
36
my ($auth_status) =
37
my ($auth_status) =
37
    check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => 1 } );
38
    check_cookie_auth( C4::Context->userenv->{session_id}, { catalogue => 1 } );
38
if ( $auth_status ne "ok" ) {
39
if ( $auth_status ne "ok" ) {
39
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
40
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
40
    exit 0;
41
    exit 0;
41
- 

Return to bug 40943