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

(-)a/C4/Context.pm (-2 / +16 lines)
Lines 662-674 set_userenv is called in Auth.pm Link Here
662
=cut
662
=cut
663
663
664
#'
664
#'
665
sub set_userenv_from_session {
666
    my ( $class, $session ) = @_;
667
    return $class->set_userenv(
668
        $session->param('number'),       $session->param('id') // '',
669
        $session->param('cardnumber'),   $session->param('firstname'),
670
        $session->param('surname'),      $session->param('branch'),
671
        $session->param('branchname'),   $session->param('flags'),
672
        $session->param('emailaddress'), $session->param('shibboleth'),
673
        $session->param('desk_id'),      $session->param('desk_name'),
674
        $session->param('register_id'),  $session->param('register_name'),
675
        $session->id,
676
    );
677
}
665
sub set_userenv {
678
sub set_userenv {
666
    shift @_;
679
    shift @_;
667
    my (
680
    my (
668
        $usernum,      $userid,     $usercnum,   $userfirstname,
681
        $usernum,      $userid,     $usercnum,   $userfirstname,
669
        $usersurname,  $userbranch, $branchname, $userflags,
682
        $usersurname,  $userbranch, $branchname, $userflags,
670
        $emailaddress, $shibboleth, $desk_id,    $desk_name,
683
        $emailaddress, $shibboleth, $desk_id,    $desk_name,
671
        $register_id,  $register_name
684
        $register_id,  $register_name, $session_id,
672
    ) = @_;
685
    ) = @_;
673
686
674
    my $cell = {
687
    my $cell = {
Lines 687-693 sub set_userenv { Link Here
687
        "desk_id"       => $desk_id,
700
        "desk_id"       => $desk_id,
688
        "desk_name"     => $desk_name,
701
        "desk_name"     => $desk_name,
689
        "register_id"   => $register_id,
702
        "register_id"   => $register_id,
690
        "register_name" => $register_name
703
        "register_name" => $register_name,
704
        "session_id"    => $session_id,
691
    };
705
    };
692
    $context->{userenv} = $cell;
706
    $context->{userenv} = $cell;
693
    return $cell;
707
    return $cell;
(-)a/C4/InstallAuth.pm (-11 / +1 lines)
Lines 253-269 sub checkauth { Link Here
253
253
254
    if ( $session ) {
254
    if ( $session ) {
255
        if ( $session->param('cardnumber') ) {
255
        if ( $session->param('cardnumber') ) {
256
            C4::Context->set_userenv(
256
            C4::Context->set_userenv_from_session($session);
257
                $session->param('number'),
258
                $session->param('id'),
259
                $session->param('cardnumber'),
260
                $session->param('firstname'),
261
                $session->param('surname'),
262
                $session->param('branch'),
263
                $session->param('branchname'),
264
                $session->param('flags'),
265
                $session->param('emailaddress')
266
            );
267
            $cookie = $query->cookie(
257
            $cookie = $query->cookie(
268
                -name     => 'CGISESSID',
258
                -name     => 'CGISESSID',
269
                -value    => $session->id,
259
                -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 37041