Bugzilla – Attachment 110589 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.18 KB, created by
Owen Leonard
on 2020-09-23 11:11:30 UTC
(
hide
)
Description:
Bug 26266: Add jQuery validator to opac-password-recovery.tt
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-09-23 11:11:30 UTC
Size:
4.18 KB
patch
obsolete
>From dd5d258bd6a6710d1c4d993b10e20d80b86de56a Mon Sep 17 00:00:00 2001 >From: John Doe <you@example.com> >Date: Fri, 18 Sep 2020 05:55:22 +0000 >Subject: [PATCH] Bug 26266: Add jQuery validator to opac-password-recovery.tt > >To test: >0) Activate password reset in system preferences. >1) Initiate a password recovery. >2) Try to submit with an invalid password. >3) Confirm that validation occurs. >4) Try to submit with mismatching passwords. >5) Confirm that validation occurs. >6) Sign off. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../bootstrap/en/modules/opac-password-recovery.tt | 25 +++++++++++++++++++--- > opac/opac-password-recovery.pl | 2 +- > 2 files changed, 23 insertions(+), 4 deletions(-) > >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 7328f31736..fe5de79ea2 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,10 @@ > [% INCLUDE 'doc-head-close.inc' %] > [% BLOCK cssinclude %][% END %] > [% BLOCK jsinclude %] >+[% IF (new_password) %] >+ [% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %] >+ [% PROCESS 'password_check.inc' new_password => 'newPassword', minPasswordLength => minPasswordLength, RequireStrongPassword => RequireStrongPassword %] >+[% END %] > <script> > $(function() { > $("#CheckAll").click(function(){ >@@ -21,6 +25,21 @@ > $("fieldset#serial, fieldset#book, fieldset#chapter").hide() > $("fieldset#" + $(this).val() ).show(); > }); >+ [% IF (new_password) %] >+ $("#mainform").validate({ >+ rules: { >+ newPassword: { >+ required: true, >+ password_strong: true, >+ password_no_spaces: true >+ }, >+ repeatPassword: { >+ required: true, >+ password_match: true >+ } >+ } >+ }); >+ [% END %] > }); > </script> > [% END %] >@@ -116,7 +135,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 class="brief"> > [% IF ( RequireStrongPassword ) %] >@@ -125,8 +144,8 @@ > <div class="alert alert-info">Your password must be at least [% minPasswordLength | html %] characters long.</div> > [% END %] > <div class="form-group"> >- <label for="password">New password:</label> >- <input class="form-control" type="password" id="password" size="40" name="password" /> >+ <label for="newPassword">New password:</label> >+ <input class="form-control" type="password" id="newPassword" size="40" name="newPassword" /> > </div> > > <div class="form-group"> >diff --git a/opac/opac-password-recovery.pl b/opac/opac-password-recovery.pl >index d688e365a9..3d492dd205 100755 >--- a/opac/opac-password-recovery.pl >+++ b/opac/opac-password-recovery.pl >@@ -27,7 +27,7 @@ my ( $template, $dummy, $cookie ) = get_template_and_user( > ); > > my $email = $query->param('email') // q{}; >-my $password = $query->param('password'); >+my $password = $query->param('newPassword'); > my $repeatPassword = $query->param('repeatPassword'); > my $id = $query->param('id'); > my $uniqueKey = $query->param('uniqueKey'); >-- >2.11.0
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