I prefer this solution, able to keep blank userids. Sorry for the repeated commits.

This commit is contained in:
slef 2003-09-26 12:08:01 +00:00
parent e87c347d1c
commit 81b51763d9

View file

@ -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'},