22use Psr\Http\Message\UriInterface;
67 $this->ressource_not_found =
$e;
70 $this->
http = $httpState;
80 if ($this->ressource_not_found !==
null) {
89 if ($ilWACSignedPath->isSignedPath()) {
91 if ($ilWACSignedPath->isSignedPathValid()) {
100 if ($ilWACSignedPath->isFolderSigned()) {
102 if ($ilWACSignedPath->isFolderTokenValid()) {
104 $ilWACSignedPath->revalidatingFolderToken();
107 $this->
sendHeader(
'checked using secure folder');
118 $clean_path = $this->
getPathObject()->getCleanURLdecodedPath();
119 $path = realpath($clean_path);
131 $checkingInstance = ilWACSecurePath::getCheckingInstance($this->
getPathObject());
133 $canBeDelivered = $checkingInstance->canBeDelivered($this->
getPathObject());
134 if ($canBeDelivered) {
136 if ($ilWACSignedPath->isFolderSigned() && $this->isRevalidateFolderTokens()) {
137 $ilWACSignedPath->revalidatingFolderToken();
141 return $canBeDelivered;
152 $response = $this->
http->response()->withHeader(
'X-ILIAS-WebAccessChecker', $message);
166 $cookie = $this->cookieFactory->create(
'ilClientId', $this->
getPathObject()->getClient())
172 ->renderIntoResponseHeader($this->
http->response());
181 }
catch (Exception
$e) {
186 if ((
$e instanceof Exception &&
$e->getMessage() ===
'Authentication failed.')
188 $this->initAnonymousSession();
198 if ($DIC->user()->getId() === 0) {
210 $is_null_user = (
$DIC->user()->getId() === 0);
211 $pub_section_activated = (bool)
$DIC[
'ilSetting']->
get(
'pub_section');
212 $isset = isset(
$DIC[
'ilSetting']);
215 if (!$isset || !$instanceof) {
219 if ($pub_section_activated && ($is_null_user || $is_anonymous)) {
224 if ($is_anonymous || $is_null_user) {
234 $user_id_is_zero = ((
int)
$DIC->user()->getId() === 0);
235 if (!$is_user || $user_id_is_zero) {
338 $this->applied_checking_methods[] = $method;
341 protected function initAnonymousSession(): void
350 $ilAuthSession =
$DIC[
'ilAuthSession'];
351 $ilAuthSession->regenerateId();
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
static init(string $a_type)
Init context by type.
static initILIAS()
ilias initialisation
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const ACCESS_DENIED_NO_LOGIN
const ACCESS_DENIED_NO_PUB
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static hasCheckingInstanceRegistered(ilWACPath $ilWACPath)
Searches a checking instance for the given wac path.
Class ilWebAccessChecker.
ilWACException $ressource_not_found
sendHeader(string $message)
const CM_CHECKINGINSTANCE
setInitialized(bool $initialized)
__construct(Services $httpState, CookieFactory $cookieFactory)
ilWebAccessChecker constructor.
setOverrideMimetype(string $override_mimetype)
setChecked(bool $checked)
setSendStatusCode(bool $send_status_code)
string $override_mimetype
static bool $use_seperate_logfile
bool $revalidate_folder_tokens
setAppliedCheckingMethods(array $applied_checking_methods)
setRevalidateFolderTokens(bool $revalidate_folder_tokens)
CookieFactory $cookieFactory
isRevalidateFolderTokens()
addAppliedCheckingMethod(int $method)
setPathObject(ilWACPath $path_object)
setDisposition(string $disposition)
static isUseSeperateLogfile()
array $applied_checking_methods
static setUseSeperateLogfile(bool $use_seperate_logfile)
getAppliedCheckingMethods()
static http()
Fetches the global http state from ILIAS.