From 30e4f03cd5faad3613d455f93833484da3026d3f Mon Sep 17 00:00:00 2001 From: Jeff Godin Date: Thu, 23 Aug 2012 14:39:26 -0400 Subject: [PATCH] Make patron alias unique test case insensitive When testing a patron alias to determine if it is unique, ensure that the comparison is done without regard for case. Case is preserved, but when searching for an existing matching alias, both values are lowercased using evergreen.lowercase(). Signed-off-by: Jeff Godin --- Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm index 327f3e8076..71ebd572dd 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm @@ -1506,7 +1506,17 @@ sub update_passwd { } elsif( $api =~ /alias/o ) { - my $exist = $e->search_actor_user({alias=>$new_val},{idlist=>1}); + my $exist = $e->search_actor_user( + { alias => { + "=" => { + transform => "evergreen.lowercase", + value => lc($new_val) + } + } + }, + { idlist => 1 } + ); + if (@$exist) { $e->rollback; return new OpenILS::Event('USERNAME_EXISTS'); -- 2.11.0