@@ -, +, @@
category
- Verify that all the places in which the 'forgot password' link is
- Attempt to recover the password for a patron that belong to a valid
- Attempt to recover the password for a patron that belongs to a
- Sign off :-D
---
admin/categories.pl | 8 ++-
.../prog/en/modules/admin/categories.tt | 34 ++++++++---
.../intranet-tmpl/prog/en/modules/auth.tt | 3 +-
.../bootstrap/en/includes/masthead.inc | 3 +-
.../bootstrap/en/modules/opac-auth.tt | 3 +-
.../bootstrap/en/modules/opac-main.tt | 3 +-
.../en/modules/opac-password-recovery.tt | 5 +-
opac/opac-password-recovery.pl | 57 +++++++++++--------
8 files changed, 78 insertions(+), 38 deletions(-)
--- a/admin/categories.pl
+++ a/admin/categories.pl
@@ -92,9 +92,11 @@ elsif ( $op eq 'add_validate' ) {
my $BlockExpiredPatronOpacActions = $input->param('BlockExpiredPatronOpacActions');
my $checkPrevCheckout = $input->param('checkprevcheckout');
my $default_privacy = $input->param('default_privacy');
- my $can_reset_password = $input->param('can_reset_password');
+ my $reset_password = $input->param('reset_password');
my @branches = grep { $_ ne q{} } $input->multi_param('branches');
+ $reset_password = undef if $reset_password eq -1;
+
my $is_a_modif = $input->param("is_a_modif");
if ($enrolmentperioddate) {
@@ -123,7 +125,7 @@ elsif ( $op eq 'add_validate' ) {
$category->BlockExpiredPatronOpacActions($BlockExpiredPatronOpacActions);
$category->checkprevcheckout($checkPrevCheckout);
$category->default_privacy($default_privacy);
- $category->can_reset_password($can_reset_password);
+ $category->reset_password($reset_password);
eval {
$category->store;
$category->replace_branch_limitations( \@branches );
@@ -150,7 +152,7 @@ elsif ( $op eq 'add_validate' ) {
BlockExpiredPatronOpacActions => $BlockExpiredPatronOpacActions,
checkprevcheckout => $checkPrevCheckout,
default_privacy => $default_privacy,
- can_reset_password => $can_reset_password,
+ reset_password => $reset_password,
});
eval {
$category->store;
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt
@@ -166,15 +166,35 @@
-
-
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt
@@ -1,6 +1,7 @@
[% USE raw %]
[% USE Koha %]
[% USE Branches %]
+[% USE Categories %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
Koha ›
@@ -42,7 +43,7 @@
[% IF too_many_login_attempts %]
Error: This account has been locked!
- [% IF Koha.Preference('OpacResetPassword') && Koha.Preference('OpacBaseURL') %]
+ [% IF Categories.can_any_reset_password && Koha.Preference('OpacBaseURL') %]
You must reset your password.
[% END %]
[% ELSIF invalid_username_or_password %]
--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc
@@ -1,6 +1,7 @@
[% USE raw %]
[% USE Koha %]
[% USE Branches %]
+[% USE Categories %]
[% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %]
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt
@@ -1,4 +1,5 @@
[% USE Koha %]
+[% USE Categories %]
[% INCLUDE 'doc-head-open.inc' %]
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %] - Forgotten password recovery[% ELSE %]Koha online[% END %] catalog - Forgotten password recovery
[% INCLUDE 'doc-head-close.inc' %]
@@ -54,6 +55,8 @@
Please try again later.
[% ELSIF (errNoBorrowerFound) %]
No account was found with the provided information.
+ [% ELSIF errResetForbidden %]
+ You are not allowed to reset your password. Contact library staff for assistance.
[% ELSIF (errMultipleAccountsForEmail) %]
Account identification with this email address only is ambiguous.
Please use the field 'Login' as well.
@@ -83,7 +86,7 @@
[% END %]
-[% IF (!Koha.Preference('OpacResetPassword')) %]
+[% IF (! Categories.can_any_reset_password ) %]