22use Psr\Http\Message\UriInterface;
 
   24require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
 
   25require_once(
'./Services/WebAccessChecker/classes/class.ilWACPath.php');
 
   26require_once(
'./Services/WebAccessChecker/classes/class.ilWACSecurePath.php');
 
   27require_once(
'./Services/Init/classes/class.ilInitialisation.php');
 
   28require_once(
'./Services/FileDelivery/classes/class.ilFileDelivery.php');
 
   76            $this->ressource_not_found = 
$e;
 
   79        $this->
http = $httpState;
 
   91            if ($this->ressource_not_found !== 
null) {
 
  100        if ($ilWACSignedPath->isSignedPath()) {
 
  102            if ($ilWACSignedPath->isSignedPathValid()) {
 
  111        if ($ilWACSignedPath->isFolderSigned()) {
 
  113            if ($ilWACSignedPath->isFolderTokenValid()) {
 
  115                    $ilWACSignedPath->revalidatingFolderToken();
 
  118                $this->
sendHeader(
'checked using secure folder');
 
  129            $clean_path = $this->
getPathObject()->getCleanURLdecodedPath();
 
  130            $path = realpath($clean_path);
 
  132            if (strpos($path, (
string) $data_dir) !== 0) {
 
  135            if (dirname($path) === $data_dir && is_file($path)) {
 
  142            $checkingInstance = ilWACSecurePath::getCheckingInstance($this->
getPathObject());
 
  144            $canBeDelivered = $checkingInstance->canBeDelivered($this->
getPathObject());
 
  145            if ($canBeDelivered) {
 
  147                if ($ilWACSignedPath->isFolderSigned() && $this->isRevalidateFolderTokens()) {
 
  148                    $ilWACSignedPath->revalidatingFolderToken();
 
  200        $cookie = $this->cookieFactory->create(
'ilClientId', $this->
getPathObject()->getClient())
 
  206                               ->renderIntoResponseHeader($this->
http->response());
 
  215        } 
catch (Exception 
$e) {
 
  220            if ((
$e instanceof Exception && 
$e->getMessage() == 
'Authentication failed.')
 
  222                $this->initAnonymousSession();
 
  232        if ($DIC->user()->getId() === 0) {
 
  246        $is_null_user = (
$DIC->user()->getId() === 0);
 
  247        $pub_section_activated = (bool) 
$DIC[
'ilSetting']->
get(
'pub_section');
 
  248        $isset = isset(
$DIC[
'ilSetting']);
 
  251        if (!$isset || !$instanceof) {
 
  255        if ($pub_section_activated && ($is_null_user || $is_anonymous)) {
 
  260        if ($is_anonymous || $is_null_user) {
 
  271        $user_id_is_zero = ((int) 
$DIC->user()->getId() === 0);
 
  272        if (!$is_user || $user_id_is_zero) {
 
  283        return (
bool) $this->checked;
 
  294        assert(is_bool($checked));
 
  295        $this->checked = $checked;
 
  304        return $this->path_object;
 
  315        $this->path_object = $path_object;
 
  324        return (
string) $this->disposition;
 
  335        assert(is_string($disposition));
 
  336        $this->disposition = $disposition;
 
  345        return (
string) $this->override_mimetype;
 
  356        assert(is_string($override_mimetype));
 
  357        $this->override_mimetype = $override_mimetype;
 
  366        return (
bool) $this->initialized;
 
  375        assert(is_bool($initialized));
 
  376        $this->initialized = $initialized;
 
  385        return (
bool) $this->send_status_code;
 
  396        assert(is_bool($send_status_code));
 
  397        $this->send_status_code = $send_status_code;
 
  406        return (
bool) $this->revalidate_folder_tokens;
 
  417        assert(is_bool($revalidate_folder_tokens));
 
  418        $this->revalidate_folder_tokens = $revalidate_folder_tokens;
 
  427        return (
bool) self::$use_seperate_logfile;
 
  438        assert(is_bool($use_seperate_logfile));
 
  439        self::$use_seperate_logfile = $use_seperate_logfile;
 
  470        assert(is_int($method));
 
  471        $this->applied_checking_methods[] = $method;
 
  475    protected function initAnonymousSession()
 
  478        include_once 
'./Services/Context/classes/class.ilContext.php';
 
  481        require_once(
"Services/Init/classes/class.ilInitialisation.php");
 
  486        $ilAuthSession = 
$DIC[
'ilAuthSession'];
 
  487        $ilAuthSession->init();
 
  488        $ilAuthSession->regenerateId();
 
  490        $ilAuthSession->setUserId($a_id);
 
  491        $ilAuthSession->setAuthenticated(
false, $a_id);
 
  492        $DIC->user()->setId($a_id);
 
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
An exception for terminatinating execution or to throw for unit testing.
static init($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
static hasCheckingInstanceRegistered(ilWACPath $ilWACPath)
Searches a checking instance for the given wac path.
Class ilWebAccessChecker.
const CM_CHECKINGINSTANCE
setDisposition($disposition)
__construct(GlobalHttpState $httpState, CookieFactory $cookieFactory)
ilWebAccessChecker constructor.
$applied_checking_methods
static setUseSeperateLogfile($use_seperate_logfile)
setSendStatusCode($send_status_code)
setRevalidateFolderTokens($revalidate_folder_tokens)
setAppliedCheckingMethods(array $applied_checking_methods)
isRevalidateFolderTokens()
addAppliedCheckingMethod($method)
setInitialized($initialized)
setPathObject(ilWACPath $path_object)
static isUseSeperateLogfile()
setOverrideMimetype($override_mimetype)
getAppliedCheckingMethods()
Interface GlobalHttpState.
request()
Returns the current psr-7 server request.
static http()
Fetches the global http state from ILIAS.