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

(-)a/C4/SIP/Sip/MsgType.pm (-1 / +14 lines)
Lines 932-937 sub handle_patron_info { Link Here
932
932
933
    $resp = (PATRON_INFO_RESP);
933
    $resp = (PATRON_INFO_RESP);
934
    if ($patron) {
934
    if ($patron) {
935
        # Bug 16694 - Limit SIP2 auth by patron attribute
936
        # If login account has validate_patron_attribute set, it will check if patron has this attribute set
937
        # If set to 1 or authorized value mapped to 1, allow access (charge and renewal privileges ok)
938
        if ($server->{account}->{validate_patron_attribute}) {
939
            my $attr = C4::Members::Attributes::GetBorrowerAttributeValue($patron->{borrowernumber}, $server->{account}->{validate_patron_attribute});
940
            if ($attr && $attr == "1") {
941
                $patron->{charge_ok} = "1";
942
                $patron->{renew_ok} = "1";
943
            } else {
944
                $patron->{charge_ok} = 0;
945
                $patron->{renew_ok} = 0;
946
            }
947
        }
948
935
        $resp .= patron_status_string($patron);
949
        $resp .= patron_status_string($patron);
936
        $resp .= ( defined($lang) and length($lang) == 3 ) ? $lang : $patron->language;
950
        $resp .= ( defined($lang) and length($lang) == 3 ) ? $lang : $patron->language;
937
        $resp .= timestamp();
951
        $resp .= timestamp();
Lines 1606-1609 sub api_auth { Link Here
1606
1620
1607
1;
1621
1;
1608
__END__
1622
__END__
1609
(-)a/etc/SIPconfig.xml (-1 / +1 lines)
Lines 46-51 Link Here
46
  <accounts>
46
  <accounts>
47
      <login id="term1"  password="term1" delimiter="|" error-detect="enabled" institution="CPL" encoding="ascii" checked_in_ok="1" payment_type_writeoff="06" />
47
      <login id="term1"  password="term1" delimiter="|" error-detect="enabled" institution="CPL" encoding="ascii" checked_in_ok="1" payment_type_writeoff="06" />
48
      <login id="koha"   password="koha"  delimiter="|" error-detect="enabled" institution="kohalibrary" encoding="utf8" />
48
      <login id="koha"   password="koha"  delimiter="|" error-detect="enabled" institution="kohalibrary" encoding="utf8" />
49
      <login id="sc-door" password="koha" institution="kohalibrary" encoding="utf8" validate_patron_attribute="sc-door-access" />
49
      <login id="koha2"  password="koha" institution="kohalibrary2" terminator="CR" />
50
      <login id="koha2"  password="koha" institution="kohalibrary2" terminator="CR" />
50
      <login id="lpl-sc" password="1234" institution="LPL" />
51
      <login id="lpl-sc" password="1234" institution="LPL" />
51
      <login id="lpl-sc-beacock" password="xyzzy"
52
      <login id="lpl-sc-beacock" password="xyzzy"
52
- 

Return to bug 16694