Bug 41796: "Forgot your password" link is not visible if OpacResetPassword is enabled but OpacPasswordChange is disabled

Before applying this patch, to reproduce the issue:
1. Set system preference OpacResetPassword to 'not allowed'
2. Set system preference OpacPasswordChange to 'Don't allow'
3. Set preference opacuserlogin to 'Allow'
4. Navigate to OPAC
5. Observe no "Forgot your password?" link on the OPAC main page
6. Set system preference OpacResetPassword to 'allowed'
7. Observe no "Forgot your password?" link on the OPAC main page
8. Set system preference OpacPasswordChange 'Allow'
9. Observe "Forgot your password?" link is present on the OPAC main page.

Instead, it should be already present when OpacResetPassword is allowed.

To test this patch:
1. Apply this patch
2. Set system preference OpacResetPassword to 'not allowed'
3. Set system preference OpacPasswordChange to 'Don't allow'
4. Set preference opacuserlogin to 'Allow'
5. Navigate to OPAC
6. Observe no "Forgot your password?" link on the OPAC main page
7. Set system preference OpacResetPassword to 'allowed'
8. Observe "Forgot your password?" link is present

Signed-off-by: Bo Gustavsson <bosse@gustavsson.one>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Lari Taskula 2026-02-09 11:52:05 +02:00 committed by Pedro Amorim
parent 787eb80e9d
commit fe312b32d1
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
4 changed files with 6 additions and 6 deletions

View File

@ -515,7 +515,7 @@
[% IF OpacLoginInstructions %]
<div id="nologininstructions-modal" class="nologininstructions"> [% PROCESS koha_news_block news => OpacLoginInstructions %] </div>
[% END %]
[% IF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %]
[% IF Koha.Preference('OpacResetPassword') && Categories.can_any_reset_password %]
<div id="forgotpassword-modal" class="forgotpassword">
<p><a href="/cgi-bin/koha/opac-password-recovery.pl">Forgot your password?</a></p>
</div>

View File

@ -220,7 +220,7 @@
[% END %]
[% IF Koha.Preference('EnableExpiredPasswordReset') %]
<a href="/cgi-bin/koha/opac-reset-password.pl">Reset your password</a>.
[% ELSIF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %]
[% ELSIF Koha.Preference('OpacResetPassword') && Categories.can_any_reset_password %]
<div id="resetpassword">
<a href="/cgi-bin/koha/opac-password-recovery.pl">Reset your password</a>
</div>
@ -272,7 +272,7 @@
<p>If you don't have a library card, stop by your local library to sign up.</p>
[% END # / IF OpacLoginInstructions %]
</div>
[% IF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %]
[% IF Koha.Preference('OpacResetPassword') && Categories.can_any_reset_password %]
<div id="forgotpassword">
<p><a href="/cgi-bin/koha/opac-password-recovery.pl">Forgot your password?</a></p>
</div>

View File

@ -209,7 +209,7 @@
[% IF ( OpacLoginInstructions ) %]
<div id="nologininstructions-main" class="nologininstructions"> [% PROCESS koha_news_block news => OpacLoginInstructions %] </div>
[% END %]
[% IF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %]
[% IF Koha.Preference('OpacResetPassword') && Categories.can_any_reset_password %]
<div id="forgotpassword-main" class="forgotpassword">
<p><a href="/cgi-bin/koha/opac-password-recovery.pl">Forgot your password?</a></p>
</div>

View File

@ -104,7 +104,7 @@
</fieldset>
<input type="hidden" name="op" value="cud-update" />
</fieldset>
[% IF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %]
[% IF Koha.Preference('OpacResetPassword') && Categories.can_any_reset_password %]
<div id="resetpassword">
<a href="/cgi-bin/koha/opac-password-recovery.pl">Forgot your password?</a>
</div>
@ -113,7 +113,7 @@
[% 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 %]
[% IF Koha.Preference('OpacResetPassword') && Categories.can_any_reset_password %]
<div id="resetpassword">
<a href="/cgi-bin/koha/opac-password-recovery.pl">Forgot your password?</a>
</div>