From e0d23feb43a168d30a78a5774295210a50edbc28 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 16 Mar 2017 22:59:51 -0300 Subject: [PATCH] Bug 18298: Use the validate jQuery plugin To validate password fields we need to use the validate jQuery plugin. To make things reusable this patch adds a new include file 'password_check.inc' at the intranet and opac sides, it creates 3 new validation methods: - password_strong => make sure the passwords are strong enough according to the values of the RequireStrongPassword and minPasswordLength prefs - password_no_spaces => prevent passwords to be entered with leading or trailing spaces - password_match => make sure both password fields match --- .../prog/en/includes/password_check.inc | 25 ++++++++ .../prog/en/modules/members/member-password.tt | 70 +++++++++++----------- .../prog/en/modules/members/memberentrygen.tt | 20 ++++++- koha-tmpl/intranet-tmpl/prog/js/members.js | 14 ----- .../bootstrap/en/includes/password_check.inc | 25 ++++++++ .../bootstrap/en/modules/opac-memberentry.tt | 18 ++++++ .../opac-tmpl/bootstrap/en/modules/opac-passwd.tt | 24 +++++++- 7 files changed, 142 insertions(+), 54 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/password_check.inc create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/password_check.inc diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/password_check.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/password_check.inc new file mode 100644 index 0000000..eb730e6 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/password_check.inc @@ -0,0 +1,25 @@ +[% USE Koha %] +[% BLOCK add_password_check %] + +[% END %] 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 2c28996..5191551 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 @@ -1,3 +1,4 @@ +[% USE Koha %] [% USE Branches %] [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › [% IF ( newpassword ) %]Password updated [% ELSE %]Update password for [% surname %], [% firstname %][% END %] @@ -5,28 +6,7 @@ +[% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt index 53401b9..aed00ed 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -945,6 +945,8 @@ [% INCLUDE 'opac-bottom.inc' %] [% BLOCK jsinclude %] + [% PROCESS 'password_check.inc' %] + [% PROCESS 'add_password_check' new_password => 'borrower_password' %] + [% PROCESS 'password_check.inc' %] + [% PROCESS 'add_password_check' new_password => 'Newkey' %] + +[% END %] -- 2.9.3