From 1286b84cfb890723459c50044af5d49ebe4c5ab0 Mon Sep 17 00:00:00 2001 From: berick Date: Thu, 7 Apr 2011 11:46:18 -0400 Subject: [PATCH] consistent w/ previous opac, default to barcode login and jump to username only if there is a barcode regex (and regex does not match) --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index ef4501af4f..0640ad47e7 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm @@ -233,15 +233,17 @@ sub load_login { 'open-ils.auth.authenticate.init', $username); my $args = { - username => $username, + barcode => $username, password => md5_hex($seed . md5_hex($password)), type => ($persist) ? 'persist' : 'opac' }; my $bc_regex = $ctx->{get_org_setting}->($org_unit, 'opac.barcode_regex'); - $args->{barcode} = delete $args->{username} - if $bc_regex and $username =~ /$bc_regex/; + $args->{username} = delete $args->{barcode} + if $bc_regex and !($username =~ /$bc_regex/); + + $self->apache->log->warn("regex = $bc_regex; username = $username; " . ($username =~ /$bc_regex/)); my $response = $U->simplereq( 'open-ils.auth', 'open-ils.auth.authenticate.complete', $args); -- 2.11.0