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;
231 if (!$isset || !$instanceof || (!$pub_section_activated && ($is_anonymous || ($is_null_user && $not_on_login_page)))) {
241 $is_user = $DIC->user() instanceof
ilObjUser;
242 $user_id_is_zero = ((int) $DIC->user()->getId() === 0);
244 if (!$is_user || ($user_id_is_zero && $not_on_login_page)) {
399 return (
bool) self::$use_seperate_logfile;
442 assert(is_int($method));
443 $this->applied_checking_methods[] = $method;
447 protected function initAnonymousSession()
450 include_once
'./Services/Context/classes/class.ilContext.php';
452 require_once(
"Services/Init/classes/class.ilInitialisation.php");
457 $ilAuthSession = $DIC[
'ilAuthSession'];
458 $ilAuthSession->init();
459 $ilAuthSession->regenerateId();
460 $a_id = (int) ANONYMOUS_USER_ID;
461 $ilAuthSession->setUserId($a_id);
462 $ilAuthSession->setAuthenticated(
false, $a_id);
463 $DIC->user()->setId($a_id);
472 $referrer = !is_null(
$_SERVER[
'HTTP_REFERER']) ?
$_SERVER[
'HTTP_REFERER'] :
'';
473 $not_on_login_page = (strpos($referrer,
'login.php') ===
false 474 && strpos($referrer,
'&baseClass=ilStartUpGUI') ===
false);
476 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)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
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)
Create styles array
The data for the language used.
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)