Bugzilla – Attachment 70596 Details for
Bug 19660
Set borrower password on first login from self registration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug-19660: Set password after self registration
Bug-19660-Set-password-after-self-registration.patch (text/plain), 16.31 KB, created by
jwayway
on 2018-01-17 03:43:35 UTC
(
hide
)
Description:
Bug-19660: Set password after self registration
Filename:
MIME Type:
Creator:
jwayway
Created:
2018-01-17 03:43:35 UTC
Size:
16.31 KB
patch
obsolete
>From c4bef641fa2ffe0bf09234fbdf46ba50a537d16e Mon Sep 17 00:00:00 2001 >From: Jenny Way <jwayway@hotmail.com> >Date: Wed, 17 Jan 2018 03:34:07 +0000 >Subject: [PATCH] Bug-19660: Set password after self registration > >Test plan: >1. Enable PatronSelfRegistration >2. Add a PatronSelfRegistrationDefaultCategory too >3. In OPAC register a user >4. Without patch after hitting submit, password is displayed onscreen >5. After applying patch, password is changed afterwards by sending a >email >6. Note how primary email is required > >Notes >- Email is now required for this to work since a unique key was needed >for password-recovery.pl to work >- A password is randomly generated for the user >--- > .../bootstrap/en/modules/opac-memberentry.tt | 44 +-------- > .../bootstrap/en/modules/opac-password-recovery.tt | 2 +- > .../en/modules/opac-registration-confirmation.tt | 108 ++++++++++++++++++--- > 3 files changed, 99 insertions(+), 55 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >index 26aae2d..613d0d8 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >@@ -510,14 +510,9 @@ > > [% UNLESS hidden.defined('email') %] > <li> >- [% IF mandatory.defined('email') %] >- <label for="borrower_email" class="required">Primary email:</label> >- [% ELSE %] >- <label for="borrower_email">Primary email:</label> >- [% END %] >- >+ <label for="borrower_email" class="required">Primary email:</label> > <input type="text" id="borrower_email" name="borrower_email" value="[% borrower.email %]" /> >- [% IF mandatory.defined('email') %]<span class="required">Required</span>[% END %] >+ <span class="required">Required</span> > </li> > [% END %] > >@@ -803,40 +798,6 @@ > </fieldset> > [% END %] > >- [% UNLESS action == 'edit' || hidden.defined('password') %] >- <fieldset class="rows" id="memberentry_password"> >- <legend id="contact_legend">Password</legend> >- <div class="alert alert-info"> >- <p>Your password must be at least [% Koha.Preference('minPasswordLength') %] characters long.</p> >- [% UNLESS mandatory.defined('password') %] >- <div>If you do not enter a password a system generated password will be created.</div> >- [% END %] >- </div> >- >- [% IF mandatory.defined('password') %] >- <ol> >- <li><label for="borrower_password" class="required">Password</label> >- <input type="password" name="borrower_password" id="password" /> >- <span class="required">Required</span> >- </li> >- <li><label for="borrower_password2" class="required">Confirm password</label> >- <input type="password" name="borrower_password2" id="password2" /> >- <span class="required">Required</span> >- </li> >- </ol> >- [% ELSE %] >- <ol> >- <li><label for="borrower_password">Password</label> >- <input type="password" name="borrower_password" id="password" /> >- </li> >- <li><label for="borrower_password2">Confirm password</label> >- <input type="password" name="borrower_password2" id="password2" /> >- </li> >- </ol> >- [% END %] >- </fieldset> >- [% END %] >- > [% IF ( Koha.Preference('ExtendedPatronAttributes') && patron_attribute_classes.size && !Koha.Preference('PatronSelfRegistrationVerifyByEmail') ) %] > [% FOREACH pa_class IN patron_attribute_classes %] > [% IF pa_class.class %] >@@ -893,6 +854,7 @@ > [% END %] > > [% UNLESS action == 'edit' %] >+ <legend id="vertification_legend">Confirm:</legend> > <fieldset class="rows" id="memberentry_captcha"> > <ol> > >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 c9beb40..e03f545 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 >@@ -122,7 +122,7 @@ > <br/>Please click the link in this email to finish the process of resetting your password. > <br/>This link is valid for 2 days starting now. > </p> >- <a href="/cgi-bin/koha/opac-main.pl"">Return to the main page</a> >+ <a href="/cgi-bin/koha/opac-main.pl">Return to the main page</a> > </div> > [% ELSIF (password_reset_done) %] > <div class="alert alert-success"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt >index 464505d..4dc95c6 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt >@@ -40,10 +40,90 @@ > <span id="patron-userid-label">Username:</span> > <span id="patron-userid">[% borrower.userid %]</span> > </p> >- <p id="patron-password-p"> >- <span id="patron-password-label">Password:</span> >- <span id="patron-password">[% password_cleartext | html %]</span> >- </p> >+ [% IF (hasError) %] >+ <div class="alert alert-warning"> >+ <h3>Error</h3> >+ <p> >+ [% IF (sendmailError) %] >+ An error has occurred while sending you the password recovery link. >+ <br/>Please try again later. >+ [% ELSIF (errNoBorrowerFound) %] >+ No account was found with the provided information. >+ [% ELSIF (errMultipleAccountsForEmail) %] >+ Account identification with this email address only is ambiguous. >+ <br />Please use the field 'Login' as well. >+ [% ELSIF (errAlreadyStartRecovery) %] >+ The process of changing passwords has already been started for this account >+ [% IF username %] >+ ("<strong>[% username %]</strong>") >+ [% ELSIF email %] >+ ("<strong>[% email %]</strong>") >+ [% END %] >+ <br/>You should have received an email with a link to reset your password. >+ <br/>If you did not receive this email, you can request a new one: <a href="/cgi-bin/koha/opac-password-recovery.pl ?resendEmail=true&email=[% email %]&username=[% username %]">Get new password link</a> >+ [% ELSIF (errPassNotMatch) %] >+ The passwords do not match. >+ [% ELSIF password_too_short %] >+ <li>Password must be at least [% minPasswordLength %] characters long.</li> >+ [% ELSIF password_too_weak %] >+ <li>Password must contain at least one digit, one lowercase and one uppercase.</li> >+ [% ELSIF password_has_whitespaces %] >+ <li>Password must not contain leading or trailing whitespaces.</li> >+ [% ELSIF (errLinkNotValid) %] >+ The link you clicked is either invalid, or expired. >+ <br/>Be sure you used the link from the email, or contact library staff for assistance. >+ [% END %] >+ </p> >+ <p>Please contact the library if you need further assistance.</p> >+ </div> >+ [% END %] >+ >+ >+ <div id="password-recovery"> >+ <form action="/cgi-bin/koha/opac-password-recovery.pl" method="post" autocomplete="off"> >+ <input type="hidden" name="koha_login_context" value="opac" /> >+ <fieldset> >+ <p>You have been assigned a randomly generated password. To change your password, enter your email address.</p> >+ <label for="email">Email:</label> >+ <input type="text" id="email" size="40" name="email" value="[% email %]" /> >+ <fieldset class="action"> >+ <input type="submit" value="Submit" class="btn" name="sendEmail" /> >+ </fieldset> >+ </fieldset> >+ </form> >+ [% ELSIF (new_password) %] >+ <form action="/cgi-bin/koha/opac-password-recovery.pl" method="post" autocomplete="off"> >+ <input type="hidden" name="koha_login_context" value="opac" /> >+ <fieldset> >+ <div class="alert alert-info">The password must contain at least [% minPasswordLength %] characters.</div> >+ <label for="password">New password:</label> >+ <input type="password" id="password" size="40" name="password" /> >+ <label for="repeatPassword">Confirm new password:</label> >+ <input type="password" id="repeatPassword" size="40" name="repeatPassword" /> >+ <fieldset class="action"> >+ <input type="hidden" name="username" value="[% username %]" /> >+ <input type="hidden" name="uniqueKey" value="[% uniqueKey %]" /> >+ <input type="submit" value="Submit" class="btn" name="passwordReset" /> >+ </fieldset> >+ </fieldset> >+ </form> >+ [% ELSIF (mail_sent) %] >+ <div class="alert alert-info"> >+ <p> >+ You will receive an email shortly. >+ <br/>Please click the link in this email to finish the process of resetting your password. >+ <br/>This link is valid for 2 days starting now. >+ </p> >+ <a href="/cgi-bin/koha/opac-main.pl">Return to the main page</a> >+ </div> >+ [% ELSIF (password_reset_done) %] >+ <div class="alert alert-success"> >+ <p>The password has been changed for user "[% username %]".</p> >+ <a href="/cgi-bin/koha/opac-user.pl">Click here to login.</a> >+ </div> >+ [% END %] >+ </div><!-- / #password-recovery --> >+ > > [% IF borrower.cardnumber %] > <p id="patron-cardnumber-p"> >@@ -53,7 +133,6 @@ > [% END %] > > <p id="patron-instructions">For your convenience, the login box on this page has been pre-filled with this data. Please log in[% IF OpacPasswordChange %] and change your password[% END %].</p> >- [% END %] > > <div id="PatronSelfRegistrationAdditionalInstructions">[% PatronSelfRegistrationAdditionalInstructions %]</div> > </div> >@@ -76,16 +155,19 @@ > [% ELSE %] > <input type="text" id="userid" size="10" name="userid" value="" /> > [% END %] >- <label for="password">Password:</label> >- [% IF Koha.Preference('PatronSelfRegistrationPrefillForm') %] >- <input type="password" id="password" size="10" name="password" value="[% password_cleartext | html %]" /> >- [% ELSE %] >- <input type="password" id="password" size="10" name="password" value="" /> >- [% END %] >- <fieldset class="action"> >+ <p id="patron-password-p"> >+ <span id="patron-password-label">Password:</span> >+ <span id="patron-password">[% password_cleartext | html %]</span> >+ </p> >+ >+ <fieldset class="action"> > <input type="submit" value="Log in" class="btn" /> > </fieldset> >- [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]<div id="patronregistration"><p>Don't have an account? <a href="/cgi-bin/koha/opac-memberentry.pl">Register here.</a></p></div>[% END %] >+ [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %] >+ <div id="patronregistration"> >+ <p>Don't have an account? <a href="/cgi-bin/koha/opac-memberentry.pl">Register here.</a></p> >+ </div> >+ [% END %] > </fieldset> > </form> > </div> <!-- /#login --> >-- >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 19660
:
70596
|
70727
|
72900
|
72901