Bug 20480 - Fix styling issues on bad SCI/SCO module logins
Summary: Fix styling issues on bad SCI/SCO module logins
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Authentication (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on: 12904 15492
Blocks:
  Show dependency treegraph
 
Reported: 2018-03-27 14:44 UTC by Tomás Cohen Arazi
Modified: 2018-06-04 20:14 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 20480: Make KOHA_VERSION available to all templates in all circumstances (3.99 KB, patch)
2018-03-27 15:01 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 20480: send KOHA_VERSION even if only one language is enabled (878 bytes, patch)
2018-03-27 16:27 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 20480: send KOHA_VERSION even if only one language is enabled (948 bytes, patch)
2018-03-27 16:31 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20480: Make KOHA_VERSION available to all templates in all circumstances (4.06 KB, patch)
2018-03-27 16:32 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20480: send KOHA_VERSION even if only one language is enabled (1004 bytes, patch)
2018-03-27 16:32 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2018-03-27 14:44:09 UTC
When one of this modules is tried, with either wrong credentials or a user without access, the Auth.pm code short-circuits to the login page, but the KOHA_VERSION template param is never set.
Comment 1 Tomás Cohen Arazi 2018-03-27 15:01:31 UTC
Created attachment 73319 [details] [review]
Bug 20480: Make KOHA_VERSION available to all templates in all circumstances

This patch makes C4::Templates::gettemplate set the KOHA_VERSION param
for the template. This way this template parameter, which is required by
(probably) all pages that include CSS/JS content is available in all
circumstances.

A noticeable problem with the current approach is when using the SCO and
SCI modules with wrong/forbidden users: C4::Auth short-circuits and
redirects to the login page, without setting the KOHA_VERSION param.
This patch solves it for good.

To test:
- Enable the SCI module
- Open the browser at
  http://localhost:8080/cgi-bin/koha/sci/sci-main.pl
- Login with the db user (koha_kohadev / password)
=> FAIL: Login failure, but styling is broken
- Apply this patch
- Retry
=> SUCCESS: Everything looks as it should!
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Jonathan Druart 2018-03-27 16:27:43 UTC
Created attachment 73330 [details] [review]
Bug 20480: send KOHA_VERSION even if only one language is enabled
Comment 3 Kyle M Hall 2018-03-27 16:31:06 UTC
Created attachment 73332 [details] [review]
Bug 20480: send KOHA_VERSION even if only one language is enabled

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 4 Kyle M Hall 2018-03-27 16:32:14 UTC
Created attachment 73333 [details] [review]
Bug 20480: Make KOHA_VERSION available to all templates in all circumstances

This patch makes C4::Templates::gettemplate set the KOHA_VERSION param
for the template. This way this template parameter, which is required by
(probably) all pages that include CSS/JS content is available in all
circumstances.

A noticeable problem with the current approach is when using the SCO and
SCI modules with wrong/forbidden users: C4::Auth short-circuits and
redirects to the login page, without setting the KOHA_VERSION param.
This patch solves it for good.

To test:
- Enable the SCI module
- Open the browser at
  http://localhost:8080/cgi-bin/koha/sci/sci-main.pl
- Login with the db user (koha_kohadev / password)
=> FAIL: Login failure, but styling is broken
- Apply this patch
- Retry
=> SUCCESS: Everything looks as it should!
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Kyle M Hall 2018-03-27 16:32:22 UTC
Created attachment 73334 [details] [review]
Bug 20480: send KOHA_VERSION even if only one language is enabled

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Jonathan Druart 2018-03-27 16:45:08 UTC
Pushed to master for 18.05