|
Lines 47-52
use Encode;
Link Here
|
| 47 |
use C4::Auth_with_shibboleth qw( shib_ok get_login_shib login_shib_url logout_shib checkpw_shib ); |
47 |
use C4::Auth_with_shibboleth qw( shib_ok get_login_shib login_shib_url logout_shib checkpw_shib ); |
| 48 |
use Net::CIDR; |
48 |
use Net::CIDR; |
| 49 |
use C4::Log qw( logaction ); |
49 |
use C4::Log qw( logaction ); |
|
|
50 |
use Koha::CookieManager; |
| 50 |
|
51 |
|
| 51 |
# use utf8; |
52 |
# use utf8; |
| 52 |
|
53 |
|
|
Lines 805-819
sub _timeout_syspref {
Link Here
|
| 805 |
return $timeout; |
806 |
return $timeout; |
| 806 |
} |
807 |
} |
| 807 |
|
808 |
|
| 808 |
sub clear_all_cookies { |
|
|
| 809 |
my ( $query ) = shift; |
| 810 |
my @cookies; |
| 811 |
for my $cookie_name ( $query->cookie ) { |
| 812 |
push @cookies, $query->cookie( -name => $cookie_name, -value => '', -expires => '', -HttpOnly => 1 ); |
| 813 |
} |
| 814 |
return \@cookies; |
| 815 |
} |
| 816 |
|
| 817 |
sub checkauth { |
809 |
sub checkauth { |
| 818 |
my $query = shift; |
810 |
my $query = shift; |
| 819 |
|
811 |
|
|
Lines 844-849
sub checkauth {
Link Here
|
| 844 |
my $dbh = C4::Context->dbh; |
836 |
my $dbh = C4::Context->dbh; |
| 845 |
my $timeout = _timeout_syspref(); |
837 |
my $timeout = _timeout_syspref(); |
| 846 |
|
838 |
|
|
|
839 |
my $cookie_mgr = Koha::CookieManager->new; |
| 840 |
|
| 847 |
_version_check( $type, $query ); |
841 |
_version_check( $type, $query ); |
| 848 |
|
842 |
|
| 849 |
# state variables |
843 |
# state variables |
|
Lines 917-923
sub checkauth {
Link Here
|
| 917 |
my $shibSuccess = C4::Context->userenv->{'shibboleth'}; |
911 |
my $shibSuccess = C4::Context->userenv->{'shibboleth'}; |
| 918 |
$session->delete(); |
912 |
$session->delete(); |
| 919 |
$session->flush; |
913 |
$session->flush; |
| 920 |
$cookie = clear_all_cookies($query); |
914 |
$cookie = $cookie_mgr->clear_if_allowed( $query->cookie, @$cookie ); |
| 921 |
C4::Context->_unset_userenv($sessionID); |
915 |
C4::Context->_unset_userenv($sessionID); |
| 922 |
|
916 |
|
| 923 |
if ($cas and $caslogout) { |
917 |
if ($cas and $caslogout) { |
| 924 |
- |
|
|