From 897ee3282a59c9661bb81d08a4df6425ba2b32a5 Mon Sep 17 00:00:00 2001 From: Jacob O'Mara Date: Thu, 14 Aug 2025 11:50:54 +0100 Subject: [PATCH] Bug 40824: Add password history count field to category admin Add password_history_count field to category administration: - Add form field processing in admin/categories.pl - Add input field to categories.tt template with system preference fallback hint --- admin/categories.pl | 4 ++++ koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/admin/categories.pl b/admin/categories.pl index 04b5e5cc024..ecc1991a401 100755 --- a/admin/categories.pl +++ b/admin/categories.pl @@ -76,6 +76,7 @@ if ( $op eq 'add_form' ) { my $exclude_from_local_holds_priority = $input->param('exclude_from_local_holds_priority'); my $min_password_length = $input->param('min_password_length'); my $require_strong_password = $input->param('require_strong_password'); + my $password_history_count = $input->param('password_history_count'); my $noissuescharge = $input->param('noissuescharge') || undef; my $noissueschargeguarantees = $input->param('noissueschargeguarantees') || undef; my $noissueschargeguarantorswithguarantees = $input->param('noissueschargeguarantorswithguarantees') || undef; @@ -88,6 +89,7 @@ if ( $op eq 'add_form' ) { $reset_password = undef if $reset_password eq -1; $change_password = undef if $change_password eq -1; $min_password_length = undef unless length($min_password_length); + $password_history_count = $password_history_count ? int($password_history_count) : undef; $require_strong_password = undef if $require_strong_password eq -1; $force_password_reset_when_set_by_staff = undef if $force_password_reset_when_set_by_staff eq -1; @@ -117,6 +119,7 @@ if ( $op eq 'add_form' ) { $category->exclude_from_local_holds_priority($exclude_from_local_holds_priority); $category->min_password_length($min_password_length); $category->require_strong_password($require_strong_password); + $category->password_history_count($password_history_count); $category->noissuescharge($noissuescharge); $category->noissueschargeguarantees($noissueschargeguarantees); $category->noissueschargeguarantorswithguarantees($noissueschargeguarantorswithguarantees); @@ -156,6 +159,7 @@ if ( $op eq 'add_form' ) { exclude_from_local_holds_priority => $exclude_from_local_holds_priority, min_password_length => $min_password_length, require_strong_password => $require_strong_password, + password_history_count => $password_history_count, noissuescharge => $noissuescharge, noissueschargeguarantees => $noissueschargeguarantees, noissueschargeguarantorswithguarantees => $noissueschargeguarantorswithguarantees, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt index e91ba21feb3..2d3d81cc900 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt @@ -309,6 +309,11 @@
Leave blank to use system default ([% Koha.Preference('minPasswordLength') | html %])
+
  • + + +
    Leave blank to use system default ([% Koha.Preference('PasswordHistoryCount') | html %])
    +