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

(-)a/C4/SIP/Sip/MsgType.pm (-3 / +25 lines)
Lines 552-558 sub handle_checkout { Link Here
552
        }
552
        }
553
553
554
        # We never return the obsolete 'U' value for 'desensitize'
554
        # We never return the obsolete 'U' value for 'desensitize'
555
        $resp .= sipbool( $status->desensitize );
555
        $resp .= sipbool( desensitize( { status => $status, patron => $patron, server => $server } ) );
556
        $resp .= timestamp;
556
        $resp .= timestamp;
557
557
558
        # Now for the variable fields
558
        # Now for the variable fields
Lines 1447-1453 sub handle_renew { Link Here
1447
        } else {
1447
        } else {
1448
            $resp .= 'U';
1448
            $resp .= 'U';
1449
        }
1449
        }
1450
        $resp .= sipbool( $status->desensitize );
1450
        $resp .= sipbool( desensitize( { status => $status, patron => $patron, server => $server } ) );
1451
        $resp .= timestamp;
1451
        $resp .= timestamp;
1452
        $resp .= add_field( FID_PATRON_ID, $patron->id, $server );
1452
        $resp .= add_field( FID_PATRON_ID, $patron->id, $server );
1453
        $resp .= add_field( FID_ITEM_ID, $item->id, $server );
1453
        $resp .= add_field( FID_ITEM_ID, $item->id, $server );
Lines 1688-1693 sub api_auth { Link Here
1688
    return $status;
1688
    return $status;
1689
}
1689
}
1690
1690
1691
sub desensitize {
1692
    my ($params) = @_;
1693
1694
    my $status      = $params->{status};
1695
    my $desensitize = $status->desensitize();
1696
1697
    # If desenstize is already false, no need to do anything
1698
    return unless $desensitize;
1699
1700
    my $patron = $params->{patron};
1701
    my $server = $params->{server};
1702
1703
    my $patron_categories = $server->{account}->{never_demagnitize};
1704
1705
    # If no patron categories are set for never desensitize, no need to do anything
1706
    return $desensitize unless $patron_categories;
1707
1708
    my $patron_category = $patron->ptype();
1709
    my @patron_categories = split( /,/, $patron_categories );
1710
1711
    return !grep( /^$patron_category$/, @patron_categories );
1712
}
1713
1691
1;
1714
1;
1692
__END__
1715
__END__
1693
1716
1694
- 

Return to bug 26370