From 7cc65af6ffdabbabe7ae3463f51096de375216ad 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Marc Véron Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- .../prog/en/includes/password_check.inc | 25 +++++++ .../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 +++++ .../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 0000000000..eb730e67ed --- /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 2c28996a59..5191551c61 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 d3b89bfdbb..588ad25631 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -931,6 +931,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.39.5