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

Class ilWebAccessCheckerDelivery. More...

+ Collaboration diagram for ilWebAccessCheckerDelivery:

Public Member Functions

 __construct ($raw_path)
 ilWebAccessCheckerDelivery constructor. More...
 

Static Public Member Functions

static run ($raw_path)
 

Protected Member Functions

 handleRequest ()
 
 deny ()
 
 deliverDummyImage ()
 
 deliverDummyVideo ()
 
 handleAccessErrors (ilWACException $e)
 
 handleErrors (ilWACException $e)
 
 deliver ()
 

Protected Attributes

 $ilWebAccessChecker = null
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilWebAccessCheckerDelivery::__construct (   $raw_path)

ilWebAccessCheckerDelivery constructor.

Parameters
string$raw_path

Definition at line 33 of file class.ilWebAccessCheckerDelivery.php.

33 {
34 $this->ilWebAccessChecker = new ilWebAccessChecker(rawurldecode($raw_path));
35 }
Class ilWebAccessChecker.

Member Function Documentation

◆ deliver()

ilWebAccessCheckerDelivery::deliver ( )
protected

Definition at line 138 of file class.ilWebAccessCheckerDelivery.php.

138 {
139 if (!$this->ilWebAccessChecker->isChecked()) {
141 }
142
143 $ilFileDelivery = new ilFileDelivery($this->ilWebAccessChecker->getPathObject()->getPath());
144 $ilFileDelivery->setCache(false);
145 $ilFileDelivery->setDisposition($this->ilWebAccessChecker->getDisposition());
146 ilWACLog::getInstance()->write('Deliver file using ' . $ilFileDelivery->getDeliveryType());
147 if ($this->ilWebAccessChecker->getPathObject()->isStreamable()) { // fixed 0016468
148 ilWACLog::getInstance()->write('begin streaming');
149 $ilFileDelivery->stream();
150 } else {
151 $ilFileDelivery->deliver();
152 }
153 }
Class ilFileDelivery.
Class ilWACException.
static getInstance()

References ilWACException\ACCESS_WITHOUT_CHECK, ilWebAccessChecker\getDisposition(), ilWACLog\getInstance(), ilWebAccessChecker\getPathObject(), and ilWebAccessChecker\isChecked().

Referenced by handleRequest().

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

◆ deliverDummyImage()

ilWebAccessCheckerDelivery::deliverDummyImage ( )
protected

Definition at line 86 of file class.ilWebAccessCheckerDelivery.php.

86 {
87 $ilFileDelivery = new ilFileDelivery('./Services/WebAccessChecker/templates/images/access_denied.png', $this->ilWebAccessChecker->getPathObject()
88 ->getFileName());
89 $ilFileDelivery->setDisposition($this->ilWebAccessChecker->getDisposition());
90 $ilFileDelivery->deliver();
91 }

References ilWebAccessChecker\getDisposition(), and ilWebAccessChecker\getPathObject().

Referenced by handleAccessErrors().

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

◆ deliverDummyVideo()

ilWebAccessCheckerDelivery::deliverDummyVideo ( )
protected

Definition at line 94 of file class.ilWebAccessCheckerDelivery.php.

94 {
95 $ilFileDelivery = new ilFileDelivery('./Services/WebAccessChecker/templates/images/access_denied.mp4', $this->ilWebAccessChecker->getPathObject()
96 ->getFileName());
97 $ilFileDelivery->setDisposition($this->ilWebAccessChecker->getDisposition());
98 $ilFileDelivery->stream();
99 }

References ilWebAccessChecker\getDisposition(), and ilWebAccessChecker\getPathObject().

Referenced by handleAccessErrors().

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

◆ deny()

ilWebAccessCheckerDelivery::deny ( )
protected

Definition at line 78 of file class.ilWebAccessCheckerDelivery.php.

References ilWACException\ACCESS_DENIED, ilWACException\ACCESS_WITHOUT_CHECK, and ilWebAccessChecker\isChecked().

Referenced by handleRequest().

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

◆ handleAccessErrors()

ilWebAccessCheckerDelivery::handleAccessErrors ( ilWACException  $e)
protected
Parameters
ilWACException$e

Definition at line 105 of file class.ilWebAccessCheckerDelivery.php.

105 {
106 if ($this->ilWebAccessChecker->isSendStatusCode()) {
107 ilHTTP::status(401);
108 }
109 if ($this->ilWebAccessChecker->getPathObject()->isImage()) {
110 $this->deliverDummyImage();
111 }
112 if ($this->ilWebAccessChecker->getPathObject()->isVideo()) {
113 $this->deliverDummyVideo();
114 }
115 try {
117 } catch (ilWACException $ilWACException) {
118 }
119
120 global $tpl, $ilLog;
121 $ilLog->write($e->getMessage());
122 $tpl->setVariable('BASE', strstr($_SERVER['REQUEST_URI'], '/data', true) . '/');
123 ilUtil::sendFailure($e->getMessage());
124 $tpl->getStandardTemplate();
125 $tpl->show();
126 }
global $tpl
Definition: ilias.php:8
static status($status)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']

References $_SERVER, $ilLog, $tpl, deliverDummyImage(), deliverDummyVideo(), ilWebAccessChecker\getPathObject(), ilWebAccessChecker\initILIAS(), ilWebAccessChecker\isSendStatusCode(), ilUtil\sendFailure(), and ilHTTP\status().

Referenced by handleRequest().

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

◆ handleErrors()

ilWebAccessCheckerDelivery::handleErrors ( ilWACException  $e)
protected
Parameters
ilWACException$e

Definition at line 132 of file class.ilWebAccessCheckerDelivery.php.

132 {
133 ilHTTP::status(500);
134 echo $e->getMessage();
135 }

References ilHTTP\status().

Referenced by handleRequest().

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

◆ handleRequest()

ilWebAccessCheckerDelivery::handleRequest ( )
protected

Definition at line 38 of file class.ilWebAccessCheckerDelivery.php.

38 {
39 // Set errorreporting
41
42 // Set customizing
45 }
48 }
51 }
52
53 // Check if File can be delivered
54 try {
55 if ($this->ilWebAccessChecker->check()) {
56 $this->deliver();
57 } else {
58 $this->deny();
59 }
60 } catch (ilWACException $e) {
61 switch ($e->getCode()) {
65 $this->handleAccessErrors($e);
66 break;
70 default:
71 $this->handleErrors($e);
72 break;
73 }
74 }
75 }
$_GET["client_id"]
static handleErrorReporting()
Set error reporting level.
setSendStatusCode($send_status_code)
setRevalidateFolderTokens($revalidate_folder_tokens)

References $_GET, ilWACException\ACCESS_DENIED, ilWACException\ACCESS_DENIED_NO_LOGIN, ilWACException\ACCESS_DENIED_NO_PUB, ilWACException\ACCESS_WITHOUT_CHECK, ilWebAccessChecker\check(), deliver(), deny(), ilWebAccessChecker\DISPOSITION, handleAccessErrors(), ilInitialisation\handleErrorReporting(), handleErrors(), ilWACException\INITIALISATION_FAILED, ilWACException\NO_CHECKING_INSTANCE, ilWebAccessChecker\REVALIDATE, ilWebAccessChecker\setDisposition(), ilWebAccessChecker\setRevalidateFolderTokens(), ilWebAccessChecker\setSendStatusCode(), and ilWebAccessChecker\STATUS_CODE.

+ Here is the call graph for this function:

◆ run()

static ilWebAccessCheckerDelivery::run (   $raw_path)
static
Parameters
$raw_path

Definition at line 22 of file class.ilWebAccessCheckerDelivery.php.

22 {
23 $obj = new self($raw_path);
24 $obj->handleRequest();
25 }

Field Documentation

◆ $ilWebAccessChecker

ilWebAccessCheckerDelivery::$ilWebAccessChecker = null
protected

Definition at line 16 of file class.ilWebAccessCheckerDelivery.php.


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