From: Jason Stephenson Date: Sat, 23 Aug 2014 16:03:42 +0000 (-0400) Subject: Add lookup for UserId in NCIP::ILS->find_barcode. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=bb64b2891ee295dcdb92cbea61ca319d164c8699;p=working%2FNCIPServer.git Add lookup for UserId in NCIP::ILS->find_barcode. Signed-off-by: Jason Stephenson --- diff --git a/lib/NCIP/ILS.pm b/lib/NCIP/ILS.pm index 2bceb16..00e1124 100644 --- a/lib/NCIP/ILS.pm +++ b/lib/NCIP/ILS.pm @@ -318,15 +318,28 @@ sub find_barcode { return unless($message); if ($message eq 'LookupUser') { my $authinput = $request->{$message}->{AuthenticationInput}; - return unless ($authinput); - # Convert to array ref if it isn't already. - if (ref $authinput ne 'ARRAY') { - $authinput = [$authinput]; - } - foreach my $input (@$authinput) { - if ($input->{AuthenticationInputType} =~ /barcode/i) { - $barcode = $input->{AuthenticationInputData}; - last; + if ($authinput) { + # Convert to array ref if it isn't already. + if (ref $authinput ne 'ARRAY') { + $authinput = [$authinput]; + } + foreach my $input (@$authinput) { + if ($input->{AuthenticationInputType} =~ /barcode/i) { + $barcode = $input->{AuthenticationInputData}; + last; + } + } + } else { + $authinput = $request->{$message}->{UserId}; + return unless($authinput); + if (ref $authinput ne 'ARRAY') { + $authinput = [$authinput]; + } + foreach my $input (@$authinput) { + if ($input->{UserIdentifierType} =~ /barcode/i) { + $barcode = $input->{UserIdentifierValue}; + last; + } } } }