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

(-)a/C4/SIP/Sip/MsgType.pm (+3 lines)
Lines 961-966 sub handle_patron_info { Link Here
961
961
962
            # If patron password was provided, report whether it was right or not.
962
            # If patron password was provided, report whether it was right or not.
963
            $password_rc = $patron->check_password($patron_pwd);
963
            $password_rc = $patron->check_password($patron_pwd);
964
            if ( $patron_pwd eq q{} && $server->{account}->{allow_empty_passwords} ) {
965
                $password_rc = 1;
966
            }
964
            $resp .= add_field( FID_VALID_PATRON_PWD, sipbool( $password_rc ) );
967
            $resp .= add_field( FID_VALID_PATRON_PWD, sipbool( $password_rc ) );
965
        }
968
        }
966
969
(-)a/t/db_dependent/SIP/Message.t (-2 / +8 lines)
Lines 70-76 subtest 'Testing Patron Status Request V2' => sub { Link Here
70
70
71
subtest 'Testing Patron Info Request V2' => sub {
71
subtest 'Testing Patron Info Request V2' => sub {
72
    $schema->storage->txn_begin;
72
    $schema->storage->txn_begin;
73
    plan tests => 16;
73
    plan tests => 17;
74
    $C4::SIP::Sip::protocol_version = 2;
74
    $C4::SIP::Sip::protocol_version = 2;
75
    test_request_patron_info_v2();
75
    test_request_patron_info_v2();
76
    $schema->storage->txn_rollback;
76
    $schema->storage->txn_rollback;
Lines 196-201 sub test_request_patron_info_v2 { Link Here
196
    $msg->handle_patron_info( $server );
196
    $msg->handle_patron_info( $server );
197
    $respcode = substr( $response, 0, 2 );
197
    $respcode = substr( $response, 0, 2 );
198
    check_field( $respcode, $response, FID_VALID_PATRON_PWD, 'N', 'code CQ should be N for empty AD' );
198
    check_field( $respcode, $response, FID_VALID_PATRON_PWD, 'N', 'code CQ should be N for empty AD' );
199
    # Test empty password is OK if account configured to allow
200
    $server->{account}->{allow_empty_passwords} = 1;
201
    $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 );
202
    undef $response;
203
    $msg->handle_patron_info( $server );
204
    $respcode = substr( $response, 0, 2 );
205
    check_field( $respcode, $response, FID_VALID_PATRON_PWD, 'Y', 'code CQ should be Y if empty AD allowed' );
199
206
200
    # Finally, we send a wrong card number
207
    # Finally, we send a wrong card number
201
    $schema->resultset('Borrower')->search({ cardnumber => $card })->delete;
208
    $schema->resultset('Borrower')->search({ cardnumber => $card })->delete;
202
- 

Return to bug 18755