40 $obj =
new self($httpState, $cookieFactory);
41 $obj->handleRequest();
51 $this->
http = $httpState;
52 $this->img_dir = realpath(__DIR__ .
'/../templates/images');
60 $queries = $this->
http->request()->getQueryParams();
64 $this->wac->setDisposition($queries[ilWebAccessChecker::DISPOSITION]);
67 $this->wac->setSendStatusCode($queries[ilWebAccessChecker::STATUS_CODE]);
70 $this->wac->setRevalidateFolderTokens($queries[ilWebAccessChecker::REVALIDATE]);
75 if ($this->wac->check()) {
81 match ($e->getCode()) {
86 default => $this->handleErrors($e),
94 protected function deny(): void
96 if (!$this->wac->isChecked()) {
105 $ilFileDelivery =
new Delivery($this->img_dir .
'/access_denied.png', $this->
http);
106 $ilFileDelivery->setDisposition($this->wac->getDisposition());
107 $ilFileDelivery->deliver();
113 $ilFileDelivery =
new Delivery($this->img_dir .
'/access_denied.mp4', $this->
http);
114 $ilFileDelivery->setDisposition($this->wac->getDisposition());
115 $ilFileDelivery->stream();
135 if ($this->wac->getPathObject()->isVideo()) {
141 $this->wac->initILIAS();
157 $stream->write($e->getMessage());
168 if (!$this->wac->isChecked()) {
172 $path = $this->wac->getPathObject();
174 if (
$path->getModuleType() ===
'rs') {
176 if (!defined(
'CLIENT_DATA_DIR')) {
179 $data_dir = rtrim(
$ini->readVariable(
"clients",
"datadir"),
'/');
185 $token_factory =
new TokenFactory($client_data_dir);
186 $token = $token_factory->check(
$path->getFileName());
187 $path_to_file =
$token->resolveStream();
189 $path_to_file =
$path->getCleanURLdecodedPath();
192 $real_path_to_file = realpath(__DIR__ .
'/../../../../public/' . $path_to_file);
194 $ilFileDelivery =
new Delivery($real_path_to_file, $this->
http);
195 $ilFileDelivery->setCache(
true);
196 $ilFileDelivery->setDisposition($this->wac->getDisposition());
197 if (
$path->isStreamable()) {
198 $ilFileDelivery->stream();
200 $ilFileDelivery->deliver();
const ACCESS_DENIED_NO_LOGIN
handleAccessErrors(ilWACException $e)
const ACCESS_WITHOUT_CHECK
handleNotFoundError(ilWACException $e)
static http()
Fetches the global http state from ILIAS.
Class ilWebAccessChecker.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilWebAccessCheckerDelivery.
const ACCESS_DENIED_NO_PUB
static run(Services $httpState, CookieFactory $cookieFactory)
static handleErrorReporting()
Set error reporting level.
__construct(Services $httpState, CookieFactory $cookieFactory)
ilWebAccessCheckerDelivery constructor.