Bug 38544 - OPAC modal login should not exist when OPAC login is disabled
Summary: OPAC modal login should not exist when OPAC login is disabled
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Fridolin Somers
QA Contact: Matt Blenkinsop
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-27 09:48 UTC by Fridolin Somers
Modified: 2025-03-19 21:21 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This removes the OPAC login dialog box from the HTML when logging into the OPAC is turned off (opacuserlogin system preference), rather than just making it not visible.
Version(s) released in:
25.05.00,24.11.02
Circulation function:


Attachments
Bug 38544: OPAC Modal login not generated when OPAC login is disabled (13.67 KB, patch)
2024-11-27 10:02 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 38544: OPAC Modal login not generated when OPAC login is disabled (13.73 KB, patch)
2024-11-27 22:16 UTC, David Cook
Details | Diff | Splinter Review
Bug 38544: OPAC Modal login not generated when OPAC login is disabled (13.81 KB, patch)
2024-12-09 11:15 UTC, Matt Blenkinsop
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2024-11-27 09:48:37 UTC
When OPAC auth is disabled (system preference opacuserlogin),
the modal auth should not exist in HTML.

The access to opac-user.pl shows a message and not auth form.
But this has been detected by a security check.
So better not have this form in modal.

Looks like it is missing :
[% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
Comment 1 Fridolin Somers 2024-11-27 10:02:50 UTC
Created attachment 175002 [details] [review]
Bug 38544: OPAC Modal login not generated when OPAC login is disabled

When OPAC login is disabled (system preference opacuserlogin),
the modal login should not exist in HTML.

Note the access to opac-user.pl shows a message and not auth form.

You may look at commit with : git diff --ignore-space-change

Test plan :
1.1) Set system preference opacuserlogin to "Allow"
1.2) Go to OPAC main page
1.3) Check you see in source : div id="loginModal"
1.4) Click on "Log in to your account"
1.5) Check you see the modal login
2.1) Set system preference opacuserlogin to "Don't allow"
2.2) Go to OPAC main page
2.3) Check you do not see in source : div id="loginModal"
Comment 2 David Cook 2024-11-27 22:16:25 UTC
Created attachment 175014 [details] [review]
Bug 38544: OPAC Modal login not generated when OPAC login is disabled

When OPAC login is disabled (system preference opacuserlogin),
the modal login should not exist in HTML.

Note the access to opac-user.pl shows a message and not auth form.

You may look at commit with : git diff --ignore-space-change

Test plan :
1.1) Set system preference opacuserlogin to "Allow"
1.2) Go to OPAC main page
1.3) Check you see in source : div id="loginModal"
1.4) Click on "Log in to your account"
1.5) Check you see the modal login
2.1) Set system preference opacuserlogin to "Don't allow"
2.2) Go to OPAC main page
2.3) Check you do not see in source : div id="loginModal"

Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 3 David Cook 2024-11-27 22:17:39 UTC
While the "Splinter Review" looks scary, if you do a "git show -w", you'll see it really is just a very simple 2-3 line change, which does exactly what it says it's going to do.
Comment 4 David Cook 2024-11-27 22:18:22 UTC
And if I'd actually read the commit message, I would've seen that Frido already suggested something like that haha.
Comment 5 Fridolin Somers 2024-11-29 09:38:46 UTC
(In reply to David Cook from comment #4)
> And if I'd actually read the commit message, I would've seen that Frido
> already suggested something like that haha.

Great it helped ;)
Comment 6 Matt Blenkinsop 2024-12-09 11:15:47 UTC
Created attachment 175295 [details] [review]
Bug 38544: OPAC Modal login not generated when OPAC login is disabled

When OPAC login is disabled (system preference opacuserlogin),
the modal login should not exist in HTML.

Note the access to opac-user.pl shows a message and not auth form.

You may look at commit with : git diff --ignore-space-change

Test plan :
1.1) Set system preference opacuserlogin to "Allow"
1.2) Go to OPAC main page
1.3) Check you see in source : div id="loginModal"
1.4) Click on "Log in to your account"
1.5) Check you see the modal login
2.1) Set system preference opacuserlogin to "Don't allow"
2.2) Go to OPAC main page
2.3) Check you do not see in source : div id="loginModal"

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 7 Katrin Fischer 2024-12-23 08:38:23 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 8 Paul Derscheid 2025-02-03 19:09:30 UTC
Nice work everyone!

Pushed to 24.11.x for 24.11.01
Comment 9 Alex Buckley 2025-03-19 21:21:03 UTC
Hi Fridolin, 

This patchset conflicts when cherry-picked from 24.11.x to 24.05.x

---

kohadev-koha@kohadevbox:koha(24.05.x)$ git cherry-pick 89c88244089bb9ede369d04541f73b91987efb9d
Auto-merging koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc
CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc
error: could not apply 89c88244089... Bug 38544: OPAC Modal login not generated when OPAC login is disabled
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
kohadev-koha@kohadevbox:koha(24.05.x|CHERRY-PICKING)$ git status
On branch 24.05.x
You are currently cherry-picking commit 89c88244089.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc

no changes added to commit (use "git add" and/or "git commit -a")
kohadev-koha@kohadevbox:koha(24.05.x|CHERRY-PICKING)$ 

---

Could we please have a 24.05.x rebased patch attached to this bug report?