Bug 16992: [QA Follow-up] Member-password should pass an userid
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 29 Jul 2016 11:16:40 +0000 (13:16 +0200)
committerKyle M Hall <kyle@bywatersolutions.com>
Wed, 10 Aug 2016 13:34:01 +0000 (13:34 +0000)
If we do not fill a new userid, we should keep the old one.
Script member-password should pass that to Koha::Patron.
Otherwise things go wrong.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Without this patch, you could effectively disable a login.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
members/member-password.pl

index 64d6347..c24a262 100755 (executable)
@@ -64,7 +64,7 @@ push( @errors, 'SHORTPASSWORD' ) if ( $newpassword && $minpw && ( length($newpas
 
 if ( $newpassword && !scalar(@errors) ) {
     my $digest = Koha::AuthUtils::hash_password( $input->param('newpassword') );
-    my $uid    = $input->param('newuserid');
+    my $uid    = $input->param('newuserid') || $bor->{userid};
     my $dbh    = C4::Context->dbh;
     if ( Koha::Patrons->find( $member )->update_password($uid, $digest) ) {
         $template->param( newpassword => $newpassword );