Marcel de Rooy
18b046598c
This improves display. This only comes up when you try to reset your password after you did already. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
200 lines
11 KiB
Text
200 lines
11 KiB
Text
[% USE raw %]
|
|
[% USE Koha %]
|
|
[% USE Categories %]
|
|
[% USE AdditionalContents %]
|
|
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
|
|
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
|
|
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Forgotten password recovery › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
[% BLOCK cssinclude %][% END %]
|
|
[% BLOCK jsinclude %]
|
|
[% IF (new_password) %]
|
|
[% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %]
|
|
[% PROCESS 'password_check.inc' new_password => 'newPassword', minPasswordLength => minPasswordLength, RequireStrongPassword => RequireStrongPassword %]
|
|
[% END %]
|
|
<script>
|
|
$(function() {
|
|
$("#CheckAll").click(function(){
|
|
$("[name=deleteRequest]").attr('checked', true);
|
|
return false;
|
|
});
|
|
|
|
$("#CheckNone").click(function(){
|
|
$("[name=deleteRequest]").attr('checked', false);
|
|
return false;
|
|
});
|
|
|
|
$("select#type").change(function() {
|
|
$("fieldset#serial, fieldset#book, fieldset#chapter").hide()
|
|
$("fieldset#" + $(this).val() ).show();
|
|
});
|
|
$("#resendmail").click(function() {
|
|
$("#resendform").submit();
|
|
});
|
|
[% IF (new_password) %]
|
|
$("#mainform").validate({
|
|
rules: {
|
|
newPassword: {
|
|
required: true,
|
|
password_strong: true,
|
|
password_no_spaces: true
|
|
},
|
|
repeatPassword: {
|
|
required: true,
|
|
password_match: true
|
|
}
|
|
}
|
|
});
|
|
[% END %]
|
|
});
|
|
</script>
|
|
[% END %]
|
|
</head>
|
|
[% INCLUDE 'bodytag.inc' bodyid='opac-password-recovery' %]
|
|
[% INCLUDE 'masthead.inc' %]
|
|
|
|
<div class="main">
|
|
[% WRAPPER breadcrumbs %]
|
|
[% WRAPPER breadcrumb_item bc_active= 1 %]
|
|
<span>Forgotten password recovery</span>
|
|
[% END %]
|
|
[% END #/ WRAPPER breadcrumbs %]
|
|
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-lg-2">
|
|
[% IF ( OpacPublic ) %]
|
|
<div id="navigation">
|
|
[% INCLUDE 'navigation.inc' IsPatronPage=0 %]
|
|
</div>
|
|
[% END %]
|
|
</div>
|
|
<div class="col-6 order-first order-md-first order-lg-2 maincontent">
|
|
<h1>Forgotten password recovery</h1>
|
|
[% IF (hasError) %]
|
|
<div class="alert alert-warning">
|
|
<h2>Error</h2>
|
|
<p>
|
|
[% IF (sendmailError) %]
|
|
<span>An error has occurred while sending you the password recovery link.</span>
|
|
<br/><span>Please try again later.</span>
|
|
[% ELSIF (errNoBorrowerFound) %]
|
|
<span>No account was found with the provided information.</span>
|
|
[% ELSIF errResetForbidden %]
|
|
<span id="password-reset-forbidden">Sorry, your password cannot be changed online.</span>
|
|
[% ELSIF (errMultipleAccountsForEmail) %]
|
|
<span>Account identification with this email address only is ambiguous.</span>
|
|
<br /><span>Please use the field 'Login' as well.</span>
|
|
[% ELSIF (errNoBorrowerEmail) %]
|
|
<span>This account has no email address we can send the email to.</span>
|
|
[% ELSIF (errAlreadyStartRecovery) %]
|
|
<span>The process of password recovery has already been started for this account</span>
|
|
[% IF username %]
|
|
("<strong>[% username | html %]</strong>")
|
|
[% ELSIF email %]
|
|
("<strong>[% email | html %]</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="#" id="resendmail">Get new password recovery link</a>
|
|
<form method="post" id="resendform" action="/cgi-bin/koha/opac-password-recovery.pl">
|
|
[% INCLUDE 'csrf-token.inc' %]
|
|
<input type="hidden" name="op" value="cud-resendEmail" />
|
|
<input type="hidden" name="email" value="[% email | url %]" />
|
|
<input type="hidden" name="username" value="[% username | uri %]" />
|
|
</form>
|
|
[% ELSIF (errPassNotMatch) %]
|
|
The passwords do not match.
|
|
[% ELSIF password_too_short %]
|
|
<li>Password must be at least [% minPasswordLength | html %] 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> <!-- /div.alert.alert-warning -->
|
|
[% END # /IF hasError %]
|
|
|
|
<div id="password-recovery">
|
|
[% IF (! Categories.can_any_reset_password ) %]
|
|
<div class="alert alert-info">You can't reset your password.</div>
|
|
[% ELSIF (password_recovery) %]
|
|
<form action="/cgi-bin/koha/opac-password-recovery.pl" method="post" autocomplete="off">
|
|
[% INCLUDE 'csrf-token.inc' %]
|
|
<legend class="sr-only">Password recovery</legend>
|
|
<input type="hidden" name="koha_login_context" value="opac" />
|
|
<p>To reset your password, enter your login or your email address.</p>
|
|
<fieldset class="brief">
|
|
<div class="form-group">
|
|
<label for="username">Login:</label>
|
|
<input class="form-control" type="text" id="username" size="40" name="username" value="[% username | html %]" />
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="email">Email:</label>
|
|
<input class="form-control" type="text" id="email" size="40" name="email" value="[% email | html %]" />
|
|
</div>
|
|
|
|
<fieldset class="action">
|
|
<input type="hidden" name="op" value="cud-sendEmail" />
|
|
<input type="submit" value="Submit" class="btn btn-primary" name="sendEmail" />
|
|
</fieldset>
|
|
</fieldset>
|
|
</form>
|
|
[% ELSIF (new_password) %]
|
|
[% UNLESS ( errLinkNotValid ) %]
|
|
<form id="mainform" name="mainform" action="/cgi-bin/koha/opac-password-recovery.pl" method="post" autocomplete="off">
|
|
[% INCLUDE 'csrf-token.inc' %]
|
|
<legend class="sr-only">Password not valid</legend>
|
|
<input type="hidden" name="koha_login_context" value="opac" />
|
|
<fieldset class="brief">
|
|
[% IF ( RequireStrongPassword ) %]
|
|
<div class="alert alert-info">Your password must contain at least [% minPasswordLength | html %] characters, including UPPERCASE, lowercase and numbers.</div>
|
|
[% ELSE %]
|
|
<div class="alert alert-info">Your password must be at least [% minPasswordLength | html %] characters long.</div>
|
|
[% END %]
|
|
<div class="form-group">
|
|
<label for="newPassword">New password:</label>
|
|
<input class="form-control" type="password" id="newPassword" size="40" name="newPassword" autocomplete="off" />
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="repeatPassword">Confirm new password:</label>
|
|
<input class="form-control" type="password" id="repeatPassword" size="40" name="repeatPassword" autocomplete="off" />
|
|
</div>
|
|
|
|
<fieldset class="action">
|
|
<input type="hidden" name="username" value="[% username | html %]" />
|
|
<input type="hidden" name="uniqueKey" value="[% uniqueKey | html %]" />
|
|
<input type="submit" value="Submit" class="btn btn-primary" name="passwordReset" />
|
|
</fieldset>
|
|
</fieldset>
|
|
</form>
|
|
[% END # /UNLESS errLinkNotValid %]
|
|
[% 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 | html %]".</p>
|
|
<a href="/cgi-bin/koha/opac-user.pl">Log in to your account.</a>
|
|
</div>
|
|
[% END # /IF (! Categories.can_any_reset_password ) %]
|
|
</div><!-- / #password-recovery -->
|
|
</div><!-- / .span10 -->
|
|
</div><!-- / .row-fluid -->
|
|
</div><!-- / .container-fluid -->
|
|
</div><!-- / .main -->
|
|
[% INCLUDE 'opac-bottom.inc' %]
|