Bug 21087: Fix create_superlibrarian.pl script
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 25 Jul 2018 22:09:01 +0000 (19:09 -0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 30 Jul 2018 17:58:06 +0000 (14:58 -0300)
Signed-off-by: John Doe <you@example.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

misc/devel/create_superlibrarian.pl

index 89b7387..938d34e 100755 (executable)
@@ -40,7 +40,7 @@ pod2usage("branchcode is mandatory")   unless $branchcode;
 pod2usage("categorycode is mandatory") unless $categorycode;
 pod2usage("cardnumber is mandatory")   unless $cardnumber;
 
-Koha::Patron->new({
+my $patron = Koha::Patron->new({
     surname      => $surname,
     userid       => $userid,
     cardnumber   => $cardnumber,
@@ -50,6 +50,9 @@ Koha::Patron->new({
     flags        => 1,
 })->store;
 
+my $digest = Koha::AuthUtils::hash_password($password);
+$patron->update({password => $digest,});
+
 =head1 NAME
 
 create_superlibrarian.pl - create a user in Koha with superlibrarian permissions