From 7aac30428f3ae24f384bad316650e26b32dc5fed Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 27 Mar 2018 13:37:35 -0300 Subject: [PATCH] Bug 20479: Ease readability - do not enter the block if not logged in Signed-off-by: Jonathan Druart --- C4/Auth.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 3f1c9dd2c5..13c4652d2e 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -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(