]> 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)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 3 Sep 2020 08:40:35 +0000 (10:40 +0200)
commit4b9475346e8c3d76923b1ef770af2db5d80ef438
tree3de19a292ee43f70e1c0020471fae45295746ae4
parentdb55279886c7ecd13987780b6922d29e8916b267
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: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Auth.pm