Bug 14776 - SCO/shelfcheck 'log out' option redirects to OPAC, not back to SCO
Summary: SCO/shelfcheck 'log out' option redirects to OPAC, not back to SCO
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Self checkout (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Marc Véron
QA Contact: Testopia
URL:
Keywords:
Depends on: 15039
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-03 12:21 UTC by Mason James
Modified: 2016-06-21 21:39 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
pic (114.08 KB, image/png)
2015-09-03 12:21 UTC, Mason James
Details
Bug 14776 - Remove 'selfcheck' patron related links from and add language selector to SCO header (7.36 KB, patch)
2015-09-06 17:09 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14776 - Remove 'selfcheck' patron related links from and add language selector to SCO header (3.10 KB, patch)
2015-10-20 16:59 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14776 - Remove 'selfcheck' patron related links from and add language selector to SCO header (3.17 KB, patch)
2015-10-23 08:06 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mason James 2015-09-03 12:21:15 UTC
Created attachment 42311 [details]
pic

SCO 'log out' option redirects to OPAC, not back to SCO

pic attached
Comment 1 Mason James 2015-09-03 12:29:26 UTC
3 urls redirect to the OPAC, in...
  koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead-sco.inc

thus, it is possible for a user to accidentally 'log out' of the SCO completely,  requiring staff to fix the SCO
Comment 2 Marc Véron 2015-09-06 15:27:12 UTC
Additionally, there is a link to the "selfcheck" user's account ("Welcome, selfcheck"), as defined in syspref AutoSelfCheckID. It makes no sense that the user can access this information.
Comment 3 Marc Véron 2015-09-06 16:47:37 UTC
...and the language menu is missing if syspref OpacLangSelectorMode is set to 'top' or to 'both'
Comment 4 Marc Véron 2015-09-06 17:09:03 UTC Comment hidden (obsolete)
Comment 5 Chris Kirby 2015-10-14 00:44:02 UTC
Tested on sandboxes as follows:
- Set OpacLangSelectorMode to  'both'
- Went to SCO page
- Verified that the language menu did not display in the header
- Entered a card number to check out (this logs in the SCO user)
- Verified that you get text similar to "Welcome, checkout" with a link to the sco user's account in the OPAC and a 'Logout' link
- Requested that that patch be applied to a separate sandbox
- Verified that the language menu appears and the SCO user's information disappears.
Comment 6 Jonathan Druart 2015-10-19 10:52:48 UTC
Marc,
It looks like this code comes from includes/masthead.inc and/or includes/opac-bottom.inc.
Could you confirm (I have not compared the diff line by line)?
In this case, it's certainly the good time to refactor it :)
Comment 7 Marc Véron 2015-10-19 20:06:43 UTC
Jonathan,

Good idea. Are you thinking about an extra include for the language menue that would be inserted into koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc and koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead-sco.inc ?
Comment 8 Marc Véron 2015-10-20 16:59:42 UTC Comment hidden (obsolete)
Comment 9 Chris Kirby 2015-10-22 15:41:02 UTC
Hi Marc,
I am testing here on Sandbox 8, and here is what I am finding:

testing with AutoSelfCheckAllowed DISABLED:
when one visits /cgi-bin/koha/sco/sco-main.pl there is an option to login. 
However, once logged in, you are redirected to  /cgi-bin/koha/opac-user.pl
If one has already logged into Koha with staff credentials, and then visits /cgi-bin/koha/sco/sco-main.pl, the patch is successful.

testing with AutoSelfCheckAllowed ENABLED:
Your patch works when the AutoSelfCheckAllowed preference is enabled and login credentials have been stored.
Comment 10 Marc Véron 2015-10-22 20:00:22 UTC
Hi Chris,

Thanks for testing.

Questions:

- How is the behaviour without patch? It seems to me that it behaves the same (redirect to a login page).

- What would you expect to happen if AutoSelfCheckAllowed is DISABLED?

- Maybe your finding is something for a separate bug?
Comment 11 Chris Kirby 2015-10-23 01:56:56 UTC
Hi Marc,
>How is the behaviour without patch? It seems to me that it behaves the same (redirect to a login page).
Without the patch, the behavior is the same.

>What would you expect to happen if AutoSelfCheckAllowed is DISABLED?
I was expect to have a login page for the selfcheck and then the SCO user's information is hidden, just as your patch achieves.

>Maybe your finding is something for a separate bug?
Yes, this might make sense if there is a desire to use the selfcheck when AutoSelfCheckAllowed  is DISABLED.

Signed off on patch:

Applied on top of Bug 15039
- Set AutoSelfCheckAllowed to ENABLED, and provided values for AutoSelfCheckID, AutoSelfCheckPass
- Set OpacLangSelectorMode to 'top' or 'both'
- Went to SCO page
- Verified that the language menu does not display in the header
- Entered a card number to check out (this logs in the SCO user)
- Verified that you get text similar to "Welcome, checkout" with a link to the sco user's account in the OPAC and a 'Logout' link
- Applied patch for 14776
- Verified that the language menu appears and the SCO user's information disappears.
- Verified, that the language menu displays / does not display with combinations of:
  - opaclanguagedisplay (Allow)
  - opaclanguages ( > 1 language selected)
  - OpacLangSelectorMode (top or both)
Comment 12 Marc Véron 2015-10-23 07:23:40 UTC
Hi Chris,

Thanks for your comments. 
I propose that you file a new bug that describes the behaviour you would like to see when AutoSelfCheckAllowed is DISABLED.

Regarding your sign-off: Did you just switch the status? Ot did you forget to attach the patch with your sign-off? It seems that the patch itself did not change.
See
http://wiki.koha-community.org/wiki/Sign_off_on_patches
and
http://wiki.koha-community.org/wiki/Git_bz_configuration
(I use the git bz method).
Comment 13 Jonathan Druart 2015-10-23 08:06:46 UTC
Created attachment 43804 [details] [review]
Bug 14776 - Remove 'selfcheck' patron related links from and add language selector to SCO header

The SCO screen displays patron related menu items in it's header (Link to the account and "Logout").
This makes no sense since the patron that is logged in is the 'selfcheck' user as defined in syspref AutoSelfCheckId.
Additionally, the language menue is missing when the syspref OpacLangSelectorMode is set to 'top' or to 'both'.

To test:
- Apply on top of Bug 15039
- Set AutoSelfCheck sysprefs as appropriate
- Set OpacLangSelectorMode to 'top' or 'both'
- Go to SCO page
- Verify that the language menue does not display in the header
- Enter a card number to check out (this logs in the SCO user)
- Verify that you get text similar to "Welcome, checkout" with a link to the sco user's account in the OPAC and a 'Logout' link
- Apply patch
- Verify that the language menu appears and the SCO user's information disappears.
- Verify, that the language menu displays / does not display with combinations of:
  - opaclanguagedisplay (Allow)
  - opaclanguages ( > 1 language selected)
  - OpacLangSelectorMode (top or both)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 14 Tomás Cohen Arazi 2015-10-23 13:53:13 UTC
Patches pushed to master.

Thanks Jonathan and Marc!
Comment 15 Tomás Cohen Arazi 2015-10-23 13:53:47 UTC
Sorry Johathan, no credit for you on this one :-P