From f8381b6bec117f5a3608dd867f511161df782407 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Sat, 2 Feb 2019 09:49:44 +0000 Subject: [PATCH] Bug 21976: Make koha-reset-passwd respect restrictions This patch makes the set_password.pl script default to respect the restrictions, and adds a --skip_validation parameter to it. koha-reset-passwd is adapted so it also accepts this parameter. The result is the default behaviour respects the restrictions, and they can be skipped. To test: - Try with and without the option switch - Notice the randomly generated password is always strongest than what we enforce. - Sign off --- debian/docs/koha-reset-passwd.xml | 15 ++++++++++++-- debian/scripts/koha-reset-passwd | 33 ++++++++++++++++++++++++++++--- misc/admin/set_password.pl | 5 ++++- 3 files changed, 47 insertions(+), 6 deletions(-) diff --git a/debian/docs/koha-reset-passwd.xml b/debian/docs/koha-reset-passwd.xml index 5ded51d8ab..dc404b6e22 100644 --- a/debian/docs/koha-reset-passwd.xml +++ b/debian/docs/koha-reset-passwd.xml @@ -23,14 +23,25 @@ - koha-reset-passwd instancename username + koha-reset-passwd [--skip_validation]instancename username Description Reset password for a user in a Koha instance. - + + Options + + + + + If specified, no password enforcement policies will the applied. + + + + + See also koha-dump-defaults(8) diff --git a/debian/scripts/koha-reset-passwd b/debian/scripts/koha-reset-passwd index ac3c40673f..9bb46b0202 100755 --- a/debian/scripts/koha-reset-passwd +++ b/debian/scripts/koha-reset-passwd @@ -34,7 +34,10 @@ usage() cat < \$help, 'userid=s' => \$userid, 'password=s' => \$password, 'patron_id=s' => \$patron_id, 'cardnumber=s' => \$cardnumber, + 'skip_validation' => \$skip_validation ); pod2usage(1) if $help; @@ -62,7 +65,7 @@ unless ( $patrons->count > 0 ) { } my $patron = $patrons->next; -$patron->set_password({ password => $password, skip_validation => 1 }); +$patron->set_password({ password => $password, skip_validation => $skip_validation }); =head1 NAME -- 2.20.1