66 $this->ressource_not_found =
$e;
69 $this->
http = $httpState;
87 if ($ilWACSignedPath->isSignedPath()) {
89 if ($ilWACSignedPath->isSignedPathValid()) {
98 if ($ilWACSignedPath->isFolderSigned()) {
100 if ($ilWACSignedPath->isFolderTokenValid()) {
102 $ilWACSignedPath->revalidatingFolderToken();
105 $this->
sendHeader(
'checked using secure folder');
116 $clean_path = $this->
getPathObject()->getCleanURLdecodedPath();
117 $path = realpath($clean_path);
129 $checkingInstance = ilWACSecurePath::getCheckingInstance($this->
getPathObject());
131 $canBeDelivered = $checkingInstance->canBeDelivered($this->
getPathObject());
132 if ($canBeDelivered) {
135 $ilWACSignedPath->revalidatingFolderToken();
139 return $canBeDelivered;
150 $response = $this->
http->response()->withHeader(
'X-ILIAS-WebAccessChecker', $message);
164 $cookie = $this->cookieFactory->create(
'ilClientId', $this->
getPathObject()->getClient())
170 ->renderIntoResponseHeader($this->
http->response());
184 if (($e instanceof
Exception && $e->getMessage() ===
'Authentication failed.')
186 $this->initAnonymousSession();
196 if ($DIC->user()->getId() === 0) {
208 $is_null_user = ($DIC->user()->getId() === 0);
209 $pub_section_activated = (bool) $DIC[
'ilSetting']->
get(
'pub_section');
210 $isset = isset($DIC[
'ilSetting']);
211 $instanceof = $DIC[
'ilSetting'] instanceof
ilSetting;
213 if (!$isset || !$instanceof) {
217 if ($pub_section_activated && ($is_null_user || $is_anonymous)) {
222 if ($is_anonymous || $is_null_user) {
231 $is_user = $DIC->user() instanceof
ilObjUser;
232 $user_id_is_zero = ((
int) $DIC->user()->getId() === 0);
233 if (!$is_user || $user_id_is_zero) {
310 return self::$use_seperate_logfile;
336 $this->applied_checking_methods[] = $method;
339 protected function initAnonymousSession():
void 348 $ilAuthSession = $DIC[
'ilAuthSession'];
349 $ilAuthSession->regenerateId();
setPathObject(ilWACPath $path_object)
sendHeader(string $message)
getAppliedCheckingMethods()
__construct(Services $httpState, private CookieFactory $cookieFactory)
ilWebAccessChecker constructor.
bool $revalidate_folder_tokens
setAppliedCheckingMethods(array $applied_checking_methods)
setInitialized(bool $initialized)
const CM_CHECKINGINSTANCE
const ACCESS_DENIED_NO_LOGIN
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addAppliedCheckingMethod(int $method)
setOverrideMimetype(string $override_mimetype)
static initILIAS()
ilias initialisation
setSendStatusCode(bool $send_status_code)
static http()
Fetches the global http state from ILIAS.
array $applied_checking_methods
isRevalidateFolderTokens()
Class ilWebAccessChecker.
string $override_mimetype
setChecked(bool $checked)
static isUseSeperateLogfile()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setRevalidateFolderTokens(bool $revalidate_folder_tokens)
static hasCheckingInstanceRegistered(ilWACPath $ilWACPath)
Searches a checking instance for the given wac path.
static init(string $a_type)
Init context by type.
static setUseSeperateLogfile(bool $use_seperate_logfile)
setDisposition(string $disposition)
const ACCESS_DENIED_NO_PUB
static bool $use_seperate_logfile
ilWACException $ressource_not_found