','70|10','Enter the HTML that will appear in the \'Search for this title in\' box on the detail page in the OPAC. Enter {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the URL. Leave blank to disable \'More Searches\' menu.','Textarea'),
('OpacSeparateHoldings','0',NULL,'Separate current branch holdings from other holdings (OPAC)','YesNo'),
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index f98daa7..5c6fdad 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -7945,6 +7945,21 @@ if (CheckVersion($DBversion)) {
SetVersion($DBversion);
}
+$DBversion = "3.15.00.XXX";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('OpacResetPassword','1','','Shows the ''Forgot your password?'' link in the OPAC','YesNo')");
+ $dbh->do(q{
+ CREATE TABLE IF NOT EXISTS borrower_password_recovery (
+ borrowernumber int(11) NOT NULL,
+ uuid varchar(128) NOT NULL,
+ valid_until timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ KEY borrowernumber (borrowernumber)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+ });
+ print "Upgrade to $DBversion done (Bug 8753: Add forgot password link to OPAC)\n";
+ SetVersion ($DBversion);
+}
+
=head1 FUNCTIONS
=head2 TableExists($table)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
index 1364ff1..66eeb56 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
@@ -557,6 +557,14 @@ OPAC:
track: "Track"
no: "Don't track"
- links that patrons click on
+ -
+ - "The user "
+ - pref: OpacResetPassword
+ default: 1
+ choices:
+ yes: "can reset"
+ no: "can not reset"
+ - " their password on OPAC."
Shelf Browser:
-
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc
index 1edc244..a786069 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc
@@ -278,10 +278,13 @@
[% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]
[% END # /casAuthentication %]
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
new file mode 100644
index 0000000..8dd44aa
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt
@@ -0,0 +1,132 @@
+[% USE Koha %]
+[% INCLUDE 'doc-head-open.inc' %]
+[% IF (LibraryNameTitle) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog ›
+[% INCLUDE 'doc-head-close.inc' %]
+[% BLOCK cssinclude %][% END %]
+[% BLOCK jsinclude %]
+
+[% END %]
+
+
+
+
+
+[% INCLUDE 'masthead.inc' %]
+
+
+
+
+[% IF (!Koha.Preference('OpacResetPassword')) %]
+
You can't reset your password.
+[% ELSIF (password_recovery) %]
+ [% IF (hasError) %]
+
+ [% IF (sendmailError) %]
+ An error has occured while sending you the password recovery link.
+ Please try again later.
+ [% ELSIF (errNoEmailFound) %]
+ No account was found with the email address "[% email %]"
+ Check if you typed it correctly.
+ [% ELSIF (errTooManyEmailFound) %]
+ More than one account has been found for the email address: "[% email %]"
+ Try to use an alternative email if you have one.
+ [% ELSIF (errAlreadyStartRecovery) %]
+ The process of password recovery has already started for this account ("[% email %]")
+ Check your emails; you should receive the link to reset your password.
+ If you did not receive it, click here to get a new password recovery link
+ [% END %]
+
Please contact the staff if you need further assistance.
+
+ [% END %]
+
+ We could not authenticate you as the account owner.
+ Be sure to use the link you received in your email.
+
+ [% ELSE %]
+ [% IF (hasError) %]
+
+ [% IF (errPassNotMatch) %]
+ The passwords entered does not match.
+ Please try again.
+ [% ELSIF (errPassTooShort) %]
+ The password is too short.
+ The password must contain at least [% minPassLength %] characters.
+ [% END %]
+
+ [% END %]
+
+
+
+ [% END %]
+[% ELSIF (mail_sent) %]
+
A mail has been sent to "[% email %]".
+ It contains a link to create a new password.
+ This link will be valid for 2 days starting now.
The password has been changed for user "[% username %]".
+ You can now login using this form.
+[% END %]
+
+
+
+
+
+
+ [% INCLUDE 'usermenu.inc' %]
+
+
+
+[% INCLUDE 'opac-bottom.inc' %]
+
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-send-password-recovery.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-send-password-recovery.tt
new file mode 100644
index 0000000..85c6b7e
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-send-password-recovery.tt
@@ -0,0 +1,19 @@
+[% USE Koha %]
+[% INCLUDE 'doc-head-open.inc' %]
+[% IF (LibraryNameTitle) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog ›
+[% INCLUDE 'doc-head-close.inc' %]
+[% BLOCK cssinclude %][% END %]
+
+[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha Online[% END %] - Password recovery
+
+
+
+
This email has been sent in response to your password recovery request for the account [% username %].
+
+You can now create your new password using the following link:
+ [% uuidLink %]
+
+
This link will be valid for 2 days from this email's reception, then you must reapply if you do not change your password.
+
Thank you.
+
+
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt
index 7b8b8f9..9580668 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt
@@ -85,6 +85,9 @@ please choose against which one you would like to authenticate:
+[% IF Koha.Preference('OpacPasswordChange') && Koha.Preference('OpacResetPassword') %]
+
If you don't have a password yet, stop by the circulation desk the next time you're in the library. We'll happily set one up for you.
Don't have a library card?
If you don't have a library card, stop by your local library to sign up[% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %] or register here[% END %].
[% END %]
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-password-recovery.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-password-recovery.tt
new file mode 100644
index 0000000..1c650c6
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-password-recovery.tt
@@ -0,0 +1,130 @@
+[% USE Koha %]
+[% INCLUDE 'doc-head-open.inc' %]
+[% IF (LibraryNameTitle) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog ›
+[% INCLUDE 'doc-head-close.inc' %]
+
+
+
+
+
+
+
+[% INCLUDE 'masthead.inc' %]
+
+
+
+
+[% IF (!Koha.Preference('OpacResetPassword')) %]
+
You can't reset your password.
+[% ELSIF (password_recovery) %]
+ [% IF (hasError) %]
+
+ [% IF (sendmailError) %]
+ An error has occured while sending you the password recovery link.
+ Please try again later.
+ [% ELSIF (errNoEmailFound) %]
+ No account was found with the email address "[% email %]"
+ Check if you typed it correctly.
+ [% ELSIF (errTooManyEmailFound) %]
+ More than one account has been found for the email address: "[% email %]"
+ Try to use your alternative email if you have one.
+ [% ELSIF (errAlreadyStartRecovery) %]
+ The process of password recovery has already started for this account ("[% email %]")
+ Check your emails; you should receive the link to reset your password.
+ If you didn't receive it, click here to get a new password recovery link
+ [% END %]
+
Please contact the staff if you need further assistance.
+
+ [% END %]
+
+ We could not authenticate you as the account owner.
+ Be sure to use the link you received in your email.
+
+ [% ELSE %]
+ [% IF (hasError) %]
+
+ [% IF (errPassNotMatch) %]
+ The passwords entered does not match.
+ Please try again.
+ [% ELSIF (errPassTooShort) %]
+ The password is too short.
+ The password must contain at least [% minPassLength %] characters.
+ [% END %]
+
+ [% END %]
+
+
+
+ [% END %]
+[% ELSIF (mail_sent) %]
+
A mail has been sent to "[% email %]".
+ It contains a link to create a new password.
+ This link will be valid for 2 days starting now.