ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilCalendarRemoteAccessHandler Class Reference

@classDescription Handles requests from external calendar applications More...

+ Collaboration diagram for ilCalendarRemoteAccessHandler:

Public Member Functions

 __construct ()
 Constructor. More...
 
 getTokenHandler ()
 
 parseRequest ()
 Fetch client id, the chosen calendar... More...
 
 handleRequest ()
 Handle Request. More...
 

Protected Member Functions

 initTokenHandler ()
 
 initIlias ()
 

Private Attributes

 $token_handler = null
 

Detailed Description

@classDescription Handles requests from external calendar applications

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 34 of file class.ilCalendarRemoteAccessHandler.php.

Constructor & Destructor Documentation

◆ __construct()

ilCalendarRemoteAccessHandler::__construct ( )

Constructor.

Returns

Definition at line 42 of file class.ilCalendarRemoteAccessHandler.php.

43 {
44 }

Member Function Documentation

◆ getTokenHandler()

ilCalendarRemoteAccessHandler::getTokenHandler ( )

Definition at line 46 of file class.ilCalendarRemoteAccessHandler.php.

References $token_handler.

Referenced by handleRequest().

+ Here is the caller graph for this function:

◆ handleRequest()

ilCalendarRemoteAccessHandler::handleRequest ( )

Handle Request.

Returns

Definition at line 73 of file class.ilCalendarRemoteAccessHandler.php.

74 {
75 $this->initIlias();
76 $this->initTokenHandler();
77
78 if($this->getTokenHandler()->getIcal() and !$this->getTokenHandler()->isIcalExpired())
79 {
80 ilUtil::deliverData($this->getTokenHandler(),'calendar.ics','text/calendar','utf-8');
81 }
82
83 include_once './Services/Calendar/classes/Export/class.ilCalendarExport.php';
84 include_once './Services/Calendar/classes/class.ilCalendarCategories.php';
86 {
87 #$export = new ilCalendarExport(array($this->getTokenHandler()->getCalendar()));
89 $cats->initialize(ilCalendarCategories::MODE_REMOTE_SELECTED, $this->getTokenHandler()->getCalendar());
90 $export = new ilCalendarExport($cats->getCategories(true));
91 }
92 else
93 {
96 $export = new ilCalendarExport($cats->getCategories(true));
97 }
98
99 $export->export();
100
101 $this->getTokenHandler()->setIcal($export->getExportString());
102 $this->getTokenHandler()->storeIcal();
103
104 $GLOBALS['ilAuth']->logout();
105 ilUtil::deliverData($export->getExportString(),'calendar.ics','text/calendar','utf-8');
106 #echo $export->getExportString();
107 #echo nl2br($export->getExportString());
108
109 #$fp = fopen('ilias.ics', 'w');
110 #fwrite($fp,$export->getExportString());
111 exit;
112 }
static _getInstance($a_usr_id=0)
get singleton instance
@classDescription Export calendar(s) to ical format
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
exit
Definition: login.php:54

References $GLOBALS, ilCalendarCategories\_getInstance(), ilUtil\deliverData(), exit, getTokenHandler(), initIlias(), initTokenHandler(), ilCalendarCategories\MODE_REMOTE_ACCESS, ilCalendarCategories\MODE_REMOTE_SELECTED, and ilCalendarAuthenticationToken\SELECTION_CALENDAR.

+ Here is the call graph for this function:

◆ initIlias()

ilCalendarRemoteAccessHandler::initIlias ( )
protected

Definition at line 123 of file class.ilCalendarRemoteAccessHandler.php.

124 {
125 include_once "Services/Context/classes/class.ilContext.php";
127
128 include_once './Services/Authentication/classes/class.ilAuthFactory.php';
130
131 $_POST['username'] = 'cal_auth_token';
132 $_POST['password'] = 'cal_auth_token';
133
134 require_once("Services/Init/classes/class.ilInitialisation.php");
136
137 $GLOBALS['lng']->loadLanguageModule('dateplaner');
138 }
static setContext($a_context)
set context
static init($a_type)
Init context by type.
const CONTEXT_ICAL
static initILIAS()
ilias initialisation
$_POST['username']
Definition: cron.php:12

References $_POST, $GLOBALS, ilAuthFactory\CONTEXT_CALENDAR_TOKEN, ilContext\CONTEXT_ICAL, ilContext\init(), ilInitialisation\initILIAS(), and ilAuthFactory\setContext().

Referenced by handleRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTokenHandler()

ilCalendarRemoteAccessHandler::initTokenHandler ( )
protected

Definition at line 114 of file class.ilCalendarRemoteAccessHandler.php.

115 {
116 $this->token_handler = new ilCalendarAuthenticationToken(
118 $_GET['token']
119 );
120 return true;
121 }
$_GET["client_id"]
Handles calendar authentication tokens for external calendar subscriptions.
static lookupUser($a_token)
Lookup user by hash.

References $_GET, and ilCalendarAuthenticationToken\lookupUser().

Referenced by handleRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseRequest()

ilCalendarRemoteAccessHandler::parseRequest ( )

Fetch client id, the chosen calendar...

Returns

Definition at line 55 of file class.ilCalendarRemoteAccessHandler.php.

56 {
57 if($_GET['client_id'])
58 {
59 $_COOKIE['ilClientId'] = $_GET['client_id'];
60
61 }
62 else
63 {
64 $path_info_components = explode('/',$_SERVER['PATH_INFO']);
65 $_COOKIE['ilClientId'] = $path_info_components[1];
66 }
67 }
$_COOKIE["ilClientId"]
Definition: cron.php:11
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
$path_info_components
Definition: webdav.php:20

References $_COOKIE, $_GET, $_SERVER, and $path_info_components.

Field Documentation

◆ $token_handler

ilCalendarRemoteAccessHandler::$token_handler = null
private

Definition at line 36 of file class.ilCalendarRemoteAccessHandler.php.

Referenced by getTokenHandler().


The documentation for this class was generated from the following file: