#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 $resultcode;
my $sth =
$dbh->prepare(
"SELECT * FROM borrowers WHERE userid=? AND borrowernumber != ?");
$sth->execute( $uid, $member );
if ( ( $uid ne '' ) && ( my $row = $sth->fetchrow_hashref ) ) {
- return 0;
+ $resultcode=0;
}
else {
#Everything is good so we can update the information.
$dbh->prepare(
"update borrowers set userid=?, password=? where borrowernumber=?");
$sth->execute( $uid, $digest, $member );
- return 1;
+ $resultcode=1;
}
logaction("MEMBERS", "CHANGE PASS", $member, "") if C4::Context->preference("BorrowersLog");
+ return $resultcode;
}