Bug 38731

Summary: OPAC should not prevent AutoSelfCheckID's user from connecting if AutoSelfCheckAllowed is not active
Product: Koha Reporter: Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski>
Component: Self checkoutAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Baptiste Wojtkowski (bwoj) 2024-12-17 14:19:09 UTC
I'm not totally sure this should be done since in https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26435 it appears to be known, but I don't think that user filled in AutoSelfCheckID should be considered as "The sco user" as long as AutoSelfCheckAllowed.

There might be other places, but for example, if the username in AutoSelfCheckID fits an account while AutoSelfCheckAllowed is not active, the user will be prevented from login since AutoSelfCheckAllowed is not checked in C4/Auth.pm.

cf: 
 229         my $is_sco_user;
 230         if ($session){
 231             $is_sco_user = $session->param('sco_user');
 232         }
 233         my $kick_out;
 234 
 235         if (
 236 # If the user logged in is the SCO user and they try to go out of the SCO module,
 237 # log the user out removing the CGISESSID cookie
 238             $in->{template_name} !~ m|sco/| && $in->{template_name} !~ m|errors/errorpage.tt|
 239             && (
 240                 $is_sco_user ||
 241                 (
 242                     C4::Context->preference('AutoSelfCheckID')
 243                     && $user eq C4::Context->preference('AutoSelfCheckID')
 244                 )
 245             )
 246           )
 247         {
 248             $kick_out = 1;
 249         }