|
Lines 1351-1367
sub checkauth {
Link Here
|
| 1351 |
$session->param( 'register_name', $register_name ); |
1351 |
$session->param( 'register_name', $register_name ); |
| 1352 |
$session->param( 'sco_user', $is_sco_user ); |
1352 |
$session->param( 'sco_user', $is_sco_user ); |
| 1353 |
} |
1353 |
} |
| 1354 |
$session->param( 'cas_ticket', $cas_ticket ) if $cas_ticket; |
1354 |
$session->param('cas_ticket', $cas_ticket) if $cas_ticket; |
| 1355 |
C4::Context->set_userenv( |
1355 |
C4::Context->set_userenv_from_session($session); |
| 1356 |
$session->param('number'), $session->param('id'), |
|
|
| 1357 |
$session->param('cardnumber'), $session->param('firstname'), |
| 1358 |
$session->param('surname'), $session->param('branch'), |
| 1359 |
$session->param('branchname'), $session->param('flags'), |
| 1360 |
$session->param('emailaddress'), $session->param('shibboleth'), |
| 1361 |
$session->param('desk_id'), $session->param('desk_name'), |
| 1362 |
$session->param('register_id'), $session->param('register_name') |
| 1363 |
); |
| 1364 |
|
| 1365 |
} |
1356 |
} |
| 1366 |
|
1357 |
|
| 1367 |
# $return: 0 = invalid user |
1358 |
# $return: 0 = invalid user |
|
Lines 1829-1844
sub check_api_auth {
Link Here
|
| 1829 |
$session->param( 'lasttime', time() ); |
1820 |
$session->param( 'lasttime', time() ); |
| 1830 |
$session->param( 'interface', 'api' ); |
1821 |
$session->param( 'interface', 'api' ); |
| 1831 |
} |
1822 |
} |
| 1832 |
$session->param( 'cas_ticket', $cas_ticket ); |
1823 |
$session->param( 'cas_ticket', $cas_ticket); |
| 1833 |
C4::Context->set_userenv( |
1824 |
C4::Context->set_userenv_from_session($session); |
| 1834 |
$session->param('number'), $session->param('id'), |
|
|
| 1835 |
$session->param('cardnumber'), $session->param('firstname'), |
| 1836 |
$session->param('surname'), $session->param('branch'), |
| 1837 |
$session->param('branchname'), $session->param('flags'), |
| 1838 |
$session->param('emailaddress'), $session->param('shibboleth'), |
| 1839 |
$session->param('desk_id'), $session->param('desk_name'), |
| 1840 |
$session->param('register_id'), $session->param('register_name') |
| 1841 |
); |
| 1842 |
return ( "ok", $cookie, $sessionID ); |
1825 |
return ( "ok", $cookie, $sessionID ); |
| 1843 |
} else { |
1826 |
} else { |
| 1844 |
return ( "failed", undef, undef ); |
1827 |
return ( "failed", undef, undef ); |
|
Lines 1958-1972
sub check_cookie_auth {
Link Here
|
| 1958 |
# No need to override the interface, most often set by get_template_and_user |
1941 |
# No need to override the interface, most often set by get_template_and_user |
| 1959 |
C4::Context->interface( $session->param('interface') ); |
1942 |
C4::Context->interface( $session->param('interface') ); |
| 1960 |
} |
1943 |
} |
| 1961 |
C4::Context->set_userenv( |
1944 |
|
| 1962 |
$session->param('number'), $session->param('id') // '', |
1945 |
C4::Context->set_userenv_from_session($session); |
| 1963 |
$session->param('cardnumber'), $session->param('firstname'), |
|
|
| 1964 |
$session->param('surname'), $session->param('branch'), |
| 1965 |
$session->param('branchname'), $session->param('flags'), |
| 1966 |
$session->param('emailaddress'), $session->param('shibboleth'), |
| 1967 |
$session->param('desk_id'), $session->param('desk_name'), |
| 1968 |
$session->param('register_id'), $session->param('register_name') |
| 1969 |
); |
| 1970 |
if ( C4::Context->preference('TwoFactorAuthentication') ne 'disabled' ) { |
1946 |
if ( C4::Context->preference('TwoFactorAuthentication') ne 'disabled' ) { |
| 1971 |
return ( "additional-auth-needed", $session ) |
1947 |
return ( "additional-auth-needed", $session ) |
| 1972 |
if $session->param('waiting-for-2FA'); |
1948 |
if $session->param('waiting-for-2FA'); |
| 1973 |
- |
|
|