Bug 28955: Add OPAC_BRANCH_DEFAULT
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 27 Oct 2021 10:27:18 +0000 (11:27 +0100)
committerArthur Suzuki <arthur.suzuki@biblibre.com>
Mon, 20 Jun 2022 14:33:37 +0000 (16:33 +0200)
commitc7491a6fe6f4d41d20e19739fe94b0a3e3c95ce8
tree28280e0d2c9552a29a92454fbbad3e699d10b0ec
parent128673401c93b80c418f92fee17e225ede1cd454
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: Arthur Suzuki <arthur.suzuki@biblibre.com>
C4/Auth.pm
Koha/Middleware/SetEnv.pm