From 9136c3dbf89aa824dcc7e848dcf2c7aeb41235f8 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 13 Oct 2017 16:42:03 -0300 Subject: [PATCH] Bug 18298: (QA followup) Use Koha.Preference on the template Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- .../prog/en/modules/members/member-password.tt | 10 +++++----- members/member-password.pl | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt index 18749ae06f..a80d89c9ba 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt @@ -9,7 +9,7 @@ function generate_password() { // Always generate a strong password var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; - var length = [% minPasswordLength %]; + var length = [% Koha.Preference('minPasswordLength') %]; if ( length < 8 ) length = 8; var password=''; for ( var i = 0 ; i < length ; i++){ @@ -21,7 +21,7 @@ $("body").on('click', "#fillrandom",function(e) { e.preventDefault(); var password = ''; - var pattern_regex = /(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{[% minPasswordLength %],}/; + var pattern_regex = /(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{[% Koha.Preference('minPasswordLength') %],}/; while ( ! pattern_regex.test( password ) ) { password = generate_password(); } @@ -94,7 +94,7 @@
  • You have entered a username that already exists. Please choose another one.
  • [% END %] [% IF ( ERROR_password_too_short ) %] -
  • Password must be at least [% minPasswordLength %] characters long.
  • +
  • Password must be at least [% Koha.Preference('minPasswordLength') %] characters long.
  • [% END %] [% IF ( ERROR_password_too_weak ) %]
  • Password must contain at least one digit, one lowercase and one uppercase.
  • @@ -117,9 +117,9 @@
    1. - [% SET password_pattern = ".{" _ minPasswordLength _ ",}" %] + [% SET password_pattern = ".{" _ Koha.Preference('minPasswordLength') _ ",}" %] [% IF Koha.Preference('RequireStrongPassword') %] - [% SET password_pattern = '(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{' _ minPasswordLength _ ',}' %] + [% SET password_pattern = '(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{' _ Koha.Preference('minPasswordLength') _ ',}' %] [% END %]
    2. diff --git a/members/member-password.pl b/members/member-password.pl index bb82bbc2f9..c458ae8f1f 100755 --- a/members/member-password.pl +++ b/members/member-password.pl @@ -145,7 +145,6 @@ $template->param( userid => $bor->{'userid'}, destination => $destination, is_child => ( $category_type eq 'C' ), - minPasswordLength => $minpw, RoutingSerials => C4::Context->preference('RoutingSerials'), csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID'), }), ); -- 2.39.5