68 if ($ilWACSignedPath->isSignedPath()) {
70 if ($ilWACSignedPath->isSignedPathValid()) {
79 if ($ilWACSignedPath->isFolderSigned()) {
81 if ($ilWACSignedPath->isFolderTokenValid()) {
83 $ilWACSignedPath->revalidatingFolderToken();
86 $this->
sendHeader(
'checked using secure folder');
98 $path = realpath(__DIR__ .
'/../../../../public/' . $clean_path);
110 $checkingInstance = ilWACSecurePath::getCheckingInstance(
$path_object);
112 $canBeDelivered = $checkingInstance->canBeDelivered(
$path_object);
113 if ($canBeDelivered) {
115 if ($ilWACSignedPath->isFolderSigned() && $this->isRevalidateFolderTokens()) {
116 $ilWACSignedPath->revalidatingFolderToken();
120 return $canBeDelivered;
131 $response = $this->
http->response()->withHeader(
'X-ILIAS-WebAccessChecker', $message);
145 $cookie = $this->cookieFactory->create(
'ilClientId', $this->
getPathObject()->getClient())
151 ->renderIntoResponseHeader($this->
http->response());
160 }
catch (Exception
$e) {
165 if ((
$e instanceof Exception &&
$e->getMessage() ===
'Authentication failed.')
167 $this->initAnonymousSession();
177 if ($DIC->user()->getId() === 0) {
189 $is_null_user = (
$DIC->user()->getId() === 0);
190 $pub_section_activated = (bool)
$DIC[
'ilSetting']->
get(
'pub_section');
191 $isset = isset(
$DIC[
'ilSetting']);
194 if (!$isset || !$instanceof) {
198 if ($pub_section_activated && ($is_null_user || $is_anonymous)) {
203 if ($is_anonymous || $is_null_user) {
213 $user_id_is_zero = ((
int)
$DIC->user()->getId() === 0);
214 if (!$is_user || $user_id_is_zero) {
317 $this->applied_checking_methods[] = $method;
320 protected function initAnonymousSession(): void
329 $ilAuthSession =
$DIC[
'ilAuthSession'];
330 $ilAuthSession->regenerateId();
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...
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...
getCleanURLdecodedPath()
Returns a clean (everything behind ? is removed and rawurldecoded path.
static hasCheckingInstanceRegistered(ilWACPath $ilWACPath)
Searches a checking instance for the given wac path.
Class ilWebAccessChecker.
sendHeader(string $message)
const CM_CHECKINGINSTANCE
setInitialized(bool $initialized)
__construct(private Services $http, private 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)
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.