19declare(strict_types=1);
35 protected ?HTTPServices
$http =
null;
56 if (
$_GET[
'client_id']) {
66 session_name(
'ILCALSESSID');
68 require_once(__DIR__ .
"/../../../../artifacts/bootstrap_default.php");
72 $logger =
$GLOBALS[
'DIC']->logger()->cal();
77 $logger->
warning(
'Calendar token is invalid. Authentication failed.');
82 $GLOBALS[
'DIC'][
'ilAuthSession']->logout();
88 #$export = new ilCalendarExport(array($this->getTokenHandler()->getCalendar()));
91 $export =
new ilCalendarExport($cats->getCategories(
true), $this->limit_enabled);
95 $export =
new ilCalendarExport($cats->getCategories(
true), $this->limit_enabled);
103 $GLOBALS[
'DIC'][
'ilAuthSession']->logout();
112 $this->
http = $DIC->http();
116 if ($this->
http->wrapper()->query()->has(
'token')) {
117 $token = $this->
http->wrapper()->query()->retrieve(
119 $this->
refinery->kindlyTo()->string()
131 $this->limit_enabled = (bool) (
$_GET[self::LIMITED_QUERY_PARAM] ??
false);
142 $this->
lng = $DIC->language();
143 $this->
lng->loadLanguageModule(
'dateplaner');
144 $this->
logger = $DIC->logger()->cal();
152 $this->
logger->info(
'Initialisation of authentication token failed');
156 $this->
logger->info(
'No user id found for calendar synchronisation');
160 $this->
logger->notice(
'No valid user id found for calendar synchronisation');
168 $this->
logger->debug(
'No user object defined');
170 $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.
entry_point(string $name)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...