Bugzilla – Attachment 68106 Details for
Bug 18298
Allow enforcing password complexity
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18298: (QA followup) Use Koha.Preference on the template
Bug-18298-QA-followup-Use-KohaPreference-on-the-te.patch (text/plain), 3.60 KB, created by
Tomás Cohen Arazi (tcohen)
on 2017-10-13 19:57:12 UTC
(
hide
)
Description:
Bug 18298: (QA followup) Use Koha.Preference on the template
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2017-10-13 19:57:12 UTC
Size:
3.60 KB
patch
obsolete
>From fe3ddc3dc92ff8797c2fdacaa50b0ed95a021877 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >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 <tomascohen@theke.io> >--- > .../intranet-tmpl/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 @@ > <li>You have entered a username that already exists. Please choose another one.</li> > [% END %] > [% IF ( ERROR_password_too_short ) %] >- <li id="ERROR_short_password">Password must be at least [% minPasswordLength %] characters long.</li> >+ <li id="ERROR_short_password">Password must be at least [% Koha.Preference('minPasswordLength') %] characters long.</li> > [% END %] > [% IF ( ERROR_password_too_weak ) %] > <li id="ERROR_weak_password">Password must contain at least one digit, one lowercase and one uppercase.</li> >@@ -117,9 +117,9 @@ > <ol> > <li><label for="newuserid">New username:</label> > <input type="hidden" name="member" value="[% borrowernumber %]" /><input type="text" id="newuserid" name="newuserid" size="20" value="[% userid %]" /></li> >- [% 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 %] > <li> > <label for="newpassword">New password:</label> >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.14.2
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 18298
:
61227
|
61228
|
61229
|
61230
|
61231
|
61232
|
61237
|
61331
|
61332
|
61333
|
61334
|
61335
|
61336
|
62976
|
62977
|
62978
|
62979
|
62980
|
62981
|
66621
|
66622
|
66623
|
66624
|
66625
|
66626
|
68096
|
68097
|
68098
|
68100
|
68101
|
68102
|
68103
|
68104
|
68105
| 68106 |
68220