@@ -, +, @@ - set patron attribute to anything but "1" - delete the patron attribute - map the patron attribute to an authorized list, e.g. (YES_NO) and set it to a value that doesn't map to "1", e.g. "No". --- C4/SIP/Sip/MsgType.pm | 15 ++++++++++++++- etc/SIPconfig.xml | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) --- a/C4/SIP/Sip/MsgType.pm +++ a/C4/SIP/Sip/MsgType.pm @@ -932,6 +932,20 @@ sub handle_patron_info { $resp = (PATRON_INFO_RESP); if ($patron) { + # Bug 16694 - Limit SIP2 auth by patron attribute + # If login account has validate_patron_attribute set, it will check if patron has this attribute set + # If set to 1 or authorized value mapped to 1, allow access (charge and renewal privileges ok) + if ($server->{account}->{validate_patron_attribute}) { + my $attr = C4::Members::Attributes::GetBorrowerAttributeValue($patron->{borrowernumber}, $server->{account}->{validate_patron_attribute}); + if ($attr && $attr == "1") { + $patron->{charge_ok} = "1"; + $patron->{renew_ok} = "1"; + } else { + $patron->{charge_ok} = 0; + $patron->{renew_ok} = 0; + } + } + $resp .= patron_status_string($patron); $resp .= ( defined($lang) and length($lang) == 3 ) ? $lang : $patron->language; $resp .= timestamp(); @@ -1606,4 +1620,3 @@ sub api_auth { 1; __END__ - --- a/etc/SIPconfig.xml +++ a/etc/SIPconfig.xml @@ -46,6 +46,7 @@ +