<option name='patron_status_always_permit_loans' value='false' />
-->
+ <!--
+ Allow patrons to connect to SIP services using their
+ username in addition to their barcode. See the
+ org unit setting 'opac.barcode_regex' for configuring
+ what constitutes a barcode vs a username.
+ <option name='support_patron_username_login' value='false' />
+ -->
+
</options>
<checkin_override>
my $key = (@_ > 1) ? shift : 'barcode'; # if we have multiple args, the first is the key index (default barcode)
my $patron_id = shift;
- # Check for usrname or barcode in the same, simple way that the OPAC does.
- my $bc_regex = $self->get_barcode_regex();
- if ($key eq 'barcode' && $patron_id !~ /$bc_regex/) {
- $key = 'usrname';
+ my $use_username =
+ $self->get_option_value('support_patron_username_login') || '';
+
+ if (to_bool($use_username)) {
+ # Check for usrname or barcode in the same, simple way that the OPAC does.
+ my $bc_regex = $self->get_barcode_regex();
+ if ($key eq 'barcode' && $patron_id !~ /$bc_regex/) {
+ $key = 'usrname';
+ }
}
$self->verify_session;
`opac.barcode_regex` setting for the organizational unit of the logged
in SIP2 account as configured in the oils_sip.xml file. This is
similar to what the OPAC does when a patron logs in.
+
+This feature requires activation. To activate, uncomment (or add) the
+following line in the oils_sip.xml configuration file and change the
+value from 'false' to 'true'.
+
+[source,xml]
+---------------------------------------------------------------------------
+<option name='support_patron_username_login' value='true' />
+---------------------------------------------------------------------------