19declare(strict_types=1);
35 protected ?HTTPServices
$http =
null;
56 if (
$_GET[
'client_id']) {
66 session_name(
'ILCALSESSID');
68 $logger =
$GLOBALS[
'DIC']->logger()->cal();
73 $logger->
warning(
'Calendar token is invalid. Authentication failed.');
78 $GLOBALS[
'DIC'][
'ilAuthSession']->logout();
84 #$export = new ilCalendarExport(array($this->getTokenHandler()->getCalendar()));
87 $export =
new ilCalendarExport($cats->getCategories(
true), $this->limit_enabled);
91 $export =
new ilCalendarExport($cats->getCategories(
true), $this->limit_enabled);
99 $GLOBALS[
'DIC'][
'ilAuthSession']->logout();
108 $this->
http = $DIC->http();
112 if ($this->
http->wrapper()->query()->has(
'token')) {
113 $token = $this->
http->wrapper()->query()->retrieve(
115 $this->
refinery->kindlyTo()->string()
127 $this->limit_enabled = (bool) (
$_GET[self::LIMITED_QUERY_PARAM] ??
false);
138 $this->
lng = $DIC->language();
139 $this->
lng->loadLanguageModule(
'dateplaner');
140 $this->
logger = $DIC->logger()->cal();
148 $this->
logger->info(
'Initialisation of authentication token failed');
152 $this->
logger->info(
'No user id found for calendar synchronisation');
156 $this->
logger->notice(
'No valid user id found for calendar synchronisation');
164 $this->
logger->debug(
'No user object defined');
166 $this->
logger->debug(
'Current user is: ' . $DIC->user()->getId());
const int CONTEXT_CALENDAR_TOKEN
Calendar authentication with auth token.
static setContext(int $a_context)
Handles calendar authentication tokens for external calendar subscriptions.
static lookupUser(string $a_token)
static _getInstance($a_usr_id=0)
get singleton instance
const MODE_REMOTE_SELECTED
@classDescription Export calendar(s) to ical format
@classDescription Handles requests from external calendar applications
parseRequest()
Fetch client id, the chosen calendar...
ilCalendarAuthenticationToken $token_handler
const LIMITED_QUERY_PARAM
static init(string $a_type)
Init context by type.
static initILIAS()
ilias initialisation
static initUserAccount()
Init user with current account id.
Component logger with individual log levels by component id.
warning(string $message, array $context=[])
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
static http()
Fetches the global http state from ILIAS.