Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt
Maxime Beaulieu d5abcbc8f3 Bug 8753 - Add forgot password link to OPAC
I've addressed a lot of Liz Rea's points.

1.  I have moved the code from updatedatabase.pl and kohastructure.sql to a file in the atomicupdates directory.
1a. The feature is now off by default when the atomicupdate is run.

2.  The password reset link is now visible on the home page, in the modal box and on opac-user.pl .

3.  The password recovery pages now use bootstrap markup.

4.  I am unsure here. I see "New Password:" and "Confirm new password:".

5.  This should still work :).

6.  I could not reproduce.

7.  I have added the userid field.
    You can now reset the password by submitting either your useid or email address.
    Both fields can be filled, but the email address must be one of the borrower's (email, emailpro or b_email).
    When entering only the email address and two borrowers use that same address, the system tells the user to try with another address or to specify his userid.

8.  The text is in the atomicupdate file. Have at it, anyone.

Concerning the email. It is inconvenient for the use to have to wait X minutes for the message queue the be processed.
Maybe we could add a sub in Letters.pm that:
    Takes the same argments as EnqueueLetter
    Sends the letter.
    Saves the letter in the message queue with a 'sent' status.

 TEST PLAN:

Setup)
    1) apply the patch
    2) go to system preferences OPAC>>Privacy and set 'OpacResetPassword' to ON.
    2b) make sure that OpacPasswordChange is also ON.
A)
    1) refresh front page, click on 'Forgot your password' and enter a VALID address
    1b) Also try an INVALID address (valid yet not in your koha db).  An error message will show up.
    2) An email should be received at that address with a link.
    3) Follow the link in the mail to fill the new password.
    Until a satisfactory new password is entered, the old password is not reset.
    4) Go to main page try the new password.
B)
    1) Repeat the password reset, this time use the userid (username) field.
    2) Try to reset the password using a userid and an email not linked to the account. An error appears.
    3) Make sure the borrower has many available email addresses.
    4) For each email, reset the password using both the userid and the email. The link should be sent to the specified address
C)
    1) Make sure two borrowers use the same email.
    2) Repeat the reset procedure in test case A). An error message appears

http://bugs.koha-community.org/show_bug.cgi?id=13068

 Author:    Maxime Beaulieu <maxime.beaulieu@inlibro.com>

Followed test plan. Works as described.
Signed-off-by: Marc Veron <veron@veron.ch>

New sign-off after testing all patches together
Signed-off-by: Marc Veron <veron@veron.ch>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
2016-01-27 06:40:53 +00:00

120 lines
6 KiB
Text

[% USE Koha %]
[% USE Branches %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog</title>
[% INCLUDE 'doc-head-close.inc' %]
[% BLOCK cssinclude %][% END %]
</head>
[% INCLUDE 'bodytag.inc' bodyid='opac-main' %]
[% INCLUDE 'masthead.inc' %]
<div class="main">
<ul class="breadcrumb">
<li><a href="#">Home</a></li>
</ul>
[% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
[% IF ( loggedinusername ) %]
<div id="loggedin" class="container-fluid">
[% ELSE %]
<div id="notloggedin" class="container-fluid">
[% END %]
[% ELSE %]
<div id="notloggedin" class="container-fluid">
[% END %]
<div class="row-fluid">
[% IF ( OpacNav || OpacNavBottom ) %]
<div class="span2">
<div id="navigation">
[% INCLUDE 'navigation.inc' %]
</div>
</div>
[% END %]
[% IF ( OpacNav || OpacNavBottom ) %]
<div class="span7">
[% ELSE %]
<div class="span9">
[% END %]
[% IF ( koha_news_count ) %]
<div id="news" class="newscontainer">
[% SET newsdisp = ( Koha.Preference('NewsAuthorDisplay') ) %]
[% FOREACH koha_new IN koha_news %]
<div class="newsitem">
<a name="newsitem[% koha_new.idnew %]"></a><h4 class="newsheader">[% koha_new.title %]</h4>
<div class="newsbody">[% koha_new.new %]</div>
<div class="newsfooter">(published on [% koha_new.newdate %][% IF ( (newsdisp == 'opac' || newsdisp == 'both') && koha_new.borrowernumber ) %] by <span class="newsauthor_title">[% koha_new.author_title %] </span>[% koha_new.author_firstname %] [% koha_new.author_surname %][% END %])</div>
</div>
[% END %]
</div>
<div id="rssnews-container">
[% SET branchcode = Branches.GetLoggedInBranchcode() %]
<a href="[% OPACBaseURL %]/cgi-bin/koha/opac-news-rss.pl?branchcode=[% branchcode %]"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png"></a>
RSS feed for [% IF ( loggedinusername ) %][% Branches.GetName( branchcode ) %] <i>and</i> [% END %] system-wide library news.
</div>
[% END %]
[% IF ( display_daily_quote && daily_quote ) %]
<div id="daily-quote">
<h3>Quote of the Day</h3>
<div>
<span id="daily-quote-text">[% daily_quote.text %]</span><span id="daily-quote-sep"> ~ </span><span id="daily-quote-source">[% daily_quote.source %]</span>
</div>
</div>
[% END %]
[% IF ( OpacMainUserBlock ) %]<div id="opacmainuserblock">[% OpacMainUserBlock %]</div>[% END %]
</div> <!-- / .span 7/9 -->
[% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) || OpacNavRight ) %]
<div class="span3">
[% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
[% UNLESS ( loggedinusername ) %]
[% UNLESS ( casAuthentication || shibbolethAuthentication ) %]
<div id="login">
<form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="auth">
<input type="hidden" name="koha_login_context" value="opac" />
<fieldset class="brief">
<legend>Log in to your account:</legend>
<label for="userid">Login:</label><input type="text" id="userid" name="userid" />
<label for="password">Password:</label><input type="password" id="password" name="password" />
<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 %]
</fieldset>
[% IF Koha.Preference('OpacPasswordChange') && Koha.Preference('OpacResetPassword') %]
<div id="forgotpassword">
<h5>Forgot your password?</h5>
<p>If you do not remember your password, click <a href="/cgi-bin/koha/opac-password-recovery.pl">here</a> to create a new one.</p>
</div>
[% END %]
[% IF Koha.Preference( 'NoLoginInstructions' ) %]
<div id="nologininstructions-main">
[% Koha.Preference( 'NoLoginInstructions' ) %]
</div>
[% END %]
</form>
</div> <!-- /#login -->
[% END # /casAuthentication %]
[% IF persona %]
<a href="#" class="persona-button" id="browserid" ><span>Sign in with your email</span></a>
[% END # /persona %]
[% END # / loggedinusername %]
[% END # /opacuserlogin %]
[% IF ( OpacNavRight ) %]
<div id="opacnavright">
[% OpacNavRight %]
</div>
[% END # /OpacNavRight %]
</div> <!-- / .span3 -->
[% END # /opacuserlogin || OpacNavRight %]
</div> <!-- /.container-fluid -->
</div> <!-- /.row-fluid -->
</div> <!-- /.main -->
[% INCLUDE 'opac-bottom.inc' %]
[% BLOCK jsinclude %][% END %]