From 81b51763d98501ca175be633b3b0a6c054312824 Mon Sep 17 00:00:00 2001 From: slef Date: Fri, 26 Sep 2003 12:08:01 +0000 Subject: [PATCH] I prefer this solution, able to keep blank userids. Sorry for the repeated commits. --- member-password.pl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/member-password.pl b/member-password.pl index e134e3d18e..1d3a539a24 100755 --- a/member-password.pl +++ b/member-password.pl @@ -52,14 +52,13 @@ if ( $newpassword ) { my $uid = $input->param('newuserid'); my $dbh=C4::Context->dbh; - if ($uid eq '') { $uid = $bor->{'userid'} } - #Make sure the userid chosen is unique and not theirs. If it is not, + #Make sure the userid chosen is unique and not theirs if non-empty. If it is not, #Then we need to tell the user and have them create a new one. my $sth2=$dbh->prepare("select * from borrowers where userid=? and borrowernumber != ?"); $sth2->execute($uid,$member); - if ( $sth2->fetchrow ) { - #The userid exists so we should display a warning. + if ( ($uid ne '') && ($sth2->fetchrow) ) { + #The userid exists so we should display a warning. my $warn = 1; $template->param( warn => $warn, othernames => $bor->{'othernames'}, -- 2.39.2