From: Adam Bowling Date: Wed, 28 Jan 2015 16:35:35 +0000 (-0500) Subject: LP #1255561 Check username beginning with digit for login X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e276c58a56d27fe114cd1351bed60235107395a0;p=working%2FEvergreen.git LP #1255561 Check username beginning with digit for login Currently, login authentication treats every username entry that begins with a digit as a barcode. This patch runs through that iteration, but if authentication fails, then tries a username entry beginning with a digit as a username, instead of a barcode, and retries the authentication as such, and returns success if open-ils.auth matches the digit-beginning username with the correct password. Signed-off-by: Adam Bowling --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index 856b7dece0..f799da49bc 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm @@ -432,6 +432,25 @@ sub load_login { 'open-ils.auth_proxy', 'open-ils.auth_proxy.login', $args); } + + #If login fails, try what script thinks is a barcode as username + if($U->event_code($response)) { + $args->{username} = $args->{barcode}; + if (!$auth_proxy_enabled) { + my $seed = $U->simplereq( + 'open-ils.auth', + 'open-ils.auth.authenticate.init', $username); + $args->{password} = md5_hex($seed . md5_hex($password)); + $response = $U->simplereq( + 'open-ils.auth', 'open-ils.auth.authenticate.complete', $args); + } else { + $args->{password} = $password; + $response = $U->simplereq( + 'open-ils.auth_proxy', + 'open-ils.auth_proxy.login', $args); + } + } + $self->timelog("Checked password"); if($U->event_code($response)) {