Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reset-password.tt
Lucas Gass 7c8e777712
Bug 31483: Close <ol> tag properly on password reset page
To test:
1) Enable EnableExpiredPasswordReset
2) Find a patron and change their password so you know what it is supposed to be
3) In the database, expire the patron's password, e.g.
UPDATE borrowers SET password_expiration_date = '2022-08-22' where borrowernumber = 21;
4) Go to the OPAC, try to log in with the patron's credentials
5) Click Reset your password
=> Note that the form is in the grey breadcrumbs box, you can compare with any other OPAC page, the grey box should only contain the breadcrumbs

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-07 13:23:53 -07:00

157 lines
9.2 KiB
Text

[% USE raw %]
[% USE Koha %]
[% USE Categories %]
[% USE AdditionalContents %]
[% PROCESS 'html_helpers.inc' %]
[% INCLUDE 'doc-head-open.inc' %]
<title>
Reset your password
&rsaquo;
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog
</title>
[% INCLUDE 'doc-head-close.inc' %]
[% BLOCK cssinclude %][% END %]
</head>
[% INCLUDE 'bodytag.inc' bodyid='opac-login-page' bodyclass='scrollto' %]
[% INCLUDE 'masthead.inc' %]
<div class="main">
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-main.pl">Home</a>
</li>
<li class="breadcrumb-item active">
<a href="#" aria-current="page">Reset your password</a>
</li>
</ol>
</nav> <!-- /#breadcrumbs -->
<div class="container-fluid">
<div class="row justify-content-center">
<div class="col-md-10 col-lg-6">
<div id="opac-auth" class="maincontent">
[% IF Koha.Preference( 'opacuserlogin' ) && Koha.Preference('EnableExpiredPasswordReset') %]
[% IF ( error ) %]
<div class="alert alert-warning">
<h2>There was a problem with your submission</h2>
<p>
[% SWITCH error %]
[% CASE 'no_change' %]
<span>New password must not be the same as old password.</span>
[% CASE 'passwords_mismatch' %]
<span>Passwords do not match. Please re-type your new password.</span>
[% CASE 'password_too_short' %]
<span>Password must be at least [% minPasswordLength | html %] characters long.</span>
[% CASE 'password_too_weak' %]
<span>Password must contain at least one digit, one lowercase and one uppercase.</span>
[% CASE 'password_has_whitespaces' %]
<span>Password must not contain leading or trailing whitespaces.</span>
[% CASE 'invalid_credentials' %]
<span>You entered an incorrect username or password. Please try again! But note that passwords are case sensitive[% IF Koha.Preference('FailedLoginAttempts') %] and that your account will be locked out after a fixed number of failed login attempts[% END %]. Please contact a library staff member if you continue to have problems.</span>
[% CASE 'no_expire' %]
<span>Please log-in to account to update your password.</span></br>
<a href="/cgi-bin/koha/opac-user.pl" class="nav-link login-link loginModal-trigger"><i class="fa fa-user fa-icon-black fa-fw" aria-hidden="true"></i> <span class="userlabel">Log in to your account</span></a>.
[% CASE 'account_locked' %]
This account has been locked!
[% IF Categories.can_any_reset_password && Koha.Preference('OpacBaseURL') %]
<a href="[% Koha.Preference('OpacBaseURL') | url %]/cgi-bin/koha/opac-password-recovery.pl">You must reset your password via e-mail</a>.
[% ELSE %]
<span>You must contact the library for assistance.</span>
[% END %]
[% CASE %]
<span>An unknown error occurred. Please try again or contact the library for assistance.</span>
[% END %]
</p>
</div>
[% END %]
[% IF ( password_updated ) %]
<div class="alert dialog-alert">
<h2>Your password has successfully been updated</h2>
<a href="/cgi-bin/koha/opac-main.pl" class="btn btn-primary">Go to OPAC</a>
[% IF ( Koha.Preference('staffClientBaseURL') && staff_access ) %]
<a href="[% Koha.Preference('staffClientBaseURL') | url %]" class="btn btn-primary">Go to staff interface</a>
[% END %]
</div>
[% ELSE %]
<form action="/cgi-bin/koha/opac-reset-password.pl" name="mainform" id="mainform" method="post" autocomplete="off">
<legend class="sr-only">Reset your password</legend>
<fieldset class="brief">
<div class="form-group">
<label for="userid">Login:</label>
<input class="form-control" type="text" size="25" id="userid" name="userid" />
</div>
<div class="form-group">
<label for="currentpassword">Current password:</label>
<input class="form-control" autocomplete="off" type="password" size="25" id="currentpassword" name="currentpassword" />
</div>
<div class="form-group">
<label for="newpassword">New password:</label>
<input class="form-control" autocomplete="off" type="password" size="25" id="newpassword" name="newpassword" />
</div>
<div class="form-group">
<label for="confirmpassword">Confirm new password:</label>
<input class="form-control" autocomplete="off" type="password" size="25" id="confirmpassword" name="confirmpassword" />
</div>
<fieldset class="action">
<input type="submit" value="Update password" class="btn btn-primary" />
</fieldset>
<input type="hidden" name="op" value="update" />
</fieldset>
[% IF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %]
<div id="resetpassword">
<a href="/cgi-bin/koha/opac-password-recovery.pl">Forgot your password?</a>
</div>
[% END %]
</form>
[% END # /IF Error_messages %]
[% ELSE %]
<h1>Resetting your password has not been enabled by the library.</h1>
[% IF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %]
<div id="resetpassword">
<a href="/cgi-bin/koha/opac-password-recovery.pl">Forgot your password?</a>
</div>
[% ELSE %]
<p>You must contact the library to reset your password</p>
[% END %]
[% END # / IF opacuserlogin %]
</div> <!-- /.opac-auth -->
</div> <!-- /.col-md-10 col-lg-6 -->
</div> <!-- /.row -->
</div> <!-- /.container-fluid -->
</div> <!-- /.main -->
[% INCLUDE 'opac-bottom.inc' %]
[% BLOCK jsinclude %]
[% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %]
<script>
jQuery.validator.addMethod("password_no_spaces", function(value, element){
return ( this.optional(element) || !value.match(/^\s/) && !value.match(/\s$/) );
}, _("Password contains leading and/or trailing spaces"));
jQuery.validator.addMethod("password_match", function(value, element){
var new_password_node = $("input[name='newpassword']:first");
return value == $(new_password_node).val();
}, _("Please enter the same password as above"));
$(document).ready(function() {
$("#mainform").validate({
rules: {
currentpassword: {
required: true,
},
newpassword: {
required: true,
password_no_spaces: true
},
confirmpassword: {
required: true,
password_match: true
}
}
});
});
</script>
[% END %]