Lines 25-32
use WebService::ILS::OverDrive::Patron;
Link Here
|
25 |
use C4::Context; |
25 |
use C4::Context; |
26 |
use Koha::Logger; |
26 |
use Koha::Logger; |
27 |
|
27 |
|
28 |
use constant logger => Koha::Logger->get(); |
|
|
29 |
|
30 |
=head1 NAME |
28 |
=head1 NAME |
31 |
|
29 |
|
32 |
Koha::ExternalContent::OverDrive |
30 |
Koha::ExternalContent::OverDrive |
Lines 71-76
sub new {
Link Here
|
71 |
user_agent_params => { agent => $class->agent_string } |
69 |
user_agent_params => { agent => $class->agent_string } |
72 |
) ); |
70 |
) ); |
73 |
} |
71 |
} |
|
|
72 |
|
73 |
$self->{logger} = Koha::Logger->get(); |
74 |
|
74 |
return $self; |
75 |
return $self; |
75 |
} |
76 |
} |
76 |
|
77 |
|
Lines 180-192
use constant RETURN_PAGE_SESSION_KEY => "overdrive.return_page";
Link Here
|
180 |
sub get_return_page_from_koha_session { |
181 |
sub get_return_page_from_koha_session { |
181 |
my $self = shift; |
182 |
my $self = shift; |
182 |
my $return_page = $self->get_from_koha_session(RETURN_PAGE_SESSION_KEY) || ""; |
183 |
my $return_page = $self->get_from_koha_session(RETURN_PAGE_SESSION_KEY) || ""; |
183 |
$self->logger->debug("get_return_page_from_koha_session: $return_page"); |
184 |
$self->{logger}->debug("get_return_page_from_koha_session: $return_page"); |
184 |
return $return_page; |
185 |
return $return_page; |
185 |
} |
186 |
} |
186 |
sub set_return_page_in_koha_session { |
187 |
sub set_return_page_in_koha_session { |
187 |
my $self = shift; |
188 |
my $self = shift; |
188 |
my $return_page = shift || ""; |
189 |
my $return_page = shift || ""; |
189 |
$self->logger->debug("set_return_page_in_koha_session: $return_page"); |
190 |
$self->{logger}->debug("set_return_page_in_koha_session: $return_page"); |
190 |
return $self->set_in_koha_session( RETURN_PAGE_SESSION_KEY, $return_page ); |
191 |
return $self->set_in_koha_session( RETURN_PAGE_SESSION_KEY, $return_page ); |
191 |
} |
192 |
} |
192 |
|
193 |
|
Lines 196-209
sub get_token_from_koha_session {
Link Here
|
196 |
my $self = shift; |
197 |
my $self = shift; |
197 |
my ($token, $token_type) |
198 |
my ($token, $token_type) |
198 |
= split $ACCESS_TOKEN_DELIMITER, $self->get_from_koha_session(ACCESS_TOKEN_SESSION_KEY) || ""; |
199 |
= split $ACCESS_TOKEN_DELIMITER, $self->get_from_koha_session(ACCESS_TOKEN_SESSION_KEY) || ""; |
199 |
$self->logger->debug("get_token_from_koha_session: ".($token || "(none)")); |
200 |
$self->{logger}->debug("get_token_from_koha_session: ".($token || "(none)")); |
200 |
return ($token, $token_type); |
201 |
return ($token, $token_type); |
201 |
} |
202 |
} |
202 |
sub set_token_in_koha_session { |
203 |
sub set_token_in_koha_session { |
203 |
my $self = shift; |
204 |
my $self = shift; |
204 |
my $token = shift || ""; |
205 |
my $token = shift || ""; |
205 |
my $token_type = shift || ""; |
206 |
my $token_type = shift || ""; |
206 |
$self->logger->debug("set_token_in_koha_session: $token $token_type"); |
207 |
$self->{logger}->debug("set_token_in_koha_session: $token $token_type"); |
207 |
return $self->set_in_koha_session( |
208 |
return $self->set_in_koha_session( |
208 |
ACCESS_TOKEN_SESSION_KEY, |
209 |
ACCESS_TOKEN_SESSION_KEY, |
209 |
join($ACCESS_TOKEN_DELIMITER, $token, $token_type) |
210 |
join($ACCESS_TOKEN_DELIMITER, $token, $token_type) |