Lines 193-206
sub get_template_and_user {
Link Here
|
193 |
} |
193 |
} |
194 |
|
194 |
|
195 |
if ( $in->{type} eq 'opac' && $user ) { |
195 |
if ( $in->{type} eq 'opac' && $user ) { |
|
|
196 |
my $is_sco_user; |
197 |
if ($sessionID){ |
198 |
my $session = get_session($sessionID); |
199 |
if ($session){ |
200 |
$is_sco_user = $session->param('sco_user'); |
201 |
} |
202 |
} |
196 |
my $kick_out; |
203 |
my $kick_out; |
197 |
|
204 |
|
198 |
if ( |
205 |
if ( |
199 |
# If the user logged in is the SCO user and they try to go out of the SCO module, |
206 |
# If the user logged in is the SCO user and they try to go out of the SCO module, |
200 |
# log the user out removing the CGISESSID cookie |
207 |
# log the user out removing the CGISESSID cookie |
201 |
$in->{template_name} !~ m|sco/| && $in->{template_name} !~ m|errors/errorpage.tt| |
208 |
$in->{template_name} !~ m|sco/| && $in->{template_name} !~ m|errors/errorpage.tt| |
202 |
&& C4::Context->preference('AutoSelfCheckID') |
209 |
&& ( |
203 |
&& $user eq C4::Context->preference('AutoSelfCheckID') |
210 |
$is_sco_user || |
|
|
211 |
( |
212 |
C4::Context->preference('AutoSelfCheckID') |
213 |
&& $user eq C4::Context->preference('AutoSelfCheckID') |
214 |
) |
215 |
) |
204 |
) |
216 |
) |
205 |
{ |
217 |
{ |
206 |
$kick_out = 1; |
218 |
$kick_out = 1; |
Lines 1112-1118
sub checkauth {
Link Here
|
1112 |
C4::Context->_unset_userenv($sessionID); |
1124 |
C4::Context->_unset_userenv($sessionID); |
1113 |
} |
1125 |
} |
1114 |
my ( $borrowernumber, $firstname, $surname, $userflags, |
1126 |
my ( $borrowernumber, $firstname, $surname, $userflags, |
1115 |
$branchcode, $branchname, $branchprinter, $emailaddress ); |
1127 |
$branchcode, $branchname, $branchprinter, $emailaddress, $register_id, $register_name ); |
1116 |
|
1128 |
|
1117 |
if ( $return == 1 ) { |
1129 |
if ( $return == 1 ) { |
1118 |
my $select = " |
1130 |
my $select = " |
Lines 1188-1193
sub checkauth {
Link Here
|
1188 |
$branchname = $branches->{$br}->{'branchname'}; |
1200 |
$branchname = $branches->{$br}->{'branchname'}; |
1189 |
} |
1201 |
} |
1190 |
} |
1202 |
} |
|
|
1203 |
|
1204 |
my $is_sco_user = 0; |
1205 |
if ( $query->param('sco_user_login') && ( $query->param('sco_user_login') eq '1' ) ){ |
1206 |
$is_sco_user = 1; |
1207 |
} |
1208 |
|
1191 |
$session->param( 'number', $borrowernumber ); |
1209 |
$session->param( 'number', $borrowernumber ); |
1192 |
$session->param( 'id', $userid ); |
1210 |
$session->param( 'id', $userid ); |
1193 |
$session->param( 'cardnumber', $cardnumber ); |
1211 |
$session->param( 'cardnumber', $cardnumber ); |
Lines 1201-1207
sub checkauth {
Link Here
|
1201 |
$session->param( 'lasttime', time() ); |
1219 |
$session->param( 'lasttime', time() ); |
1202 |
$session->param( 'interface', $type); |
1220 |
$session->param( 'interface', $type); |
1203 |
$session->param( 'shibboleth', $shibSuccess ); |
1221 |
$session->param( 'shibboleth', $shibSuccess ); |
1204 |
$debug and printf STDERR "AUTH_4: (%s)\t%s %s - %s\n", map { $session->param($_) } qw(cardnumber firstname surname branch); |
1222 |
$session->param( 'register_id', $register_id ); |
|
|
1223 |
$session->param( 'register_name', $register_name ); |
1224 |
$session->param( 'sco_user', $is_sco_user ); |
1205 |
} |
1225 |
} |
1206 |
$session->param('cas_ticket', $cas_ticket) if $cas_ticket; |
1226 |
$session->param('cas_ticket', $cas_ticket) if $cas_ticket; |
1207 |
C4::Context->set_userenv( |
1227 |
C4::Context->set_userenv( |
1208 |
- |
|
|