Bug 10453: fix unintended password reset when updating child to adult
authorJonathan Druart <jonathan.druart@biblibre.com>
Tue, 24 Dec 2013 13:35:36 +0000 (14:35 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 26 Dec 2013 15:29:40 +0000 (15:29 +0000)
ModMember supposes the password given in parameter is the
password string, so if it receives the encrypted password,
it will encrypt it again! By simply deleting the password key
from the hash, ModMember leaves the password unchanged.

Test plan:
1/ Create or choose a child patron
2/ Update it to an adult category using the
   "Update child to adult patron" link
3/ Try to log in at the OPAC with this patron: It is not
   possible, the password has changed
4/ Apply the patch and try again previous steps

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Confirmed the problem and tested the patch fixes it.
Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
members/update-child.pl

index 492219f..6e7b1da 100755 (executable)
@@ -86,6 +86,7 @@ elsif ( $op eq 'update' ) {
     my $borcat = GetBorrowercategory($catcode);
     $member->{'category_type'} = $borcat->{'category_type'};
     $member->{'description'}   = $borcat->{'description'};
+    delete $member->{password};
     ModMember(%$member);
 
     if (  $catcode_multi ) {