39 $obj =
new self($httpState, $cookieFactory);
40 $obj->handleRequest();
50 $this->
http = $httpState;
51 $this->img_dir = realpath(__DIR__ .
'/../templates/images');
59 $queries = $this->
http->request()->getQueryParams();
63 $this->wac->setDisposition($queries[ilWebAccessChecker::DISPOSITION]);
66 $this->wac->setSendStatusCode($queries[ilWebAccessChecker::STATUS_CODE]);
69 $this->wac->setRevalidateFolderTokens($queries[ilWebAccessChecker::REVALIDATE]);
74 if ($this->wac->check()) {
80 match ($e->getCode()) {
85 default => $this->handleErrors($e),
93 protected function deny(): void
95 if (!$this->wac->isChecked()) {
104 $ilFileDelivery =
new Delivery($this->img_dir .
'/access_denied.png', $this->
http);
105 $ilFileDelivery->setDisposition($this->wac->getDisposition());
106 $ilFileDelivery->deliver();
112 $ilFileDelivery =
new Delivery($this->img_dir .
'/access_denied.mp4', $this->
http);
113 $ilFileDelivery->setDisposition($this->wac->getDisposition());
114 $ilFileDelivery->stream();
134 if ($this->wac->getPathObject()->isVideo()) {
140 $this->wac->initILIAS();
156 $stream->write($e->getMessage());
167 if (!$this->wac->isChecked()) {
171 $path = $this->wac->getPathObject();
173 if (
$path->getModuleType() ===
'rs') {
175 if (!defined(
'CLIENT_DATA_DIR')) {
178 $data_dir = rtrim(
$ini->readVariable(
"clients",
"datadir"),
'/');
184 $token_factory =
new TokenFactory($client_data_dir);
185 $token = $token_factory->check(
$path->getFileName());
186 $path_to_file =
$token->resolveStream();
188 $path_to_file =
$path->getCleanURLdecodedPath();
191 $real_path_to_file = realpath(__DIR__ .
'/../../../../public/' . $path_to_file);
193 $ilFileDelivery =
new Delivery($real_path_to_file, $this->
http);
194 $ilFileDelivery->setCache(
true);
195 $ilFileDelivery->setDisposition($this->wac->getDisposition());
196 if (
$path->isStreamable()) {
197 $ilFileDelivery->stream();
199 $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.