Bugzilla – Attachment 69321 Details for
Bug 18308
Default value of minPasswordLength should be increased
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18308 - Added warning and dialog alert
Bug-18308---Added-warning-and-dialog-alert.patch (text/plain), 6.12 KB, created by
Alex Buckley
on 2017-11-23 23:48:20 UTC
(
hide
)
Description:
Bug 18308 - Added warning and dialog alert
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2017-11-23 23:48:20 UTC
Size:
6.12 KB
patch
obsolete
>From 68b2d5f72bd6cf8e2ce10462a958455e40783b18 Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Fri, 24 Nov 2017 11:42:25 +1300 >Subject: [PATCH] Bug 18308 - Added warning and dialog alert > >If an institution has a minPasswordLength which is < 8 characters then a warning >will be set (which is visible in the intranet-error.log) and a dialog >alert div will display the warning to the user in the memberentry.pl >page in the intranet. > >Test plan: >1. Ensure that your minPasswordLength is set to less than 8 characters. >This replicates the use case that a Koha instance is existing (i.e. not >a new Koha instance) and not gone through the password length step of >the onboarding tool (previous patch on this bug report) or that the >institituion is new but set a password length of less than 8 in the >onboarding tool > >2. Go to the memberentry.pl page and notice that there is no warning >at the top of the page informing you that your minPasswordLength is less >than 8 > >3. Apply this patch > >4. Refresh the memberentry.pl page and notice that there is a yellow >warning at the top of the page informing you that your minPasswordLength >syspref is less than 8 > >Sponsored-By: Catalyst IT >--- > .../prog/en/modules/members/memberentrygen.tt | 5 +++ > .../prog/en/modules/onboarding/onboardingstep6.tt | 50 ++++++++++++++++++++++ > members/memberentry.pl | 10 +++++ > 3 files changed, 65 insertions(+) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index 8a17653..5461e28 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -250,6 +250,11 @@ $(document).ready(function() { > </div> > [% END %] > >+[% IF passwordwarning %] >+ <div class="dialog alert"> >+ <p><strong> Warning: </strong> [% passwordwarning %]</p> >+ </div> >+[% END %] > > <div id="toolbar" class="btn-toolbar"> > [% UNLESS ( check_member ) %] >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 0000000..7ddb696 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep6.tt >@@ -0,0 +1,50 @@ >+[% 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> >+ </fieldset> >+ >+ <input type="submit" class="btn btn-primary" value="Submit" /> >+ </form> >+ [% END %] >+ </div> <!-- / #onboarding-step6 --> >+ </div> <!-- / .row --> >+ >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 13793e7..df27e07 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -174,6 +174,14 @@ $category_type="A" unless $category_type; # FIXME we should display a error mess > # if a add or modify is requested => check validity of data. > %data = %$borrower_data if ($borrower_data); > >+#Check passwords >+my $minPasswordLength = C4::Context->preference('minPasswordLength'); >+warn $minPasswordLength; >+if ($minPasswordLength < 8) { >+ warn my $warning = "Your minPasswordLength system preference is less than 8 characters this means library patrons can potentially set passwords which are vulnerable to cracking. Please set your minPasswordLength syspref to 8 or more characters"; >+ $template->param("passwordwarning"=>$warning); >+} >+ > # initialize %newdata > my %newdata; # comes from $input->param() > if ( $op eq 'insert' || $op eq 'modify' || $op eq 'save' || $op eq 'duplicate' ) { >@@ -355,6 +363,8 @@ if ($op eq 'save' || $op eq 'insert'){ > push @errors, "ERROR_login_exist"; > } > >+ >+ > my $password = $input->param('password'); > my $password2 = $input->param('password2'); > push @errors, "ERROR_password_mismatch" if ( $password ne $password2 ); >-- >2.1.4
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 18308
:
68374
|
68381
|
68451
|
69318
|
69319
|
69320
|
69321
|
69323
|
69324
|
69459
|
69461
|
69462
|
87124
|
87125
|
87126
|
87128
|
87129
|
87339
|
87340
|
87564
|
87572
|
87573
|
87747
|
87959
|
87960
|
87961
|
87962
|
87963
|
87964
|
87966
|
88010
|
88011
|
88012
|
88013
|
88014
|
88242
|
88243
|
88306
|
88307
|
88308
|
88309
|
88310
|
88311
|
88312
|
88313
|
88314
|
88315
|
88316
|
88317
|
88318
|
88319
|
88320
|
88321
|
88840
|
90079
|
103617
|
104235
|
104236
|
104351