From 0a6809af921cd155fa2bf6d2a3b809190d3f19e8 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Wed, 26 Sep 2007 12:26:35 +0200 Subject: [PATCH] Bug Fixing : password were modified when patron page was edited even though unchanged Signed-off-by: Chris Cormack --- C4/Members.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index 0d3b6b03a7..e7a39be7c5 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -582,14 +582,14 @@ sub ModMember { } my $query; my $sth; - $data{'userid'} = '' if ( $data{'password'} eq '' ); + $data{'userid'} = '' if ( $data{'password'} eq '' ); my @parameters; - foreach (keys %data) - {push @parameters,"$_ = ".$dbh->quote($data{$_}) if ($_ ne "borrowernumber" and $hashborrowerfields{$_} and $data{$_})} ; # test to know if u must update or not the borrower password if ( $data{'password'} eq '****' ) { - + delete $data{'password'}; + foreach (keys %data) + {push @parameters,"$_ = ".$dbh->quote($data{$_}) if ($_ ne "borrowernumber" and $hashborrowerfields{$_} and $data{$_})} ; $query = "UPDATE borrowers SET ".join (",",@parameters) ." WHERE borrowernumber=$data{'borrowernumber'}"; # warn "$query"; @@ -598,6 +598,8 @@ sub ModMember { } else { + foreach (keys %data) + {push @parameters,"$_ = ".$dbh->quote($data{$_}) if ($_ ne "borrowernumber" and $hashborrowerfields{$_} and $data{$_})} ; ( $data{'password'} = md5_base64( $data{'password'} ) ) if ( $data{'password'} ne '' ); $query = "UPDATE borrowers SET ".join (",",@parameters)." WHERE borrowernumber=$data{'borrowernumber'}"; -- 2.39.5