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

(-)a/C4/Auth.pm (-3 / +15 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
            && $is_sco_user
206
            && $user eq C4::Context->preference('AutoSelfCheckID')
207
          )
213
          )
208
        {
214
        {
209
            $kick_out = 1;
215
            $kick_out = 1;
Lines 1204-1209 sub checkauth { Link Here
1204
                            $branchname    = $branches->{$br}->{'branchname'};
1210
                            $branchname    = $branches->{$br}->{'branchname'};
1205
                        }
1211
                        }
1206
                    }
1212
                    }
1213
1214
                    my $is_sco_user = 0;
1215
                    if ( $query->param('sco_user_login') && ( $query->param('sco_user_login') eq '1' ) ){
1216
                        $is_sco_user = 1;
1217
                    }
1218
1207
                    $session->param( 'number',       $borrowernumber );
1219
                    $session->param( 'number',       $borrowernumber );
1208
                    $session->param( 'id',           $userid );
1220
                    $session->param( 'id',           $userid );
1209
                    $session->param( 'cardnumber',   $cardnumber );
1221
                    $session->param( 'cardnumber',   $cardnumber );
Lines 1221-1226 sub checkauth { Link Here
1221
                    $session->param( 'shibboleth',   $shibSuccess );
1233
                    $session->param( 'shibboleth',   $shibSuccess );
1222
                    $session->param( 'register_id',  $register_id );
1234
                    $session->param( 'register_id',  $register_id );
1223
                    $session->param( 'register_name',  $register_name );
1235
                    $session->param( 'register_name',  $register_name );
1236
                    $session->param( 'sco_user', $is_sco_user );
1224
                }
1237
                }
1225
                $session->param('cas_ticket', $cas_ticket) if $cas_ticket;
1238
                $session->param('cas_ticket', $cas_ticket) if $cas_ticket;
1226
                C4::Context->set_userenv(
1239
                C4::Context->set_userenv(
1227
- 

Return to bug 28735