Bug 28955: Add OPAC_BRANCH_DEFAULT
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 27 Oct 2021 10:27:18 +0000 (11:27 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 25 Feb 2022 00:35:36 +0000 (14:35 -1000)
commite940c8ab02e9f6f759c31c70ca3076c9ad2376d1
tree65612ef6fd0d7c44d761c993f8d9a39846a5dd22
parent2a698d15cdbf831d55ca6193c12c524a12ef3d07
Bug 28955: Add OPAC_BRANCH_DEFAULT

This patch adds support for OPAC_BRANCH_DEFAULT as an environment option
that can be passed via apache with either SetEnv or as a header for
plack.  It allows setting a default branch for the anonymous opac
session such that you can display the right opac content blocks prior to
login if you have set up per branch URI's.

To test (on top of bug 29691)
1 - Add to apache conf (/etc/apache2/sites-available/kohadev.conf)
    SetEnv OPAC_BRANCH_DEFAULT "CPL"
    RequestHeader add X-Koha-SetEnv "OPAC_BRANCH_DEFAULT CPL"
2 - Restart all
3 - Confirm that news for all and CPL show on opac mainpage
4 - Sign in as a different library
5 - Confirm users library news shows

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
C4/Auth.pm
Koha/Middleware/SetEnv.pm