Lines 814-819
sub checkauth {
Link Here
|
814 |
C4::Context::set_shelves_userenv( 'tot', $session->param('totshelves') ); |
814 |
C4::Context::set_shelves_userenv( 'tot', $session->param('totshelves') ); |
815 |
$debug and printf STDERR "AUTH_SESSION: (%s)\t%s %s - %s\n", map { $session->param($_) } qw(cardnumber firstname surname branch); |
815 |
$debug and printf STDERR "AUTH_SESSION: (%s)\t%s %s - %s\n", map { $session->param($_) } qw(cardnumber firstname surname branch); |
816 |
$ip = $session->param('ip'); |
816 |
$ip = $session->param('ip'); |
|
|
817 |
|
817 |
$lasttime = $session->param('lasttime'); |
818 |
$lasttime = $session->param('lasttime'); |
818 |
$userid = $s_userid; |
819 |
$userid = $s_userid; |
819 |
$sessiontype = $session->param('sessiontype') || ''; |
820 |
$sessiontype = $session->param('sessiontype') || ''; |
Lines 1614-1620
Possible return values in C<$status> are:
Link Here
|
1614 |
sub check_cookie_auth { |
1615 |
sub check_cookie_auth { |
1615 |
my $cookie = shift; |
1616 |
my $cookie = shift; |
1616 |
my $flagsrequired = shift; |
1617 |
my $flagsrequired = shift; |
|
|
1618 |
my $params = shift; |
1617 |
|
1619 |
|
|
|
1620 |
my $remote_addr = $params->{remote_addr} || $ENV{REMOTE_ADDR}; |
1618 |
my $dbh = C4::Context->dbh; |
1621 |
my $dbh = C4::Context->dbh; |
1619 |
my $timeout = _timeout_syspref(); |
1622 |
my $timeout = _timeout_syspref(); |
1620 |
|
1623 |
|
Lines 1650-1655
sub check_cookie_auth {
Link Here
|
1650 |
my $sessionID = $cookie; |
1653 |
my $sessionID = $cookie; |
1651 |
my $session = get_session($sessionID); |
1654 |
my $session = get_session($sessionID); |
1652 |
C4::Context->_new_userenv($sessionID); |
1655 |
C4::Context->_new_userenv($sessionID); |
|
|
1656 |
|
1653 |
if ($session) { |
1657 |
if ($session) { |
1654 |
C4::Context->set_userenv( |
1658 |
C4::Context->set_userenv( |
1655 |
$session->param('number'), $session->param('id'), |
1659 |
$session->param('number'), $session->param('id'), |
Lines 1660-1665
sub check_cookie_auth {
Link Here
|
1660 |
); |
1664 |
); |
1661 |
|
1665 |
|
1662 |
my $ip = $session->param('ip'); |
1666 |
my $ip = $session->param('ip'); |
|
|
1667 |
|
1663 |
my $lasttime = $session->param('lasttime'); |
1668 |
my $lasttime = $session->param('lasttime'); |
1664 |
my $userid = $session->param('id'); |
1669 |
my $userid = $session->param('id'); |
1665 |
if ( $lasttime < time() - $timeout ) { |
1670 |
if ( $lasttime < time() - $timeout ) { |
Lines 1671-1677
sub check_cookie_auth {
Link Here
|
1671 |
$userid = undef; |
1676 |
$userid = undef; |
1672 |
$sessionID = undef; |
1677 |
$sessionID = undef; |
1673 |
return ("expired", undef); |
1678 |
return ("expired", undef); |
1674 |
} elsif ( C4::Context->preference('SessionRestrictionByIP') && $ip ne $ENV{'REMOTE_ADDR'} ) { |
1679 |
} elsif ( C4::Context->preference('SessionRestrictionByIP') && $ip ne $remote_addr ) { |
1675 |
|
1680 |
|
1676 |
# IP address changed |
1681 |
# IP address changed |
1677 |
$session->delete(); |
1682 |
$session->delete(); |