Lines 1650-1663
subtest 'checkpw for users with shared cardnumber / userid ' => sub {
Link Here
|
1650 |
my $patron_2 = $builder->build_object( { class => 'Koha::Patrons', value => { userid => $patron_1->cardnumber } } ); |
1650 |
my $patron_2 = $builder->build_object( { class => 'Koha::Patrons', value => { userid => $patron_1->cardnumber } } ); |
1651 |
$patron_2->set_password( { password => "PasswordTwo" } ); |
1651 |
$patron_2->set_password( { password => "PasswordTwo" } ); |
1652 |
|
1652 |
|
1653 |
my ( $checkpw, $cardnumber, $userid, $patron ) = checkpw( $patron_1->cardnumber, "OnePassword", undef, undef, 1 ); |
1653 |
my ( $checkpw, $cardnumber, $userid, $patron ) = checkpw( $patron_1->userid, "OnePassword", undef, undef, 1 ); |
1654 |
ok( $checkpw, 'checkpw returns true for right password when logging in via cardnumber' ); |
1654 |
ok( $checkpw, 'checkpw returns true for right password when logging in via usrid' ); |
1655 |
is( $cardnumber, $patron_1->cardnumber, 'checkpw returns correct cardnumber' ); |
1655 |
is( $cardnumber, $patron_1->cardnumber, 'checkpw returns correct cardnumber' ); |
1656 |
is( $userid, $patron_1->userid, 'checkpw returns correct userid' ); |
1656 |
is( $userid, $patron_1->userid, 'checkpw returns correct userid' ); |
1657 |
is( $patron->id, $patron_1->id, 'checkpw returns correct patron' ); |
1657 |
is( $patron->id, $patron_1->id, 'checkpw returns correct patron' ); |
1658 |
|
1658 |
|
1659 |
( $checkpw, $cardnumber, $userid, $patron ) = checkpw( $patron_2->userid, "PasswordTwo", undef, undef, 1 ); |
1659 |
( $checkpw, $cardnumber, $userid, $patron ) = checkpw( $patron_2->cardnumber, "PasswordTwo", undef, undef, 1 ); |
1660 |
ok( $checkpw, 'checkpw returns true for right password when logging in via userid' ); |
1660 |
ok( $checkpw, 'checkpw returns true for right password when logging in via carndumber' ); |
1661 |
is( $cardnumber, $patron_2->cardnumber, 'checkpw returns correct cardnumber' ); |
1661 |
is( $cardnumber, $patron_2->cardnumber, 'checkpw returns correct cardnumber' ); |
1662 |
is( $userid, $patron_2->userid, 'checkpw returns correct userid' ); |
1662 |
is( $userid, $patron_2->userid, 'checkpw returns correct userid' ); |
1663 |
is( $patron->id, $patron_2->id, 'checkpw returns correct patron' ); |
1663 |
is( $patron->id, $patron_2->id, 'checkpw returns correct patron' ); |
1664 |
- |
|
|