9 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
10 require_once(
'./Services/WebAccessChecker/classes/class.ilWACPath.php');
11 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSecurePath.php');
12 require_once(
'./Services/Init/classes/class.ilInitialisation.php');
13 require_once(
'./Services/FileDelivery/classes/class.ilFileDelivery.php');
85 $this->
http = $httpState;
102 if ($ilWACSignedPath->isSignedPath()) {
104 if ($ilWACSignedPath->isSignedPathValid()) {
113 if ($ilWACSignedPath->isFolderSigned()) {
115 if ($ilWACSignedPath->isFolderTokenValid()) {
117 $ilWACSignedPath->revalidatingFolderToken();
120 $this->
sendHeader(
'checked using secure folder');
131 $checkingInstance = ilWACSecurePath::getCheckingInstance($this->
getPathObject());
133 $canBeDelivered = $checkingInstance->canBeDelivered($this->
getPathObject());
134 if ($canBeDelivered) {
137 $ilWACSignedPath->revalidatingFolderToken();
187 $cookie = $this->cookieFactory->create(
'ilClientId', $this->
getPathObject()->getClient())
193 ->renderIntoResponseHeader($this->
http->response());
207 if (($e instanceof
Exception && $e->getMessage() ==
'Authentication failed.')
209 $this->initAnonymousSession();
226 $is_anonymous = ((int) $DIC->user()->getId() === (int) ANONYMOUS_USER_ID);
227 $is_null_user = ($DIC->user()->getId() === 0);
228 $pub_section_activated = (bool) $DIC[
'ilSetting']->
get(
'pub_section');
229 $isset = isset($DIC[
'ilSetting']);
230 $instanceof = $DIC[
'ilSetting'] instanceof
ilSetting;
232 if (!$isset || !$instanceof) {
236 if ($on_login_page && ($is_null_user || $is_anonymous)) {
241 if ($pub_section_activated && ($is_null_user || $is_anonymous)) {
246 if ($is_anonymous || $is_null_user) {
256 $is_user = $DIC->user() instanceof
ilObjUser;
257 $user_id_is_zero = ((int) $DIC->user()->getId() === 0);
259 if (!$is_user || ($user_id_is_zero && $not_on_login_page)) {
414 return (
bool) self::$use_seperate_logfile;
457 assert(is_int($method));
458 $this->applied_checking_methods[] = $method;
462 protected function initAnonymousSession()
465 include_once
'./Services/Context/classes/class.ilContext.php';
467 require_once(
"Services/Init/classes/class.ilInitialisation.php");
472 $ilAuthSession = $DIC[
'ilAuthSession'];
473 $ilAuthSession->init();
474 $ilAuthSession->regenerateId();
475 $a_id = (int) ANONYMOUS_USER_ID;
476 $ilAuthSession->setUserId($a_id);
477 $ilAuthSession->setAuthenticated(
false, $a_id);
478 $DIC->user()->setId($a_id);
487 $referrer = (string) (
$_SERVER[
'HTTP_REFERER'] ??
'');
488 $not_on_login_page = (strpos($referrer,
'login.php') ===
false 489 && strpos($referrer,
'&baseClass=ilStartUpGUI') ===
false);
491 if ($not_on_login_page && $referrer !==
'') {
493 $referrer_url_parts = parse_url($referrer);
496 $ilias_url_parts[
'host'] === $referrer_url_parts[
'host'] &&
498 !isset($referrer_url_parts[
'path']) ||
499 strpos($referrer_url_parts[
'path'],
'.php') ===
false 502 $not_on_login_page =
false;
506 return $not_on_login_page;
setPathObject(ilWACPath $path_object)
static setUseSeperateLogfile($use_seperate_logfile)
Interface GlobalHttpState.
getAppliedCheckingMethods()
static $use_seperate_logfile
request()
Returns the current psr-7 server request.
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
setInitialized($initialized)
setDisposition($disposition)
setAppliedCheckingMethods(array $applied_checking_methods)
const CM_CHECKINGINSTANCE
const ACCESS_DENIED_NO_LOGIN
setRevalidateFolderTokens($revalidate_folder_tokens)
isRequestNotFromLoginPage()
__construct(GlobalHttpState $httpState, CookieFactory $cookieFactory)
ilWebAccessChecker constructor.
static initILIAS()
ilias initialisation
catch(Exception $e) $message
static http()
Fetches the global http state from ILIAS.
isRevalidateFolderTokens()
Class ilWebAccessChecker.
setSendStatusCode($send_status_code)
static isUseSeperateLogfile()
setOverrideMimetype($override_mimetype)
static init($a_type)
Init context by type.
$applied_checking_methods
static hasCheckingInstanceRegistered(ilWACPath $ilWACPath)
Searches a checking instance for the given wac path.
$revalidate_folder_tokens
const ACCESS_DENIED_NO_PUB
addAppliedCheckingMethod($method)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.