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

(-)a/C4/Auth.pm (+2 lines)
Lines 1880-1885 sub create_basic_session { Link Here
1880
    my $patron    = $params->{patron};
1880
    my $patron    = $params->{patron};
1881
    my $interface = $params->{interface};
1881
    my $interface = $params->{interface};
1882
1882
1883
    $interface = 'intranet' if $interface eq 'staff';
1884
1883
    my $session = get_session("");
1885
    my $session = get_session("");
1884
1886
1885
    $session->param( 'number',       $patron->borrowernumber );
1887
    $session->param( 'number',       $patron->borrowernumber );
(-)a/t/db_dependent/Auth.t (-5 / +6 lines)
Lines 834-845 subtest 'Userenv clearing in check_cookie_auth' => sub { Link Here
834
};
834
};
835
835
836
subtest 'create_basic_session tests' => sub {
836
subtest 'create_basic_session tests' => sub {
837
    plan tests => 12;
837
    plan tests => 13;
838
838
839
    my $patron = $builder->build_object({ class => 'Koha::Patrons' });
839
    my $patron = $builder->build_object({ class => 'Koha::Patrons' });
840
    my $interface = 'opac';
841
840
842
    my $session = C4::Auth::create_basic_session({ patron => $patron, interface => $interface });
841
    my $session = C4::Auth::create_basic_session({ patron => $patron, interface => 'opac' });
843
842
844
    isnt($session->id, undef, 'A new sessionID was created');
843
    isnt($session->id, undef, 'A new sessionID was created');
845
    is( $session->param('number'), $patron->borrowernumber, 'Session parameter number matches' );
844
    is( $session->param('number'), $patron->borrowernumber, 'Session parameter number matches' );
Lines 852-858 subtest 'create_basic_session tests' => sub { Link Here
852
    is( $session->param('flags'), $patron->flags, 'Session parameter flags matches' );
851
    is( $session->param('flags'), $patron->flags, 'Session parameter flags matches' );
853
    is( $session->param('emailaddress'), $patron->email, 'Session parameter emailaddress matches' );
852
    is( $session->param('emailaddress'), $patron->email, 'Session parameter emailaddress matches' );
854
    is( $session->param('ip'), $session->remote_addr(), 'Session parameter ip matches' );
853
    is( $session->param('ip'), $session->remote_addr(), 'Session parameter ip matches' );
855
    is( $session->param('interface'), $interface, 'Session parameter interface matches' );
854
    is( $session->param('interface'), 'opac', 'Session parameter interface matches' );
855
856
    $session = C4::Auth::create_basic_session({ patron => $patron, interface => 'staff' });
857
    is( $session->param('interface'), 'intranet', 'Staff interface gets converted to intranet' );
856
};
858
};
857
859
858
$schema->storage->txn_rollback;
860
$schema->storage->txn_rollback;
859
- 

Return to bug 32178