2 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
3 require_once(
'./Services/WebAccessChecker/classes/class.ilWACPath.php');
4 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSecurePath.php');
5 require_once(
'./Services/WebAccessChecker/classes/class.ilWACLog.php');
6 require_once(
'./Services/Init/classes/class.ilInitialisation.php');
7 require_once(
'./Services/FileDelivery/classes/class.ilFileDelivery.php');
8 require_once(
'./Services/WebAccessChecker/classes/class.ilWACCookie.php');
9 require_once(
'./Services/WebAccessChecker/classes/class.ilWACHeader.php');
101 if ($ilWACSignedPath->isSignedPath()) {
103 if ($ilWACSignedPath->isSignedPathValid()) {
113 if ($ilWACSignedPath->isFolderSigned()) {
115 if ($ilWACSignedPath->isFolderTokenValid()) {
117 $ilWACSignedPath->revalidatingFolderToken();
121 $this->
sendHeader(
'checked using secure folder');
131 $checkingInstance = ilWACSecurePath::getCheckingInstance($this->
getPathObject());
135 $canBeDelivered = $checkingInstance->canBeDelivered($this->
getPathObject());
136 if ($canBeDelivered) {
140 $ilWACSignedPath->revalidatingFolderToken();
156 ilWACLog::getInstance()->write(
'none of the checking mechanisms could have been applied. access depending on sec folder');
175 $this->
getHeader()->sendHeader(
'X-ILIAS-WebAccessChecker: ' . $message);
188 $this->cookie->set(
'ilClientId', $this->
getPathObject()->getClient(), 0,
'/');
200 if (($e instanceof
Exception && $e->getMessage() ==
'Authentication failed.')
202 $this->initAnonymousSession();
214 $is_anonymous = ((int)$DIC->user()->getId() === (int)ANONYMOUS_USER_ID);
215 $is_null_user = ($DIC->user()->getId() === 0);
216 $pub_section_activated = (bool)$DIC[
'ilSetting']->
get(
'pub_section');
217 $isset = isset($DIC[
'ilSetting']);
218 $instanceof = $DIC[
'ilSetting'] instanceof
ilSetting;
219 if (!$isset || !$instanceof || (!$pub_section_activated && ($is_anonymous || ($is_null_user && $not_on_login_page)))) {
228 $is_user = $DIC->user() instanceof
ilObjUser;
229 $user_id_is_zero = ((int)$DIC->user()->getId() === 0);
231 if (!$is_user || ($user_id_is_zero && $not_on_login_page)) {
369 return self::$use_seperate_logfile;
417 $this->applied_checking_methods[] = $method;
437 protected function initAnonymousSession() {
439 include_once
'./Services/Context/classes/class.ilContext.php';
441 require_once(
"Services/Init/classes/class.ilInitialisation.php");
446 $ilAuthSession = $DIC[
'ilAuthSession'];
447 $ilAuthSession->init();
448 $ilAuthSession->regenerateId();
449 $a_id = (int)ANONYMOUS_USER_ID;
450 $ilAuthSession->setUserId($a_id);
451 $ilAuthSession->setAuthenticated(
false, $a_id);
452 $DIC->user()->setId($a_id);
460 $referrer = !is_null(
$_SERVER[
'HTTP_REFERER']) ?
$_SERVER[
'HTTP_REFERER'] :
'';
461 $not_on_login_page = (strpos($referrer,
'login.php') ===
false 462 && strpos($referrer,
'&baseClass=ilStartUpGUI') ===
false);
464 return $not_on_login_page;
static setUseSeperateLogfile($use_seperate_logfile)
getAppliedCheckingMethods()
static $use_seperate_logfile
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
setAppliedCheckingMethods($applied_checking_methods)
setInitialized($initialized)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Class ilWACCookieInterface.
setDisposition($disposition)
const CM_CHECKINGINSTANCE
const ACCESS_DENIED_NO_LOGIN
__construct($path, ilWACCookieInterface $ilWACCookieInterface=null, ilWACHeaderInterface $ilWACHeaderInterface=null)
ilWebAccessChecker constructor.
setRevalidateFolderTokens($revalidate_folder_tokens)
isRequestNotFromLoginPage()
static initILIAS()
ilias initialisation
isRevalidateFolderTokens()
Class ilWebAccessChecker.
setSendStatusCode($send_status_code)
Add a drawing to the header
Class ilWACCheckingClass.
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
$revalidate_folder_tokens
const ACCESS_DENIED_NO_PUB
addAppliedCheckingMethod($method)
setPathObject($path_object)