View | Details | Raw Unified | Return to bug 28735
Collapse All | Expand All

(-)a/C4/Auth.pm (-3 / +21 lines)
Lines 196-209 sub get_template_and_user { Link Here
196
    }
196
    }
197
197
198
    if ( $in->{type} eq 'opac' && $user ) {
198
    if ( $in->{type} eq 'opac' && $user ) {
199
        my $is_sco_user;
200
        if ($sessionID){
201
            my $session = get_session($sessionID);
202
            if ($session){
203
                $is_sco_user = $session->param('sco_user');
204
            }
205
        }
199
        my $kick_out;
206
        my $kick_out;
200
207
201
        if (
208
        if (
202
# If the user logged in is the SCO user and they try to go out of the SCO module,
209
# If the user logged in is the SCO user and they try to go out of the SCO module,
203
# log the user out removing the CGISESSID cookie
210
# log the user out removing the CGISESSID cookie
204
            $in->{template_name} !~ m|sco/| && $in->{template_name} !~ m|errors/errorpage.tt|
211
            $in->{template_name} !~ m|sco/| && $in->{template_name} !~ m|errors/errorpage.tt|
205
            && C4::Context->preference('AutoSelfCheckID')
212
            && (
206
            && $user eq C4::Context->preference('AutoSelfCheckID')
213
                $is_sco_user ||
214
                (
215
                    C4::Context->preference('AutoSelfCheckID')
216
                    && $user eq C4::Context->preference('AutoSelfCheckID')
217
                )
218
            )
207
          )
219
          )
208
        {
220
        {
209
            $kick_out = 1;
221
            $kick_out = 1;
Lines 1200-1205 sub checkauth { Link Here
1200
                            $branchname    = $branches->{$br}->{'branchname'};
1212
                            $branchname    = $branches->{$br}->{'branchname'};
1201
                        }
1213
                        }
1202
                    }
1214
                    }
1215
1216
                    my $is_sco_user = 0;
1217
                    if ( $query->param('sco_user_login') && ( $query->param('sco_user_login') eq '1' ) ){
1218
                        $is_sco_user = 1;
1219
                    }
1220
1203
                    $session->param( 'number',       $borrowernumber );
1221
                    $session->param( 'number',       $borrowernumber );
1204
                    $session->param( 'id',           $userid );
1222
                    $session->param( 'id',           $userid );
1205
                    $session->param( 'cardnumber',   $cardnumber );
1223
                    $session->param( 'cardnumber',   $cardnumber );
Lines 1217-1222 sub checkauth { Link Here
1217
                    $session->param( 'shibboleth',   $shibSuccess );
1235
                    $session->param( 'shibboleth',   $shibSuccess );
1218
                    $session->param( 'register_id',  $register_id );
1236
                    $session->param( 'register_id',  $register_id );
1219
                    $session->param( 'register_name',  $register_name );
1237
                    $session->param( 'register_name',  $register_name );
1238
                    $session->param( 'sco_user', $is_sco_user );
1220
                }
1239
                }
1221
                $session->param('cas_ticket', $cas_ticket) if $cas_ticket;
1240
                $session->param('cas_ticket', $cas_ticket) if $cas_ticket;
1222
                C4::Context->set_userenv(
1241
                C4::Context->set_userenv(
1223
- 

Return to bug 28735