]> git.koha-community.org Git - koha.git/commit
Bug 24663: Test OpacPublic for all OPAC scripts
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 17 Feb 2020 12:16:48 +0000 (13:16 +0100)
committerLucas Gass <lucas@bywatersolutions.com>
Mon, 31 Aug 2020 20:02:15 +0000 (20:02 +0000)
commit2d7c75ad5666b60f7de1e914a69754429e739203
treeeb91e4f5d83ea80c98c9b645ed6f72f8ba477b85
parent86d74d4769cbcb41fa27a62ed16fe886410be90d
Bug 24663: Test OpacPublic for all OPAC scripts

Prior to this patchset there were 3 different calls to
get_template_and_user (or checkauth) with the authnotrequired param:
 * authnotrequired => 0
 * authnotrequired => 1
 * authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 )

The first one says that an unauthenticated user can access the page, the
second that the user has to be authenticated, and the last one that it
depends on the OpacPublic syspref.
Actually we must replace the first one with the third one, if the OPAC
is not public, the authentication must be forced.

To do so we are going to remove the "authnotrequired => 0" occurrences,
and check the OpacPublic syspref's value in C4::Auth

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 1b095d1d80e5d4026a68e8df72ccd9918aff3dee)
C4/Auth.pm