Browse Source

Bug 13871: [QA Follow-up] Adjust Patron Info Request

Conform QA comment, Patron Info request is slightly adjusted to be
consistent with changes to Patron Status request.

If the cardnumber is ok and the password is wrong, BL=N is reported but
also add 'Invalid password' in AF.
Additionally, an invalid card number is reported in AF.

Test plan:
[1] Send patron info request for invalid card.
[2] Idem for valid card, no password.
[3] Idem for valid card, good password.
[4] Idem for valid card, wrong password.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Verified by telnetting SIP server.
And tested additionally with the new unit test of bug 15956.

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
new_12478_elasticsearch
Marcel de Rooy 8 years ago
committed by Brendan A Gallagher
parent
commit
b02aa7c421
  1. 17
      C4/SIP/Sip/MsgType.pm

17
C4/SIP/Sip/MsgType.pm

@ -969,10 +969,12 @@ sub handle_patron_info {
# charged items limit
$resp .= add_field( FID_VALID_PATRON, 'Y' );
my $password_rc;
if ( defined($patron_pwd) ) {
# If patron password was provided, report whether it was right or not.
$resp .= add_field( FID_VALID_PATRON_PWD, sipbool( $patron->check_password($patron_pwd) ) );
$password_rc = $patron->check_password($patron_pwd);
$resp .= add_field( FID_VALID_PATRON_PWD, sipbool( $password_rc ) );
}
$resp .= maybe_add( FID_CURRENCY, $patron->currency );
@ -1000,10 +1002,14 @@ sub handle_patron_info {
# Custom protocol extension to report patron internet privileges
$resp .= maybe_add( FID_INET_PROFILE, $patron->inet_privileges );
$resp .= maybe_add( FID_SCREEN_MSG, $patron->screen_msg, $server );
$resp .= maybe_add( FID_SCREEN_MSG, $patron->{branchcode}, $server )
if ( $server->{account}->{send_patron_home_library_in_af} );
my $msg = $patron->screen_msg;
if( defined( $patron_pwd ) && !$password_rc ) {
$msg .= ' -- ' . INVALID_PW;
}
if ( $server->{account}->{send_patron_home_library_in_af} ) {
$msg .= ' -- ' . $patron->{branchcode};
}
$resp .= maybe_add( FID_SCREEN_MSG, $msg, $server );
$resp .= maybe_add( FID_PRINT_LINE, $patron->print_line );
} else {
@ -1022,6 +1028,7 @@ sub handle_patron_info {
if ( $protocol_version >= 2 ) {
$resp .= add_field( FID_VALID_PATRON, 'N' );
}
$resp .= maybe_add( FID_SCREEN_MSG, INVALID_CARD );
}
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} );

Loading…
Cancel
Save