Bugzilla – Attachment 108974 Details for
Bug 26266
Add jQuery validator to opac-password-recovery.tt
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26266: Add jQuery validator to opac-password-recovery.tt
Bug-26266-Add-jQuery-validator-to-opac-password-re.patch (text/plain), 4.24 KB, created by
Timothy Alexis Vass
on 2020-08-24 08:59:07 UTC
(
hide
)
Description:
Bug 26266: Add jQuery validator to opac-password-recovery.tt
Filename:
MIME Type:
Creator:
Timothy Alexis Vass
Created:
2020-08-24 08:59:07 UTC
Size:
4.24 KB
patch
obsolete
>From fb46beaddb8bea59aa03410d912b37a0b4ac1fbf Mon Sep 17 00:00:00 2001 >From: Timothy Alexis Vass <timothy_alexis.vass@ub.lu.se> >Date: Mon, 24 Aug 2020 10:58:24 +0200 >Subject: [PATCH] Bug 26266: Add jQuery validator to opac-password-recovery.tt > >To test: >1) Initiate password recovery. >2) Try to enter an invalid password. >3) Confirm that validation occurs. >4) Try to enter mismatching passwords. >5) Confirm that validation occurs. >6) Sign off. >--- > .../bootstrap/en/includes/password_check.inc | 2 +- > .../en/modules/opac-password-recovery.tt | 23 ++++++++++++++++--- > 2 files changed, 21 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/password_check.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/password_check.inc >index 1a94309ae8..aff757fe36 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/password_check.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/password_check.inc >@@ -18,7 +18,7 @@ > return ( this.optional(element) || !value.match(/^\s/) && !value.match(/\s$/) ); > }, _("Password contains leading and/or trailing spaces")); > jQuery.validator.addMethod("password_match", function(value, element){ >- var new_password_node = $("input[name='" + new_password_node_name + "']:first"); >+ var new_password_node = $("#" + new_password_node_name); > return this.optional(element) || value == $(new_password_node).val(); > }, _("Please enter the same password as above")); > </script> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt >index 6e8ff8ae95..4a7eec3d37 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt >@@ -5,6 +5,9 @@ > [% INCLUDE 'doc-head-close.inc' %] > [% BLOCK cssinclude %][% END %] > [% BLOCK jsinclude %] >+[% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %] >+[% PROCESS 'password_check.inc' %] >+[% PROCESS 'add_password_check' new_password => 'password' %] > <script> > $(function() { > $("#CheckAll").click(function(){ >@@ -21,6 +24,20 @@ > $("fieldset#serial, fieldset#book, fieldset#chapter").hide() > $("fieldset#" + $(this).val() ).show(); > }); >+ >+ $("#mainform").validate({ >+ rules: { >+ password: { >+ required: true, >+ password_strong: true, >+ password_no_spaces: true >+ }, >+ repeatPassword: { >+ required: true, >+ password_match: true >+ } >+ } >+ }); > }); > </script> > [% END %] >@@ -44,7 +61,7 @@ > </div> > [% END %] > </div> >- <div class="span10 maincontent"> >+ <div class="span10"> > <h3>Forgotten password recovery</h3> > [% IF (hasError) %] > <div class="alert alert-warning"> >@@ -92,7 +109,7 @@ > <form action="/cgi-bin/koha/opac-password-recovery.pl" method="post" autocomplete="off"> > <input type="hidden" name="koha_login_context" value="opac" /> > <fieldset> >- <p>To reset your password, enter your login or your email address.</p> >+ <p>To reset your password, enter your login or your email address. > <label for="username">Login:</label> > <input type="text" id="username" size="40" name="username" value="[% username | html %]" /> > <label for="email">Email:</label> >@@ -104,7 +121,7 @@ > </form> > [% ELSIF (new_password) %] > [% UNLESS ( errLinkNotValid ) %] >- <form action="/cgi-bin/koha/opac-password-recovery.pl" method="post" autocomplete="off"> >+ <form id="mainform" name="mainform" action="/cgi-bin/koha/opac-password-recovery.pl" method="post" autocomplete="off"> > <input type="hidden" name="koha_login_context" value="opac" /> > <fieldset> > [% IF ( Koha.Preference('RequireStrongPassword') ) %] >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26266
:
108800
|
108972
|
108974
|
108975
|
110312
|
110589
|
110592