diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc index 42f073b9fe..976fc13df1 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc @@ -40,7 +40,7 @@ your tags [% END %] - [% IF ( OpacPasswordChange ) %] + [% IF logged_in_user.category.effective_change_password %] [% IF ( passwdview ) %]
  • [% ELSE %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-passwd.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-passwd.tt index 2126742681..929e221ed5 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-passwd.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-passwd.tt @@ -51,7 +51,7 @@ [% END # /IF Error_messages %] - [% IF ( OpacPasswordChange ) %] + [% IF logged_in_user.category.effective_change_password %] [% IF ( Ask_data ) %] @@ -71,7 +71,7 @@ [% END # /IF Ask_data %] [% ELSE %]
    You can't change your password.
    - [% END # /IF OpacPasswordChange %] + [% END # /IF logged_in_user.category.effective_change_password %] [% IF ( password_updated ) %]
    diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt index c788de187e..5a62324d2d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt @@ -53,7 +53,13 @@

    [% END %] -

    For your convenience, the login box on this page has been pre-filled with this data. Please log in[% IF OpacPasswordChange %] and change your password[% END %].

    +

    + [% IF borrower.category.effective_change_password %] + For your convenience, the login box on this page has been pre-filled with this data. Please log in and change your password. + [% ELSE %] + For your convenience, the login box on this page has been pre-filled with this data. Please log in. + [% END %] +

    [% END %]
    [% PatronSelfRegistrationAdditionalInstructions | $raw %]
    diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl index dbb6d99e5c..7fc9226c29 100755 --- a/opac/opac-memberentry.pl +++ b/opac/opac-memberentry.pl @@ -205,9 +205,6 @@ if ( $action eq 'create' ) { } ); - $template->param( OpacPasswordChange => - C4::Context->preference('OpacPasswordChange') ); - $borrower{categorycode} ||= C4::Context->preference('PatronSelfRegistrationDefaultCategory'); $borrower{password} ||= Koha::AuthUtils::generate_password; my $consent_dt = delete $borrower{gdpr_proc_consent}; diff --git a/opac/opac-passwd.pl b/opac/opac-passwd.pl index 4c72d30c5c..bff0214a9f 100755 --- a/opac/opac-passwd.pl +++ b/opac/opac-passwd.pl @@ -44,7 +44,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( ); my $patron = Koha::Patrons->find( $borrowernumber ); -if ( C4::Context->preference("OpacPasswordChange") ) { +if ( $patron->category->effective_change_password ) { if ( $query->param('Oldkey') && $query->param('Newkey') && $query->param('Confirm') ) diff --git a/opac/opac-registration-verify.pl b/opac/opac-registration-verify.pl index ce78ffa807..91e31c0d8e 100755 --- a/opac/opac-registration-verify.pl +++ b/opac/opac-registration-verify.pl @@ -58,9 +58,6 @@ if ( } ); - $template->param( - OpacPasswordChange => C4::Context->preference('OpacPasswordChange') ); - my $patron_attrs = $m->unblessed; $patron_attrs->{password} ||= Koha::AuthUtils::generate_password; my $consent_dt = delete $patron_attrs->{gdpr_proc_consent}; @@ -76,7 +73,7 @@ if ( C4::Form::MessagingPreferences::handle_form_action($cgi, { borrowernumber => $patron->borrowernumber }, $template, 1, C4::Context->preference('PatronSelfRegistrationDefaultCategory') ) if C4::Context->preference('EnhancedMessagingPreferences'); $template->param( password_cleartext => $patron->plain_text_password ); - $template->param( borrower => $patron->unblessed ); + $template->param( borrower => $patron ); $template->param( PatronSelfRegistrationAdditionalInstructions => C4::Context->preference(