Bugzilla – Attachment 88128 Details for
Bug 6473
Test bug for Git-bz ✔ ❤ ★
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18308 - Added step to onboarding tool to set minPasswordLength
Bug-18308---Added-step-to-onboarding-tool-to-set-m.patch (text/plain), 10.72 KB, created by
Hayley Pelham
on 2019-04-17 03:50:34 UTC
(
hide
)
Description:
Bug 18308 - Added step to onboarding tool to set minPasswordLength
Filename:
MIME Type:
Creator:
Hayley Pelham
Created:
2019-04-17 03:50:34 UTC
Size:
10.72 KB
patch
obsolete
>From df84cd965faf859a372b2d6f7510d4329cb69362 Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Fri, 20 Oct 2017 22:32:46 +0000 >Subject: [PATCH] Bug 18308 - Added step to onboarding tool to set > minPasswordLength > >This patch increases the default minPasswordLength syspref value to 8 >characters, for new installations. > >The final (6th step) of the onboarding tool is now a password length >page where the default value of 8 can be altered. There is a security warning in red recommending to the user they >keep the minimum length of the password at 8 characters or more. > >This patch also removes the atomicupdate .sql file to be run in an update to alter the default >minPasswordLength value for existing Koha installations, based on tester >feedback. > >Test plan: >1. Create a patron with a password less than 3 characters in length and >notice that a red message is displayed by the input telling you that the >password must be 3 characters minimum length > >2. Query the database "select value from systempreferences where >variable="minPasswordLength"; and notice the value is 3 > >3. Drop and recreate your database and restart memcached > >4. Go through the web installer and onboarding tool. Noticing the last >step of the onboarding tool is to create a circulation rule > >5. Apply patch > >6. Repeat step 3 > >7. Go through the web installer and onboarding tool. Noticing the last >step of the onboarding tool is to set the minimum password length, the >numerical input element has a default value of 8 and notice that it will >go below 3 > >8. Repeat step 2 and notice the value is 8 > >9. In the onboarding tool change the minimum password length value to 7 >and submit the form > >10. Notice the completed page of the onboarding tool is displayed with >the message that the minimum password length has been set. > >11. Repeat step 2 and notice the value is now 7. > >12. Try to create a patron in Intranet and OPAC with a password less >than 7 characters and notice that a red message is displayed by the >input telling you that the password must be 7 characters minimum length > >Sponsored-By: Catalyst IT > >Signed-off-by: David Bourgault <david.bourgault@inlibro.com> > >https://bugs.koha-community.org/show_bug.cgi?id=6473 >--- > installer/data/mysql/sysprefs.sql | 2 +- > installer/onboarding.pl | 22 ++++++++- > koha-tmpl/intranet-tmpl/prog/css/installer.css | 4 ++ > .../prog/en/includes/onboarding_messages.inc | 4 ++ > .../prog/en/modules/onboarding/onboardingstep5.tt | 10 ---- > .../prog/en/modules/onboarding/onboardingstep6.tt | 53 ++++++++++++++++++++++ > 6 files changed, 82 insertions(+), 13 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt > >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index a490bd6a1e..d91d4a0a5b 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -306,7 +306,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('MaxSearchResultsItemsPerRecordStatusCheck','20','','Max number of items per record for which to check transit and hold status','Integer'), > ('MembershipExpiryDaysNotice','',NULL,'Send an account expiration notice that a patron\'s card is about to expire after','Integer'), > ('MergeReportFields','',NULL,'Displayed fields for deleted MARC records after merge','Free'), >-('minPasswordLength','3',NULL,'Specify the minimum length of a patron/staff password','free'), >+('minPasswordLength','8',NULL,'Specify the minimum length of a patron/staff password','free'), > ('NewItemsDefaultLocation','','','If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )',''), > ('NewsAuthorDisplay','none','none|opac|staff|both','Display the author name for news items.','Choice'), > ('noissuescharge','5','','Define maximum amount withstanding before check outs are blocked','Integer'), >diff --git a/installer/onboarding.pl b/installer/onboarding.pl >index 77aa12018a..785b686ddd 100755 >--- a/installer/onboarding.pl >+++ b/installer/onboarding.pl >@@ -290,12 +290,30 @@ if ( $step == 5 ) { > $step++ if Koha::IssuingRules->count; > } > >+if ( $step == 6 ) { >+ if ( $op eq 'set_validate_min_password_length' ) { >+ my $minPasswordLength = $input->param('pref_minPasswordLength'); >+ warn $minPasswordLength; >+ C4::Context->set_preference( 'minPasswordLength', $minPasswordLength ); >+ unless ($@) { >+ push @messages, { code => 'success_on_update_minPasswordLength_syspref' }; >+ $step++; >+ } >+ else { >+ push @messages, { code => 'error_on_update_minPasswordLength_syspref' }; >+ } >+ } >+} >+ > my $libraries = Koha::Libraries->search( {}, { order_by => ['branchcode'] }, ); > $template_params->{libraries} = $libraries; > >-if ( $step > 5 ) { >+my $minPasswordLength = C4::Context->preference('minPasswordLength'); >+$template_params->{minPasswordLength} = $minPasswordLength; >+ >+if ( $step > 6 ) { > $template_params->{all_done} = 1; # If step 5 is complete, we are done! >- $step = 5; >+ $step = 6; > } > > #Getting the appropriate template to display to the user >diff --git a/koha-tmpl/intranet-tmpl/prog/css/installer.css b/koha-tmpl/intranet-tmpl/prog/css/installer.css >index 7d5d3d9fb7..c5f80eff9c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/installer.css >+++ b/koha-tmpl/intranet-tmpl/prog/css/installer.css >@@ -241,3 +241,7 @@ span.breadcrumbs { > .deselectall.optional { > display: none; > } >+ >+#passwordlengthhint { >+ color:red; >+} >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/onboarding_messages.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/onboarding_messages.inc >index 135cc43787..e50e2cdba0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/onboarding_messages.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/onboarding_messages.inc >@@ -33,5 +33,9 @@ > [% CASE 'ERROR_password_has_whitespaces' %] > <div class="alert alert-danger">The patron has not been created the entered password contained whitespaces</div> > [% CASE %][% message | html %] >+ [% CASE 'success_on_update_minPasswordLength_syspref' %] >+ <div class="alert alert-success">Minimum password length set!</div> >+ [% CASE 'error_on_update_minPasswordLength_syspref' %] >+ <div class="alert alert-danger">Minimum password length not set!</div> > [% END %] > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt >index b04013e951..bdeda07463 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt >@@ -15,15 +15,6 @@ > <div id="onboarding-step5" class="installer-main col-sm-8 col-sm-offset-2 col-md-8 col-md-offset-2"> > <h1 id="logo"><a href="#">Koha</a></h1> > >- [% IF all_done %] >- >- <h2>Web installer › Complete</h2> >- [% INCLUDE 'onboarding_messages.inc' %] >- <h3>Congratulations you have finished and are ready to use Koha</h3> >- <a class="btn btn-success" href="/cgi-bin/koha/mainpage.pl">Start using Koha</a> >- >- [% ELSE %] >- > <h2>Web installer › Create a new circulation rule </h2> > > [% INCLUDE 'onboarding_messages.inc' %] >@@ -128,7 +119,6 @@ > > <input type="submit" class="btn btn-primary" value="Submit" /> > </form> >- [% END %] > </div> <!-- / #onboarding-step5 --> > </div> <!-- / .row --> > </div><!-- / .container-fluid --> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt >new file mode 100644 >index 0000000000..f02435646f >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt >@@ -0,0 +1,53 @@ >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Web installer › >+ [% IF all_done %] >+ Complete >+ [% ELSE %] >+ Create circulation rule >+ [% END %] >+</title> >+[% INCLUDE 'installer-doc-head-close.inc' %] >+[% INCLUDE 'validator-strings.inc' %] >+[% INCLUDE 'installer-strings.inc' %] >+<script type="text/javascript" src="[% interface %]/[% theme %]/js/onboarding.js"></script> >+</head> >+ >+<body id="installer" class="installer"> >+ <div class="container-fluid"> >+ <div class="row"> >+ <div id="onboarding-step5" class="installer-main col-sm-8 col-sm-offset-2 col-md-8 col-md-offset-2"> >+ <h1 id="logo"><a href="#">Koha</a></h1> >+ [% IF all_done %] >+ <h2>Web installer › Complete</h2> >+ [% INCLUDE 'onboarding_messages.inc' %] >+ <h3>Congratulations you have finished and are ready to use Koha</h3> >+ <a class="btn btn-success" href="/cgi-bin/koha/mainpage.pl">Start using Koha</a> >+ [% ELSE %] >+ <h2>Web installer › Set minPasswordLength system preference </h2> >+ [% INCLUDE 'onboarding_messages.inc' %] >+ >+ The minPasswordLength system preference is a setting for the shortest length library staff and patrons can set their passwords to. >+ >+ <form name="setMinPasswordLength" method="post" action="onboarding.pl"> >+ <fieldset class="rows"> >+ <input type="hidden" name="step" value="6"/> >+ <input type="hidden" name="op" value="set_validate_min_password_length" /> >+ <ol> >+ <li> >+ <label for="minPasswordname" class="required"> Set your minPasswordLength</label> >+ <input type="number" id="pref_minPasswordLength" name="pref_minPasswordLength" value="[% minPasswordLength%]" min=1></input> >+ <span class="required">Required</span> >+ </li> >+ </ol> >+ <p> >+ To amend the minPasswordLength system preference go to: >+ <span class="breadcrumbs">Administration › Global system preferences › Patrons </span> >+ </p> >+ </fieldset> >+ <input type="submit" class="btn btn-primary" value="Submit" /> >+ </form> >+ [% END %] >+ </div> <!-- / #onboarding-step6 --> >+ </div> <!-- / .row --> >+ >+[% INCLUDE 'intranet-bottom.inc' %] >-- >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 6473
:
4386
|
6837
|
6838
|
6839
|
6840
|
6841
|
6842
|
6843
|
7154
|
7155
|
7567
|
7994
|
7995
|
7996
|
7997
|
8018
|
9807
|
9808
|
9813
|
9831
|
9832
|
9836
|
9854
|
10842
|
10843
|
10844
|
10845
|
10846
|
10847
|
10848
|
10849
|
10850
|
10851
|
10852
|
10853
|
10854
|
10855
|
10856
|
10857
|
10858
|
11540
|
11543
|
11544
|
12502
|
12513
|
12514
|
12515
|
12516
|
12517
|
12518
|
12519
|
13473
|
13673
|
14955
|
14969
|
14970
|
14972
|
15201
|
18949
|
18950
|
18951
|
18952
|
18953
|
18954
|
18955
|
18956
|
18957
|
18958
|
18959
|
18960
|
18961
|
18962
|
18963
|
18971
|
18972
|
19518
|
19519
|
19591
|
19592
|
19871
|
19879
|
19880
|
19881
|
19882
|
20011
|
20012
|
20013
|
20014
|
22477
|
22481
|
22482
|
22496
|
22502
|
22503
|
31958
|
32444
|
32445
|
32446
|
32447
|
32448
|
32449
|
32450
|
32451
|
32452
|
34200
|
34201
|
34625
|
34999
|
35130
|
35269
|
35273
|
35274
|
35275
|
35276
|
35277
|
35279
|
35280
|
35303
|
40954
|
40957
|
45345
|
45349
|
45731
|
45732
|
45733
|
45734
|
47283
|
47284
|
47298
|
47299
|
47300
|
47334
|
47336
|
49083
|
56974
|
61059
|
61069
|
62038
|
65313
|
77301
|
78016
|
79959
|
80178
|
80179
|
80180
|
80181
|
80182
|
84400
|
86644
|
86645
|
87152
|
88128
|
95586
|
95716
|
97394
|
99026
|
99027
|
114217
|
114218
|
114219
|
114220
|
114221
|
114222
|
114223
|
114224
|
114225
|
114226
|
119255
|
121181
|
131891
|
131893
|
131894
|
134862
|
144109
|
144144
|
144671
|
144672
|
144673
|
147183
|
149030
|
149031
|
149032
|
149033
|
160566
|
160567
|
160568