Bug 20479: Ease readability - do not enter the block if not logged in

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2018-03-27 13:37:35 -03:00
parent 24f25369a5
commit 7aac30428f

View file

@ -179,14 +179,13 @@ sub get_template_and_user {
);
}
if ( $in->{type} eq 'opac' ) {
if ( $in->{type} eq 'opac' && $user ) {
my $kick_out;
if (
# If the user logged in is the SCO user and they try to go out of the SCO module,
# log the user out removing the CGISESSID cookie
$in->{template_name} !~ m|sco/|
&& $user
&& C4::Context->preference('AutoSelfCheckID')
&& $user eq C4::Context->preference('AutoSelfCheckID')
)
@ -198,7 +197,6 @@ sub get_template_and_user {
# kick them out unless it is SCO with a valid permission
# or they are a superlibrarian
$in->{template_name} !~ m|sci/|
&& $user
&& haspermission( $user, { self_check => 'self_checkin_module' } )
&& !(
$in->{template_name} =~ m|sco/| && haspermission(