ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCalendarRemoteAccessHandler Class Reference

Handles requests from external calendar applications More...

+ Collaboration diagram for ilCalendarRemoteAccessHandler:

Public Member Functions

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

Protected Member Functions

 initTokenHandler ()
 initIlias ()

Private Attributes

 $token_handler = null

Detailed Description

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

ilCalendarRemoteAccessHandler::__construct ( )

Constructor.

Returns

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

{
}

Member Function Documentation

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:

ilCalendarRemoteAccessHandler::handleRequest ( )

Handle Request.

Returns

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

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

{
$this->initIlias();
$this->initTokenHandler();
if($this->getTokenHandler()->getIcal() and !$this->getTokenHandler()->isIcalExpired())
{
ilUtil::deliverData($this->getTokenHandler(),'calendar.ics','text/calendar','utf-8');
}
include_once './Services/Calendar/classes/Export/class.ilCalendarExport.php';
include_once './Services/Calendar/classes/class.ilCalendarCategories.php';
{
#$export = new ilCalendarExport(array($this->getTokenHandler()->getCalendar()));
$cats->initialize(ilCalendarCategories::MODE_REMOTE_SELECTED, $this->getTokenHandler()->getCalendar());
$export = new ilCalendarExport($cats->getCategories(true));
}
else
{
$export = new ilCalendarExport($cats->getCategories(true));
}
$export->export();
$this->getTokenHandler()->setIcal($export->getExportString());
$this->getTokenHandler()->storeIcal();
$GLOBALS['ilAuth']->logout();
ilUtil::deliverData($export->getExportString(),'calendar.ics','text/calendar','utf-8');
#echo $export->getExportString();
#echo nl2br($export->getExportString());
#$fp = fopen('ilias.ics', 'w');
#fwrite($fp,$export->getExportString());
}

+ Here is the call graph for this function:

ilCalendarRemoteAccessHandler::initIlias ( )
protected

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

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

Referenced by handleRequest().

{
include_once "Services/Context/classes/class.ilContext.php";
include_once './Services/Authentication/classes/class.ilAuthFactory.php';
$_POST['username'] = 'cal_auth_token';
$_POST['password'] = 'cal_auth_token';
require_once("Services/Init/classes/class.ilInitialisation.php");
$GLOBALS['lng']->loadLanguageModule('dateplaner');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCalendarRemoteAccessHandler::initTokenHandler ( )
protected

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

References $_GET, and ilCalendarAuthenticationToken\lookupUser().

Referenced by handleRequest().

{
$this->token_handler = new ilCalendarAuthenticationToken(
$_GET['token']
);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCalendarRemoteAccessHandler::parseRequest ( )

Fetch client id, the chosen calendar...

Returns

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

References $_COOKIE, $_GET, and $path_info_components.

{
if($_GET['client_id'])
{
$_COOKIE['ilClientId'] = $_GET['client_id'];
}
else
{
$path_info_components = explode('/',$_SERVER['PATH_INFO']);
$_COOKIE['ilClientId'] = $path_info_components[1];
}
}

Field Documentation

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: