Lines 1700-1716
sub check_cookie_auth {
Link Here
|
1700 |
$session->flush; |
1700 |
$session->flush; |
1701 |
C4::Context->_unset_userenv($sessionID); |
1701 |
C4::Context->_unset_userenv($sessionID); |
1702 |
return ( "restricted", undef, { old_ip => $ip, new_ip => $remote_addr}); |
1702 |
return ( "restricted", undef, { old_ip => $ip, new_ip => $remote_addr}); |
1703 |
} else { |
1703 |
} elsif ( $session->param("id") eq $userid ) { |
1704 |
$session->param( 'lasttime', time() ); |
1704 |
$session->param( 'lasttime', time() ); |
1705 |
my $flags = defined($flagsrequired) ? haspermission( $userid, $flagsrequired ) : 1; |
1705 |
my $flags = defined($flagsrequired) ? haspermission( $userid, $flagsrequired ) : 1; |
1706 |
if ($flags) { |
1706 |
if ($flags) { |
1707 |
return ( "ok", $session ); |
1707 |
return ( "ok", $session ); |
1708 |
} else { |
|
|
1709 |
$session->delete(); |
1710 |
$session->flush; |
1711 |
C4::Context->_unset_userenv($sessionID); |
1712 |
return ( "failed", undef ); |
1713 |
} |
1708 |
} |
|
|
1709 |
$session->delete(); |
1710 |
$session->flush; |
1711 |
C4::Context->_unset_userenv($sessionID); |
1712 |
return ( "failed", undef ); |
1714 |
} |
1713 |
} |
1715 |
} else { |
1714 |
} else { |
1716 |
return ( "expired", undef ); |
1715 |
return ( "expired", undef ); |
1717 |
- |
|
|