[Koha-cvs] CVS: koha member-password.pl,1.7,1.8
MJ Ray
slef at users.sourceforge.net
Fri Sep 26 13:59:39 CEST 2003
Update of /cvsroot/koha/koha
In directory sc8-pr-cvs1:/tmp/cvs-serv27841
Modified Files:
member-password.pl
Log Message:
related fix to not change userid if blank
Index: member-password.pl
===================================================================
RCS file: /cvsroot/koha/koha/member-password.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** member-password.pl 26 Sep 2003 11:53:12 -0000 1.7
--- member-password.pl 26 Sep 2003 11:59:36 -0000 1.8
***************
*** 53,64 ****
my $dbh=C4::Context->dbh;
! #Make sure the userid chosen is unique and not theirs. 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.
! my $warn = 1;
$template->param( warn => $warn,
othernames => $bor->{'othernames'},
--- 53,65 ----
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,
! #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.
! my $warn = 1;
$template->param( warn => $warn,
othernames => $bor->{'othernames'},
***************
*** 68,76 ****
defaultnewpassword => $newpassword );
} else {
! #Everything is good so we can update the information.
! my $sth=$dbh->prepare("update borrowers set userid=?, password=? where borrowernumber=?");
$sth->execute($uid, $digest, $member);
! $template->param(newpassword => $newpassword);
! }
} else {
--- 69,77 ----
defaultnewpassword => $newpassword );
} else {
! #Everything is good so we can update the information.
! my $sth=$dbh->prepare("update borrowers set userid=?, password=? where borrowernumber=?");
$sth->execute($uid, $digest, $member);
! $template->param(newpassword => $newpassword);
! }
} else {
More information about the Koha-cvs
mailing list