ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilInitialisation.php
Go to the documentation of this file.
1 <?php
2 
19 // TODO:
36 
37 require_once("libs/composer/vendor/autoload.php");
38 
39 // needed for slow queries, etc.
40 if (!isset($GLOBALS['ilGlobalStartTime']) || !$GLOBALS['ilGlobalStartTime']) {
41  $GLOBALS['ilGlobalStartTime'] = microtime();
42 }
43 
44 global $DIC;
45 if (null === $DIC) {
46  // Don't remove this, intellisense autocompletion does not work in PhpStorm without a top level assignment
47  $DIC = new Container();
48 }
49 
60 {
64  protected static function removeUnsafeCharacters(): void
65  {
66  // Remove unsafe characters from GET parameters.
67  // We do not need this characters in any case, so it is
68  // feasible to filter them everytime. POST parameters
69  // need attention through ilUtil::stripSlashes() and similar functions)
70  $_GET = self::recursivelyRemoveUnsafeCharacters($_GET);
71  }
72 
77  protected static function recursivelyRemoveUnsafeCharacters($var)
78  {
79  if (is_array($var)) {
80  $mod = [];
81  foreach ($var as $k => $v) {
82  $k = self::recursivelyRemoveUnsafeCharacters($k);
83  $mod[$k] = self::recursivelyRemoveUnsafeCharacters($v);
84  }
85  return $mod;
86  }
87  return strip_tags(
88  str_replace(
89  array("\x00", "\n", "\r", "\\", "'", '"', "\x1a"),
90  "",
91  $var
92  )
93  );
94  }
95 
99  protected static function requireCommonIncludes(): void
100  {
102  require_once "include/inc.ilias_version.php";
103 
104  self::initGlobal("ilBench", "ilBenchmark", "./Services/Utilities/classes/class.ilBenchmark.php");
105  }
106 
111  protected static function includePhp5Compliance(): void
112  {
115  require_once("include/inc.xml5compliance.php");
116  }
118  require_once("include/inc.xsl5compliance.php");
119  }
120 
127  protected static function initIliasIniFile(): void
128  {
129  $ilIliasIniFile = new ilIniFile("./ilias.ini.php");
130  $ilIliasIniFile->read();
131  self::initGlobal('ilIliasIniFile', $ilIliasIniFile);
132 
133  // initialize constants
134  if (!defined('ILIAS_DATA_DIR')) {
135  define("ILIAS_DATA_DIR", $ilIliasIniFile->readVariable("clients", "datadir"));
136  }
137  if (!defined('ILIAS_WEB_DIR')) {
138  define("ILIAS_WEB_DIR", $ilIliasIniFile->readVariable("clients", "path"));
139  }
140  if (!defined("ILIAS_ABSOLUTE_PATH")) {
141  define("ILIAS_ABSOLUTE_PATH", $ilIliasIniFile->readVariable('server', 'absolute_path'));
142  }
143 
144  // logging
145  define("ILIAS_LOG_DIR", $ilIliasIniFile->readVariable("log", "path"));
146  define("ILIAS_LOG_FILE", $ilIliasIniFile->readVariable("log", "file"));
147  if (!defined("ILIAS_LOG_ENABLED")) {
148  define("ILIAS_LOG_ENABLED", $ilIliasIniFile->readVariable("log", "enabled"));
149  }
150  define("ILIAS_LOG_LEVEL", $ilIliasIniFile->readVariable("log", "level"));
151 
152  // read path + command for third party tools from ilias.ini
153  define("PATH_TO_CONVERT", $ilIliasIniFile->readVariable("tools", "convert"));
154  define("PATH_TO_FFMPEG", $ilIliasIniFile->readVariable("tools", "ffmpeg"));
155  define("PATH_TO_ZIP", $ilIliasIniFile->readVariable("tools", "zip"));
156  define("PATH_TO_MKISOFS", $ilIliasIniFile->readVariable("tools", "mkisofs"));
157  define("PATH_TO_UNZIP", $ilIliasIniFile->readVariable("tools", "unzip"));
158  define("PATH_TO_GHOSTSCRIPT", $ilIliasIniFile->readVariable("tools", "ghostscript"));
159  define("PATH_TO_JAVA", $ilIliasIniFile->readVariable("tools", "java"));
160  define("URL_TO_LATEX", $ilIliasIniFile->readVariable("tools", "latex"));
161  define("PATH_TO_FOP", $ilIliasIniFile->readVariable("tools", "fop"));
162  define("PATH_TO_SCSS", $ilIliasIniFile->readVariable("tools", "scss"));
163  define("PATH_TO_PHANTOMJS", $ilIliasIniFile->readVariable("tools", "phantomjs"));
164 
165  if ($ilIliasIniFile->groupExists('error')) {
166  if ($ilIliasIniFile->variableExists('error', 'editor_url')) {
167  define("ERROR_EDITOR_URL", $ilIliasIniFile->readVariable('error', 'editor_url'));
168  }
169 
170  if ($ilIliasIniFile->variableExists('error', 'editor_path_translations')) {
171  define(
172  "ERROR_EDITOR_PATH_TRANSLATIONS",
173  $ilIliasIniFile->readVariable('error', 'editor_path_translations')
174  );
175  }
176  }
177 
178  // read virus scanner settings
179  switch ($ilIliasIniFile->readVariable("tools", "vscantype")) {
180  case "sophos":
181  define("IL_VIRUS_SCANNER", "Sophos");
182  define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
183  define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
184  break;
185 
186  case "antivir":
187  define("IL_VIRUS_SCANNER", "AntiVir");
188  define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
189  define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
190  break;
191 
192  case "clamav":
193  define("IL_VIRUS_SCANNER", "ClamAV");
194  define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
195  define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
196  break;
197  case "icap":
198  define("IL_VIRUS_SCANNER", "icap");
199  define("IL_ICAP_HOST", $ilIliasIniFile->readVariable("tools", "icap_host"));
200  define("IL_ICAP_PORT", $ilIliasIniFile->readVariable("tools", "icap_port"));
201  define("IL_ICAP_AV_COMMAND", $ilIliasIniFile->readVariable("tools", "icap_service_name"));
202  define("IL_ICAP_CLIENT", $ilIliasIniFile->readVariable("tools", "icap_client_path"));
203  break;
204 
205  default:
206  define("IL_VIRUS_SCANNER", "None");
207  define("IL_VIRUS_CLEAN_COMMAND", '');
208  break;
209  }
210 
212  define("IL_TIMEZONE", $tz);
213  }
214 
215  protected static function initResourceStorage(): void
216  {
217  global $DIC;
218  (new InitResourceStorage())->init($DIC);
219  }
220 
231  public static function bootstrapFilesystems(): void
232  {
233  global $DIC;
234 
235  $DIC['filesystem.security.sanitizing.filename'] = function (Container $c) {
237  $c->fileServiceSettings()
238  );
239  };
240 
241  $DIC['filesystem.factory'] = function ($c) {
242  return new \ILIAS\Filesystem\Provider\DelegatingFilesystemFactory($c['filesystem.security.sanitizing.filename']);
243  };
244 
245  $DIC['filesystem.web'] = function ($c) {
246  //web
247 
251  $delegatingFactory = $c['filesystem.factory'];
252  $webConfiguration = new \ILIAS\Filesystem\Provider\Configuration\LocalConfig(ILIAS_ABSOLUTE_PATH . '/' . ILIAS_WEB_DIR . '/' . CLIENT_ID);
253  return $delegatingFactory->getLocal($webConfiguration);
254  };
255 
256  $DIC['filesystem.storage'] = function ($c) {
257  //storage
258 
262  $delegatingFactory = $c['filesystem.factory'];
263  $storageConfiguration = new \ILIAS\Filesystem\Provider\Configuration\LocalConfig(ILIAS_DATA_DIR . '/' . CLIENT_ID);
264  return $delegatingFactory->getLocal($storageConfiguration);
265  };
266 
267  $DIC['filesystem.temp'] = function ($c) {
268  //temp
269 
273  $delegatingFactory = $c['filesystem.factory'];
274  $tempConfiguration = new \ILIAS\Filesystem\Provider\Configuration\LocalConfig(ILIAS_DATA_DIR . '/' . CLIENT_ID . '/temp');
275  return $delegatingFactory->getLocal($tempConfiguration);
276  };
277 
278  $DIC['filesystem.customizing'] = function ($c) {
279  //customizing
280 
284  $delegatingFactory = $c['filesystem.factory'];
285  $customizingConfiguration = new \ILIAS\Filesystem\Provider\Configuration\LocalConfig(ILIAS_ABSOLUTE_PATH . '/' . 'Customizing');
286  return $delegatingFactory->getLocal($customizingConfiguration);
287  };
288 
289  $DIC['filesystem.libs'] = function ($c) {
290  //customizing
291 
295  $delegatingFactory = $c['filesystem.factory'];
296  $customizingConfiguration = new \ILIAS\Filesystem\Provider\Configuration\LocalConfig(ILIAS_ABSOLUTE_PATH . '/' . 'libs');
297  return $delegatingFactory->getLocal($customizingConfiguration, true);
298  };
299 
300  $DIC['filesystem.node_modules'] = function ($c) {
301  //customizing
302 
306  $delegatingFactory = $c['filesystem.factory'];
307  $customizingConfiguration = new \ILIAS\Filesystem\Provider\Configuration\LocalConfig(ILIAS_ABSOLUTE_PATH . '/' . 'node_modules');
308  return $delegatingFactory->getLocal($customizingConfiguration, true);
309  };
310 
311  $DIC['filesystem'] = function ($c) {
312  return new \ILIAS\Filesystem\FilesystemsImpl(
313  $c['filesystem.storage'],
314  $c['filesystem.web'],
315  $c['filesystem.temp'],
316  $c['filesystem.customizing'],
317  $c['filesystem.libs'],
318  $c['filesystem.node_modules']
319  );
320  };
321  }
322 
329  public static function initFileUploadService(\ILIAS\DI\Container $dic): void
330  {
331  $dic['upload.processor-manager'] = function ($c) {
332  return new PreProcessorManagerImpl();
333  };
334 
335  $dic['upload'] = function (\ILIAS\DI\Container $c) {
336  $fileUploadImpl = new \ILIAS\FileUpload\FileUploadImpl(
337  $c['upload.processor-manager'],
338  $c['filesystem'],
339  $c['http']
340  );
341  if ((defined('IL_VIRUS_SCANNER') && IL_VIRUS_SCANNER != "None") || (defined('IL_SCANNER_TYPE') && IL_SCANNER_TYPE == "1")) {
342  $fileUploadImpl->register(new ilVirusScannerPreProcessor(ilVirusScannerFactory::_getInstance()));
343  }
344 
345  $fileUploadImpl->register(new FilenameSanitizerPreProcessor());
346  $fileUploadImpl->register(
348  $c->fileServiceSettings(),
349  $c->language()->txt("msg_info_blacklisted")
350  )
351  );
352  $fileUploadImpl->register(new InsecureFilenameSanitizerPreProcessor());
353  $fileUploadImpl->register(new SVGBlacklistPreProcessor(
354  $c->language()->txt("upload_svg_rejection_message"),
355  $c->language()->txt("upload_svg_rejection_message_script"),
356  $c->language()->txt("upload_svg_rejection_message_base64"),
357  $c->language()->txt("upload_svg_rejection_message_elements")
358  ));
359 
360  return $fileUploadImpl;
361  };
362  }
363 
364  protected static function initUploadPolicies(\ILIAS\DI\Container $dic): void
365  {
366  $dic['upload_policy_repository'] = static function ($dic) {
367  return new UploadPolicyDBRepository($dic->database());
368  };
369 
370  $dic['upload_policy_resolver'] = static function ($dic): UploadPolicyResolver {
371  return new UploadPolicyResolver(
372  $dic->rbac()->review(),
373  $dic->user(),
374  $dic['upload_policy_repository']->getAll(),
375  );
376  };
377  }
378 
382  protected static function buildHTTPPath(): bool
383  {
384  global $DIC;
385 
386  if ($DIC['https']->isDetected()) {
387  $protocol = 'https://';
388  } else {
389  $protocol = 'http://';
390  }
391  $host = $_SERVER['HTTP_HOST'];
392 
393  $rq_uri = strip_tags($_SERVER['REQUEST_URI']);
394 
395  // security fix: this failed, if the URI contained "?" and following "/"
396  // -> we remove everything after "?"
397  if (is_int($pos = strpos($rq_uri, "?"))) {
398  $rq_uri = substr($rq_uri, 0, $pos);
399  }
400 
401  if (!defined('ILIAS_MODULE')) {
402  $path = pathinfo($rq_uri);
403  if (isset($path['extension']) && $path['extension'] !== '') {
404  $uri = dirname($rq_uri);
405  } else {
406  $uri = $rq_uri;
407  }
408  } else {
409  // if in module remove module name from HTTP_PATH
410  $path = dirname($rq_uri);
411 
412  // dirname cuts the last directory from a directory path e.g content/classes return content
414 
415  $dirs = explode('/', $module);
416  $uri = $path;
417  foreach ($dirs as $dir) {
418  $uri = dirname($uri);
419  }
420  }
421 
422  $ilias_http_path = ilContext::modifyHttpPath(implode('', [$protocol, $host, $uri]));
423 
424  // remove everything after the first .php in the path
425  $ilias_http_path = preg_replace('/(http|https)(:\/\/)(.*?\/.*?\.php).*/', '$1$2$3', $ilias_http_path);
426  $ilias_http_path = preg_replace('/goto.php\/$/', '', $ilias_http_path);
427  $ilias_http_path = preg_replace('/goto.php$/', '', $ilias_http_path);
428  $ilias_http_path = preg_replace('/go\/.*$/', '', $ilias_http_path);
429 
430  $f = new \ILIAS\Data\Factory();
431  $uri = $f->uri(ilFileUtils::removeTrailingPathSeparators($ilias_http_path));
432 
433  $base_URI = $uri->getBaseURI();
434 
435  return define('ILIAS_HTTP_PATH', $base_URI);
436  }
437 
442  protected static function determineClient(): void
443  {
444  if (defined('CLIENT_ID')) {
445  return;
446  }
447  global $DIC;
448  $df = new \ILIAS\Data\Factory();
449 
450  // check whether ini file object exists
451  if (!$DIC->isDependencyAvailable('iliasIni')) {
452  self::abortAndDie('Fatal Error: ilInitialisation::determineClient called without initialisation of ILIAS ini file object.');
453  }
454 
455  $in_unit_tests = defined('IL_PHPUNIT_TEST');
456  $context_supports_persitent_session = ilContext::supportsPersistentSessions();
457  $can_set_cookie = !$in_unit_tests && $context_supports_persitent_session;
458  $has_request_client_id = $DIC->http()->wrapper()->query()->has('client_id');
459  $has_cookie_client_id = $DIC->http()->cookieJar()->has('ilClientId');
460 
461  // determine the available clientIds (default, request, cookie)
462  $default_client_id = $DIC->iliasIni()->readVariable('clients', 'default');
463 
464  if ($DIC->http()->wrapper()->query()->has('client_id')) {
465  $client_id_from_get = $DIC->http()->wrapper()->query()->retrieve(
466  'client_id',
467  self::getClientIdTransformation()
468  );
469  }
470  if ($DIC->http()->wrapper()->cookie()->has('ilClientId')) {
471  $client_id_from_cookie = $DIC->http()->wrapper()->cookie()->retrieve(
472  'ilClientId',
473  self::getClientIdTransformation()
474  );
475  }
476 
477  // set the clientId by availability: 1. request, 2. cookie, fallback to defined default
478  $client_id_to_use = '';
479  if (isset($client_id_from_get) && $client_id_from_get !== '') {
480  $client_id_to_use = $client_id_from_get;
481  }
482  // we found a client_id in $GET
483  if (isset($client_id_from_get) && strlen($client_id_from_get) > 0) {
484  // @todo refinery undefined
485  $client_id_to_use = $_GET['client_id'] = $df->clientId($client_id_from_get)->toString();
486  if ($can_set_cookie) {
487  ilUtil::setCookie('ilClientId', $client_id_to_use);
488  }
489  } else {
490  $client_id_to_use = $default_client_id;
491  if (!isset($_COOKIE['ilClientId'])) {
492  ilUtil::setCookie('ilClientId', $client_id_to_use);
493  }
494  }
495 
496  $client_id_to_use = $client_id_to_use ?: $default_client_id;
497 
498  define('CLIENT_ID', $df->clientId($client_id_to_use)->toString());
499  }
500 
501 
508  private static function getClientIdTransformation(): Transformation
509  {
510  return new class () implements Transformation {
514  public function transform($from): string
515  {
516  if (!is_string($from)) {
517  throw new InvalidArgumentException(__METHOD__ . " the argument is not a string.");
518  }
519  return strip_tags($from);
520  }
521 
525  public function applyTo(Result $result): Result
526  {
527  return $result->then(function ($value): Result {
528  try {
529  return new Ok($this->transform($value));
530  } catch (Exception $exception) {
531  return new Error($exception);
532  }
533  });
534  }
535 
539  public function __invoke($from): string
540  {
541  return $this->transform($from);
542  }
543  };
544  }
545 
555  protected static function initClientIniFile(): void
556  {
557  global $ilIliasIniFile;
558 
559  // check whether ILIAS_WEB_DIR is set.
560  if (ILIAS_WEB_DIR == "") {
561  self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile called without ILIAS_WEB_DIR.");
562  }
563 
564  // check whether CLIENT_ID is set.
565  if (CLIENT_ID == "") {
566  self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile called without CLIENT_ID.");
567  }
568 
569  $ini_file = "/client.ini.php";
570  if (defined('CLIENT_WEB_DIR')) {
571  $ini_file = CLIENT_WEB_DIR . $ini_file;
572  } else {
573  $ini_file = "./" . ILIAS_WEB_DIR . "/" . CLIENT_ID . "/client.ini.php";
574  }
575 
576  // get settings from ini file
577  $ilClientIniFile = new ilIniFile($ini_file);
578  $ilClientIniFile->read();
579 
580  // invalid client id / client ini
581  if ($ilClientIniFile->ERROR != "") {
582  $default_client = $ilIliasIniFile->readVariable("clients", "default");
583  if (CLIENT_ID !== "") {
584  $mess = array("en" => "Client does not exist.",
585  "de" => "Mandant ist ungültig."
586  );
587  self::redirect("index.php?client_id=" . $default_client, '', $mess);
588  } else {
589  self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile initializing client ini file abborted with: " . $ilClientIniFile->ERROR);
590  }
591  }
592 
593  self::initGlobal("ilClientIniFile", $ilClientIniFile);
594  // set constants
595  define("DEVMODE", (int) $ilClientIniFile->readVariable("system", "DEVMODE"));
596  define("SHOWNOTICES", (int) $ilClientIniFile->readVariable("system", "SHOWNOTICES"));
597  if (!defined("ROOT_FOLDER_ID")) {
598  define("ROOT_FOLDER_ID", (int) $ilClientIniFile->readVariable('system', 'ROOT_FOLDER_ID'));
599  }
600  if (!defined("SYSTEM_FOLDER_ID")) {
601  define("SYSTEM_FOLDER_ID", (int) $ilClientIniFile->readVariable('system', 'SYSTEM_FOLDER_ID'));
602  }
603  if (!defined("ROLE_FOLDER_ID")) {
604  define("ROLE_FOLDER_ID", (int) $ilClientIniFile->readVariable('system', 'ROLE_FOLDER_ID'));
605  }
606  define("MAIL_SETTINGS_ID", (int) $ilClientIniFile->readVariable('system', 'MAIL_SETTINGS_ID'));
607  $error_handler = $ilClientIniFile->readVariable('system', 'ERROR_HANDLER');
608  define("ERROR_HANDLER", $error_handler ?: "PRETTY_PAGE");
609 
610  // this is for the online help installation, which sets OH_REF_ID to the
611  // ref id of the online module
612  define("OH_REF_ID", (int) $ilClientIniFile->readVariable("system", "OH_REF_ID"));
613 
614  // see ilObject::TITLE_LENGTH, ilObject::DESC_LENGTH
615  // define ("MAXLENGTH_OBJ_TITLE",125);#$ilClientIniFile->readVariable('system','MAXLENGTH_OBJ_TITLE'));
616  // define ("MAXLENGTH_OBJ_DESC",$ilClientIniFile->readVariable('system','MAXLENGTH_OBJ_DESC'));
617 
618  if (!defined("CLIENT_DATA_DIR")) {
619  define("CLIENT_DATA_DIR", ILIAS_DATA_DIR . "/" . CLIENT_ID);
620  }
621  if (!defined("CLIENT_WEB_DIR")) {
622  define("CLIENT_WEB_DIR", ILIAS_ABSOLUTE_PATH . "/" . ILIAS_WEB_DIR . "/" . CLIENT_ID);
623  }
624  define("CLIENT_NAME", $ilClientIniFile->readVariable('client', 'name')); // Change SS
625 
626  $db_type = $ilClientIniFile->readVariable("db", "type");
627  if ($db_type === "") {
628  define("IL_DB_TYPE", ilDBConstants::TYPE_INNODB);
629  } else {
630  define("IL_DB_TYPE", $db_type);
631  }
632  }
633 
637  protected static function handleMaintenanceMode(): void
638  {
639  global $ilClientIniFile;
640 
641  if (!$ilClientIniFile->readVariable("client", "access")) {
642  $mess = array(
643  "en" => "The server is not available due to maintenance." .
644  " We apologise for any inconvenience.",
645  "de" => "Der Server ist aufgrund von Wartungsarbeiten aktuell nicht verf&uuml;gbar." .
646  " Wir bitten um Verst&auml;ndnis. Versuchen Sie es sp&auml;ter noch einmal."
647  );
648  $mess_id = "init_error_maintenance";
649 
650  if (ilContext::hasHTML() && is_file("./maintenance.html")) {
651  self::redirect("./maintenance.html", $mess_id, $mess);
652  } else {
653  $mess = self::translateMessage($mess_id, $mess);
654  self::abortAndDie($mess);
655  }
656  }
657  }
658 
662  protected static function initDatabase(): void
663  {
664  // build dsn of database connection and connect
666  $ilDB->initFromIniFile();
667  $ilDB->connect();
668 
669  self::initGlobal("ilDB", $ilDB);
670  }
671 
672  protected static function initGlobalCache(): void
673  {
674  global $DIC;
675  $legacy_settings = new ilGlobalCacheSettingsAdapter(
676  $DIC->clientIni(),
677  $DIC->database(),
678  );
679  $DIC['global_cache'] = new \ILIAS\Cache\Services(
680  $legacy_settings->getConfig()
681  );
682  }
683 
688  public static function setSessionHandler(): void
689  {
690  $db_session_handler = new ilSessionDBHandler();
691  if (!$db_session_handler->setSaveHandler()) {
692  self::abortAndDie("Cannot start session handling.");
693  }
694 
695  // Do not accept external session ids
696  if (!ilSession::_exists(session_id()) && !defined('IL_PHPUNIT_TEST')) {
697  // php7-todo, correct-with-php5-removal : alex, 1.3.2016: added if, please check
698  if (function_exists("session_status") && session_status() == PHP_SESSION_ACTIVE) {
699  session_regenerate_id();
700  }
701  }
702  }
703 
707  protected static function setCookieConstants(): void
708  {
710  $cookie_path = '/';
711  } elseif (isset($GLOBALS['COOKIE_PATH'])) {
712  // use a predefined cookie path from WebAccessChecker
713  $cookie_path = $GLOBALS['COOKIE_PATH'];
714  } else {
715  $cookie_path = dirname($_SERVER['SCRIPT_NAME']);
716  }
717 
718  /* if ilias is called directly within the docroot $cookie_path
719  is set to '/' expecting on servers running under windows..
720  here it is set to '\'.
721  in both cases a further '/' won't be appended due to the following regex
722  */
723  $cookie_path .= (!preg_match("/[\/|\\\\]$/", $cookie_path)) ? "/" : "";
724 
725  if ($cookie_path == "\\") {
726  $cookie_path = '/';
727  }
728 
729  define('IL_COOKIE_HTTPONLY', true); // Default Value
730  define('IL_COOKIE_EXPIRE', 0);
731  define('IL_COOKIE_DOMAIN', '');
732  if (!defined('IL_COOKIE_PATH')) {
733  // Might be already defined by ./sso/index.php or other scripts (like those in ./Services/SAML/lib/*)
734  define('IL_COOKIE_PATH', $cookie_path);
735  }
736  }
737 
738  private static function setClientIdCookie(): void
739  {
740  if (defined('CLIENT_ID') &&
741  !defined('IL_PHPUNIT_TEST') &&
743  ilUtil::setCookie('ilClientId', CLIENT_ID);
744  }
745  }
746 
750  protected static function setSessionCookieParams(): void
751  {
752  global $ilSetting, $DIC;
753 
754  if (!defined('IL_COOKIE_SECURE')) {
755  // If this code is executed, we can assume that \ilHTTPS::enableSecureCookies was NOT called before
756  // \ilHTTPS::enableSecureCookies already executes session_set_cookie_params()
757 
758  $cookie_secure = !$ilSetting->get('https', '0') && $DIC['https']->isDetected();
759  define('IL_COOKIE_SECURE', $cookie_secure); // Default Value
760 
761  $cookie_parameters = [
762  'lifetime' => IL_COOKIE_EXPIRE,
763  'path' => IL_COOKIE_PATH,
764  'domain' => IL_COOKIE_DOMAIN,
765  'secure' => IL_COOKIE_SECURE,
766  'httponly' => IL_COOKIE_HTTPONLY,
767  ];
768 
769  if (
770  $cookie_secure &&
771  (!isset(session_get_cookie_params()['samesite']) || strtolower(session_get_cookie_params()['samesite']) !== 'strict')
772  ) {
773  $cookie_parameters['samesite'] = 'Lax';
774  }
775 
776  session_set_cookie_params($cookie_parameters);
777  }
778  }
779 
780  protected static function initCron(\ILIAS\DI\Container $c): void
781  {
782  $c['cron.repository'] = static function (\ILIAS\DI\Container $c): ilCronJobRepository {
783  return new ilCronJobRepositoryImpl(
784  $c->database(),
785  $c->settings(),
786  $c->logger()->cron(),
787  $c['component.repository'],
788  $c['component.factory']
789  );
790  };
791 
792  $c['cron.manager'] = static function (\ILIAS\DI\Container $c): ilCronManager {
793  return new ilCronManagerImpl(
794  $c['cron.repository'],
795  $c->database(),
796  $c->settings(),
797  $c->logger()->cron(),
798  (new \ILIAS\Data\Factory())->clock()
799  );
800  };
801  }
802 
806  protected static function initCustomObjectIcons(\ILIAS\DI\Container $c): void
807  {
808  $c["object.customicons.factory"] = function ($c) {
809  return new ilObjectCustomIconFactory(
810  $c->filesystem()->web(),
811  $c->upload(),
812  $c['ilObjDataCache']
813  );
814  };
815  }
816 
817  protected static function initAvatar(\ILIAS\DI\Container $c): void
818  {
819  $c["user.avatar.factory"] = function ($c) {
820  return new \ilUserAvatarFactory($c);
821  };
822  }
823 
824  protected static function initLegalDocuments(Container $c): void
825  {
826  $c['legalDocuments'] = static fn(Container $c) => new Conductor($c);
827  }
828 
829  protected static function initAccessibilityControlConcept(\ILIAS\DI\Container $c): void
830  {
831  $c['acc.criteria.type.factory'] = function (\ILIAS\DI\Container $c) {
832  return new ilAccessibilityCriterionTypeFactory($c->rbac()->review(), $c['ilObjDataCache']);
833  };
834 
835  $c['acc.document.evaluator'] = function (\ILIAS\DI\Container $c) {
838  $c['acc.criteria.type.factory'],
839  $c->user(),
840  $c->logger()->acc()
841  ),
842  $c->user(),
843  $c->logger()->acc(),
844  \ilAccessibilityDocument::orderBy('sorting')->get()
845  );
846  };
847  }
848 
853  protected static function initSettings(): void
854  {
855  global $ilSetting;
856 
857  self::initGlobal(
858  "ilSetting",
859  "ilSetting",
860  "Services/Administration/classes/class.ilSetting.php"
861  );
862 
863  // check correct setup
864  if (!$ilSetting->get("setup_ok")) {
865  self::abortAndDie("Setup is not completed. Please run setup routine again.");
866  }
867 
868  // set anonymous user & role id and system role id
869  define("ANONYMOUS_USER_ID", (int) $ilSetting->get("anonymous_user_id"));
870  define("ANONYMOUS_ROLE_ID", (int) $ilSetting->get("anonymous_role_id"));
871  define("SYSTEM_USER_ID", (int) $ilSetting->get("system_user_id"));
872  define("SYSTEM_ROLE_ID", (int) $ilSetting->get("system_role_id"));
873  define("USER_FOLDER_ID", 7);
874 
875  // recovery folder
876  define("RECOVERY_FOLDER_ID", (int) $ilSetting->get("recovery_folder_id"));
877 
878  // installation id
879  define("IL_INST_ID", $ilSetting->get("inst_id", '0'));
880 
881  // define default suffix replacements
882  define("SUFFIX_REPL_DEFAULT", "php,php3,php4,inc,lang,phtml,htaccess");
883  define("SUFFIX_REPL_ADDITIONAL", $ilSetting->get("suffix_repl_additional", ""));
884 
885  if (ilContext::usesHTTP()) {
886  self::buildHTTPPath();
887  }
888  }
889 
893  protected static function initStyle(): void
894  {
895  global $DIC;
896  $component_factory = $DIC["component.factory"];
897 
898  // load style definitions
899  self::initGlobal(
900  "styleDefinition",
901  "ilStyleDefinition",
902  "./Services/Style/System/classes/class.ilStyleDefinition.php"
903  );
904 
905  // add user interface hook for style initialisation
906  foreach ($component_factory->getActivePluginsInSlot("uihk") as $ui_plugin) {
907  $gui_class = $ui_plugin->getUIClassInstance();
908  $gui_class->modifyGUI("Services/Init", "init_style", array("styleDefinition" => $DIC->systemStyle()));
909  }
910  }
911 
915  public static function initUserAccount(): void
916  {
917  global $DIC;
918 
919  static $context_init;
920 
921  $uid = $GLOBALS['DIC']['ilAuthSession']->getUserId();
922  if ($uid) {
923  $DIC->user()->setId($uid);
924  $DIC->user()->read();
925  if (!isset($context_init)) {
926  if ($DIC->user()->isAnonymous()) {
927  $DIC->globalScreen()->tool()->context()->claim()->external();
928  } else {
929  $DIC->globalScreen()->tool()->context()->claim()->internal();
930  }
931  $context_init = true;
932  }
933  // init console log handler
934  ilLoggerFactory::getInstance()->initUser($DIC->user()->getLogin());
935  \ilOnlineTracking::updateAccess($DIC->user());
936  } else {
937  if (is_object($GLOBALS['ilLog'])) {
938  $GLOBALS['ilLog']->logStack();
939  }
940  self::abortAndDie("Init user account failed");
941  }
942  }
943 
947  protected static function initLocale(): void
948  {
949  global $ilSetting;
950 
951  if ($ilSetting->get("locale") && trim($ilSetting->get("locale")) !== "") {
952  $larr = explode(",", trim($ilSetting->get("locale")));
953  $ls = array();
954  $first = $larr[0];
955  foreach ($larr as $l) {
956  if (trim($l) != "") {
957  $ls[] = $l;
958  }
959  }
960  if (count($ls) > 0) {
961  setlocale(LC_ALL, $ls);
962 
963  // #15347 - making sure that floats are not changed
964  setlocale(LC_NUMERIC, "C");
965  }
966  }
967  }
968 
972  public static function goToPublicSection(): void
973  {
974  global $DIC;
975 
976  if (ANONYMOUS_USER_ID == "") {
977  self::abortAndDie("Public Section enabled, but no Anonymous user found.");
978  }
979 
980  $session_destroyed = false;
981  if ($DIC['ilAuthSession']->isExpired()) {
982  $session_destroyed = true;
984  }
985  if (!$DIC['ilAuthSession']->isAuthenticated()) {
986  $session_destroyed = true;
988  }
989 
990  if ($session_destroyed) {
991  $GLOBALS['DIC']['ilAuthSession']->setAuthenticated(true, ANONYMOUS_USER_ID);
992  }
993 
994  self::initUserAccount();
995 
996  $target = '';
997  if ($DIC->http()->wrapper()->query()->has('target')) {
998  $target = $DIC->http()->wrapper()->query()->retrieve(
999  'target',
1000  $DIC->refinery()->kindlyTo()->string()
1001  );
1002  }
1003 
1004  // if target given, try to go there
1005  if (strlen($target)) {
1006  // when we are already "inside" goto.php no redirect is needed
1007  $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
1008  if ($current_script == "goto.php") {
1009  return;
1010  }
1011  // goto will check if target is accessible or redirect to login
1012  self::redirect("goto.php?target=" . $target);
1013  }
1014 
1015  // we do not know if ref_id of request is accesible, so redirecting to root
1016  self::redirect(
1017  "ilias.php?baseClass=ilrepositorygui&reloadpublic=1&cmd=&ref_id=" . (defined(
1018  'ROOT_FOLDER_ID'
1019  ) ? (string) ROOT_FOLDER_ID : '0')
1020  );
1021  }
1022 
1026  protected static function goToLogin(): void
1027  {
1028  global $DIC;
1029 
1030  $session_expired = false;
1031  ilLoggerFactory::getLogger('init')->debug('Redirecting to login page.');
1032 
1033  if ($DIC['ilAuthSession']->isExpired()) {
1035  $session_expired = true;
1036  }
1037  if (!$DIC['ilAuthSession']->isAuthenticated()) {
1039  }
1040 
1041  $target = $DIC->http()->wrapper()->query()->has('target')
1042  ? $DIC->http()->wrapper()->query()->retrieve(
1043  'target',
1044  $DIC->refinery()->kindlyTo()->string()
1045  )
1046  : '';
1047 
1048  if (strlen($target)) {
1049  $target = "target=" . $target . "&";
1050  }
1051 
1052  $client_id = $DIC->http()->wrapper()->cookie()->retrieve(
1053  'ilClientId',
1054  $DIC->refinery()->byTrying([
1055  $DIC->refinery()->kindlyTo()->string(),
1056  $DIC->refinery()->always('')
1057  ])
1058  );
1059  $script = "login.php?" . $target . "client_id=" . $client_id;
1060  $script .= $session_expired ? "&session_expired=1" : "";
1061 
1062  self::redirect(
1063  $script,
1064  "init_error_authentication_fail",
1065  array(
1066  "en" => "Authentication failed.",
1067  "de" => "Authentifizierung fehlgeschlagen."
1068  )
1069  );
1070  }
1071 
1075  protected static function initLanguage(bool $a_use_user_language = true): void
1076  {
1077  global $DIC;
1078 
1082  global $rbacsystem;
1083 
1084  if ($a_use_user_language) {
1085  if ($DIC->offsetExists('lng')) {
1086  $DIC->offsetUnset('lng');
1087  }
1088  self::initGlobal('lng', ilLanguage::getGlobalInstance());
1089  //re-init refinery with the user's language
1090  unset($DIC['refinery']);
1091  self::initRefinery($DIC);
1092  } else {
1093  self::initGlobal('lng', ilLanguage::getFallbackInstance());
1094  }
1095  if (is_object($rbacsystem) && $DIC->offsetExists('tree')) {
1096  $rbacsystem->initMemberView();
1097  }
1098  }
1099 
1103  protected static function initAccessHandling(): void
1104  {
1105  self::initGlobal(
1106  'rbacreview',
1107  'ilRbacReview',
1108  './Services/AccessControl/classes/class.ilRbacReview.php',
1109  true
1110  );
1111 
1112  $rbacsystem = ilRbacSystem::getInstance();
1113  self::initGlobal('rbacsystem', $rbacsystem, null, true);
1114 
1115  self::initGlobal(
1116  'rbacadmin',
1117  'ilRbacAdmin',
1118  './Services/AccessControl/classes/class.ilRbacAdmin.php',
1119  true
1120  );
1121 
1122  self::initGlobal(
1123  'ilAccess',
1124  'ilAccess',
1125  './Services/AccessControl/classes/class.ilAccess.php',
1126  true
1127  );
1128  }
1129 
1133  protected static function initLog(): void
1134  {
1136 
1137  self::initGlobal("ilLog", $log);
1138  // deprecated
1139  self::initGlobal("log", $log);
1140  }
1141 
1145  protected static function initGlobal(
1146  string $a_name,
1147  $a_class,
1148  ?string $a_source_file = null,
1149  ?bool $destroy_existing = false
1150  ): void {
1151  global $DIC;
1152 
1153  if ($destroy_existing) {
1154  if (isset($GLOBALS[$a_name])) {
1155  unset($GLOBALS[$a_name]);
1156  }
1157  if (isset($DIC[$a_name])) {
1158  unset($DIC[$a_name]);
1159  }
1160  }
1161 
1162  $GLOBALS[$a_name] = is_object($a_class) ? $a_class : new $a_class();
1163 
1164  $DIC[$a_name] = static function (Container $c) use ($a_name) {
1165  return $GLOBALS[$a_name];
1166  };
1167  }
1168 
1169  protected static function abortAndDie(string $a_message): void
1170  {
1171  if (isset($GLOBALS['ilLog'])) {
1172  $GLOBALS['ilLog']->write("Fatal Error: ilInitialisation - " . $a_message);
1173  $GLOBALS['ilLog']->logStack();
1174  }
1175  die($a_message);
1176  }
1177 
1181  protected static function handleDevMode(): void
1182  {
1183  error_reporting(-1);
1184  }
1185 
1186  protected static bool $already_initialized = false;
1187 
1188  public static function reinitILIAS(): void
1189  {
1190  self::$already_initialized = false;
1191  self::initILIAS();
1192  }
1193 
1194  public static function reInitUser(): void
1195  {
1197  self::initSession();
1198  self::initUser();
1199 
1201  self::resumeUserSession();
1202  }
1203  }
1204  }
1205 
1209  public static function initILIAS(): void
1210  {
1211  if (self::$already_initialized) {
1212  return;
1213  }
1214 
1215  $GLOBALS["DIC"] = new Container();
1216  $GLOBALS["DIC"]["ilLoggerFactory"] = function ($c) {
1218  };
1219 
1220  self::$already_initialized = true;
1221 
1222  self::initCore();
1223  self::initHTTPServices($GLOBALS["DIC"]);
1224  if (ilContext::initClient()) {
1225  self::initFileUploadService($GLOBALS["DIC"]);
1226  Init::init($GLOBALS["DIC"]);
1227  self::initClient();
1228  self::initSession();
1229 
1230  if (ilContext::hasUser()) {
1231  self::initUser();
1232 
1234  self::resumeUserSession();
1235  }
1236  }
1237 
1238  // init after Auth otherwise breaks CAS
1239  self::includePhp5Compliance();
1240 
1241  // language may depend on user setting
1242  self::initLanguage(true);
1243  $GLOBALS['DIC']['tree']->initLangCode();
1244 
1245  self::initInjector($GLOBALS['DIC']);
1246  self::initBackgroundTasks($GLOBALS['DIC']);
1247  self::initKioskMode($GLOBALS['DIC']);
1248 
1249  if (ilContext::hasHTML()) {
1250  self::initHTML();
1251  }
1252  }
1253 
1254  // this MUST happen after everything else is initialized,
1255  // because this leads to rather unexpected behaviour which
1256  // is super hard to track down to this.
1257  self::replaceSuperGlobals($GLOBALS['DIC']);
1258  }
1259 
1263  protected static function initSession(): void
1264  {
1265  if (isset($GLOBALS['DIC']['ilAuthSession'])) {
1266  unset($GLOBALS['DIC']['ilAuthSession']);
1267  }
1268 
1269  $GLOBALS['DIC']['ilAuthSession'] = static function (Container $c): ilAuthSession {
1270  $auth_session = ilAuthSession::getInstance(
1271  $c['ilLoggerFactory']->getLogger('auth')
1272  );
1273  $auth_session->init();
1274  return $auth_session;
1275  };
1276  }
1277 
1281  public static function handleErrorReporting(): void
1282  {
1283  // push the error level as high as possible / sane
1284  error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
1285 
1286  // see handleDevMode() - error reporting might be overwritten again
1287  // but we need the client ini first
1288  }
1289 
1293  protected static function initCore(): void
1294  {
1295  global $ilErr;
1296 
1297  self::handleErrorReporting();
1298 
1299  // breaks CAS: must be included after CAS context isset in AuthUtils
1300  //self::includePhp5Compliance();
1301 
1302  self::requireCommonIncludes();
1303 
1304  $GLOBALS["DIC"]["ilias.version"] = (new ILIAS\Data\Factory())->version(ILIAS_VERSION_NUMERIC);
1305 
1306  // error handler
1307  self::initGlobal(
1308  "ilErr",
1309  "ilErrorHandling",
1310  "./Services/Init/classes/class.ilErrorHandling.php"
1311  );
1312 
1313  self::removeUnsafeCharacters();
1314 
1315  self::initIliasIniFile();
1316 
1317  define('IL_INITIAL_WD', getcwd());
1318 
1319  // deprecated
1320  self::initGlobal("ilias", "ILIAS", "./Services/Init/classes/class.ilias.php");
1321  }
1322 
1326  protected static function initClient(): void
1327  {
1328  global $https, $ilias, $DIC;
1329 
1330  self::setCookieConstants();
1331 
1332  self::determineClient();
1333 
1334  self::bootstrapFilesystems();
1335 
1336  self::initResourceStorage();
1337 
1338  self::initClientIniFile();
1339 
1340  // --- needs client ini
1341 
1342  $ilias->client_id = (string) CLIENT_ID;
1343 
1344  if (DEVMODE) {
1345  self::handleDevMode();
1346  }
1347 
1348  self::handleMaintenanceMode();
1349 
1350  self::initDatabase();
1351 
1352  self::initGlobalCache();
1353 
1354  self::initComponentService($DIC);
1355 
1356  // init dafault language
1357  self::initLanguage(false);
1358 
1359  // moved after databases
1360  self::initLog();
1361 
1362  self::initGlobal(
1363  "ilAppEventHandler",
1364  "ilAppEventHandler",
1365  "./Services/EventHandling/classes/class.ilAppEventHandler.php"
1366  );
1367 
1368  // there are rare cases where initILIAS is called twice for a request
1369  // example goto.php is called and includes ilias.php later
1370  // we must prevent that ilPluginAdmin is initialized twice in
1371  // this case, since this won't get the values out of plugin.php the
1372  // second time properly
1373  if (!isset($DIC["ilPluginAdmin"]) || !$DIC["ilPluginAdmin"] instanceof ilPluginAdmin) {
1374  self::initGlobal(
1375  "ilPluginAdmin",
1376  new ilPluginAdmin($DIC["component.repository"]),
1377  "./Services/Component/classes/class.ilPluginAdmin.php"
1378  );
1379  }
1380  self::initGlobal("https", "ilHTTPS", "./Services/Http/classes/class.ilHTTPS.php");
1381  self::initSettings();
1382  self::setSessionHandler();
1383  self::initCron($GLOBALS['DIC']);
1384  self::initAvatar($GLOBALS['DIC']);
1385  self::initCustomObjectIcons($GLOBALS['DIC']);
1386  self::initLegalDocuments($GLOBALS['DIC']);
1387  self::initAccessibilityControlConcept($GLOBALS['DIC']);
1388 
1389  // --- needs settings
1390 
1391  self::initLocale();
1392 
1393  if (ilContext::usesHTTP()) {
1394  $https->enableSecureCookies();
1395  $https->checkProtocolAndRedirectIfNeeded();
1396  }
1397 
1398  // --- object handling
1399 
1400  self::initGlobal(
1401  "ilObjDataCache",
1402  "ilObjectDataCache",
1403  "./Services/Object/classes/class.ilObjectDataCache.php"
1404  );
1405 
1406  self::initGlobal(
1407  "objDefinition",
1408  "ilObjectDefinition",
1409  "./Services/Object/classes/class.ilObjectDefinition.php"
1410  );
1411 
1412  // $tree
1413  $tree = new ilTree(ROOT_FOLDER_ID);
1414  self::initGlobal("tree", $tree);
1415  unset($tree);
1416 
1417  self::setSessionCookieParams();
1418  self::setClientIdCookie();
1419 
1420  self::initRefinery($DIC);
1421 
1422  (new InitCtrlService())->init($DIC);
1423 
1424  // Init GlobalScreen
1425  self::initGlobalScreen($DIC);
1426  }
1427 
1431  protected static function initUser(): void
1432  {
1433  global $ilias, $ilUser;
1434 
1435  // $ilUser
1436  self::initGlobal(
1437  "ilUser",
1439  "./Services/User/classes/class.ilObjUser.php",
1440  true
1441  );
1442  $ilias->account = $ilUser;
1443 
1444  self::initAccessHandling();
1445  }
1446 
1450  public static function resumeUserSession(): void
1451  {
1452  global $DIC;
1453 
1456  }
1457 
1458  if (
1459  !$DIC['ilAuthSession']->isAuthenticated() or
1460  $DIC['ilAuthSession']->isExpired()
1461  ) {
1462  if ($GLOBALS['DIC']['ilAuthSession']->isExpired()) {
1464  }
1465  ilLoggerFactory::getLogger('init')->debug('Current session is invalid: ' . $GLOBALS['DIC']['ilAuthSession']->getId());
1466  $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
1467  if (self::blockedAuthentication($current_script)) {
1468  ilLoggerFactory::getLogger('init')->debug('Authentication is started in current script.');
1469  // nothing todo: authentication is done in current script
1470  return;
1471  }
1472 
1473  self::handleAuthenticationFail();
1474  return;
1475  }
1476  // valid session
1477 
1478  self::initUserAccount();
1479  }
1480 
1484  protected static function handleAuthenticationSuccess(): void
1485  {
1489  global $ilUser;
1490 
1492  }
1493 
1497  protected static function handleAuthenticationFail(): void
1498  {
1499  global $DIC;
1500 
1501  ilLoggerFactory::getLogger('init')->debug('Handling of failed authentication.');
1502 
1503  // #10608
1504  if (
1507  throw new Exception("Authentication failed.");
1508  }
1509 
1510  if (($DIC->http()->request()->getQueryParams()['cmdMode'] ?? 0) === 'asynch') {
1511  $DIC->language()->loadLanguageModule('init');
1512  $DIC->http()->saveResponse(
1513  $DIC->http()->response()
1514  ->withStatus(403)
1515  ->withBody(Streams::ofString($DIC->language()->txt('init_error_authentication_fail')))
1516  );
1517  $DIC->http()->sendResponse();
1518  $DIC->http()->close();
1519  }
1520  if (
1521  $DIC['ilAuthSession']->isExpired() &&
1522  !\ilObjUser::_isAnonymous($DIC['ilAuthSession']->getUserId())
1523  ) {
1524  ilLoggerFactory::getLogger('init')->debug('Expired session found -> redirect to login page');
1525  self::goToLogin();
1526  return;
1527  }
1528  if (ilPublicSectionSettings::getInstance()->isEnabledForDomain($_SERVER['SERVER_NAME']) &&
1529  $DIC->access()->checkAccessOfUser(ANONYMOUS_USER_ID, 'read', '', ROOT_FOLDER_ID)) {
1530  ilLoggerFactory::getLogger('init')->debug('Redirect to public section.');
1531  self::goToPublicSection();
1532  return;
1533  }
1534  ilLoggerFactory::getLogger('init')->debug('Redirect to login page.');
1535  self::goToLogin();
1536  }
1537 
1541  protected static function initHTTPServices(\ILIAS\DI\Container $container): void
1542  {
1543  $init_http = new InitHttpServices();
1544  $init_http->init($container);
1545 
1546  \ILIAS\StaticURL\Init::init($container);
1547  }
1548 
1552  private static function initGlobalScreen(\ILIAS\DI\Container $c): void
1553  {
1554  $c['global_screen'] = function () use ($c) {
1555  return new Services(
1556  new ilGSProviderFactory($c),
1557  $c->ui(),
1558  htmlentities(str_replace([" ", ".", "-"], "_", ILIAS_VERSION_NUMERIC))
1559  );
1560  };
1561  $c->globalScreen()->tool()->context()->stack()->clear();
1562  $c->globalScreen()->tool()->context()->claim()->main();
1563  }
1564 
1568  public static function initUIFramework(\ILIAS\DI\Container $c): void
1569  {
1570  $init_ui = new InitUIFramework();
1571  $init_ui->init($c);
1572 
1573  $component_repository = $c["component.repository"];
1574  $component_factory = $c["component.factory"];
1575  foreach ($component_repository->getPlugins() as $pl) {
1576  if (!$pl->isActive()) {
1577  continue;
1578  }
1579  $plugin = $component_factory->getPlugin($pl->getId());
1580  $c['ui.renderer'] = $plugin->exchangeUIRendererAfterInitialization($c);
1581 
1582  foreach ($c->keys() as $key) {
1583  if (strpos($key, "ui.factory") === 0) {
1584  $c[$key] = $plugin->exchangeUIFactoryAfterInitialization($key, $c);
1585  }
1586  }
1587  }
1588  }
1589 
1593  protected static function initRefinery(\ILIAS\DI\Container $container): void
1594  {
1595  $container['refinery'] = function ($container) {
1596  $dataFactory = new \ILIAS\Data\Factory();
1597  $language = $container['lng'];
1598 
1599  return new \ILIAS\Refinery\Factory($dataFactory, $language);
1600  };
1601  }
1602 
1606  protected static function replaceSuperGlobals(\ILIAS\DI\Container $container): void
1607  {
1608  if (!ilContext::initClient()) {
1609  return;
1610  }
1611 
1613  $client_ini = $container['ilClientIniFile'];
1614 
1615  $replace_super_globals = (
1616  !$client_ini->variableExists('server', 'prevent_super_global_replacement') ||
1617  !(bool) $client_ini->readVariable('server', 'prevent_super_global_replacement')
1618  );
1619 
1620  if ($replace_super_globals) {
1621  $throwOnValueAssignment = defined('DEVMODE') && DEVMODE;
1622 
1623  $_GET = new SuperGlobalDropInReplacement($container['refinery'], $_GET, $throwOnValueAssignment);
1624  $_POST = new SuperGlobalDropInReplacement($container['refinery'], $_POST, $throwOnValueAssignment);
1625  $_COOKIE = new SuperGlobalDropInReplacement($container['refinery'], $_COOKIE, $throwOnValueAssignment);
1626  $_REQUEST = new SuperGlobalDropInReplacement($container['refinery'], $_REQUEST, $throwOnValueAssignment);
1627  }
1628  }
1629 
1630  protected static function initComponentService(\ILIAS\DI\Container $container): void
1631  {
1632  $init = new InitComponentService();
1633  $init->init($container);
1634  }
1635 
1639  protected static function initHTML(): void
1640  {
1641  global $ilUser, $DIC;
1642 
1643  if (ilContext::hasUser()) {
1644  // load style definitions
1645  // use the init function with plugin hook here, too
1646  self::initStyle();
1647 
1648  self::initUploadPolicies($DIC);
1649  }
1650 
1651  self::initUIFramework($GLOBALS["DIC"]);
1652  $tpl = new ilGlobalPageTemplate($DIC->globalScreen(), $DIC->ui(), $DIC->http());
1653  self::initGlobal("tpl", $tpl);
1654 
1655  if (ilContext::hasUser()) {
1656  $dispatcher = new \ILIAS\Init\StartupSequence\StartUpSequenceDispatcher($DIC);
1657  $dispatcher->dispatch();
1658  }
1659 
1660  self::initGlobal(
1661  "ilNavigationHistory",
1662  "ilNavigationHistory",
1663  "Services/Navigation/classes/class.ilNavigationHistory.php"
1664  );
1665 
1666  self::initGlobal(
1667  "ilHelp",
1668  "ilHelpGUI",
1669  "Services/Help/classes/class.ilHelpGUI.php"
1670  );
1671 
1672  if (DEVMODE) {
1673  $DIC["help.text_retriever"] = new ILIAS\UI\Help\TextRetriever\Echoing();
1674  } else {
1675  $DIC["help.text_retriever"] = new ilHelpUITextRetriever();
1676  }
1677 
1678  self::initGlobal(
1679  "ilToolbar",
1680  "ilToolbarGUI",
1681  "./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php"
1682  );
1683 
1684  self::initGlobal(
1685  "ilLocator",
1686  "ilLocatorGUI",
1687  "./Services/Locator/classes/class.ilLocatorGUI.php"
1688  );
1689 
1690  self::initGlobal(
1691  "ilTabs",
1692  "ilTabsGUI",
1693  "./Services/UIComponent/Tabs/classes/class.ilTabsGUI.php"
1694  );
1695 
1696  if (ilContext::hasUser()) {
1697  // set hits per page for all lists using table module
1698  // @todo this is not fixable due to unknown sideeffects.
1699  $_GET['limit'] = (int) $ilUser->getPref('hits_per_page');
1700  ilSession::set('tbl_limit', $_GET['limit']);
1701 
1702  // the next line makes it impossible to save the offset somehow in a session for
1703  // a specific table (I tried it for the user administration).
1704  // its not posssible to distinguish whether it has been set to page 1 (=offset = 0)
1705  // or not set at all (then we want the last offset, e.g. being used from a session var).
1706  // So I added the wrapping if statement. Seems to work (hopefully).
1707  // Alex April 14th 2006
1708  // @todo not replaced by refinery due to unknown sideeffects
1709  if (isset($_GET['offset']) && $_GET['offset'] != "") {
1710  $_GET['offset'] = (int) $_GET['offset']; // old code
1711  }
1712 
1713  self::initGlobal("lti", "ilLTIViewGUI", "./Services/LTI/classes/class.ilLTIViewGUI.php");
1714  $GLOBALS["DIC"]["lti"]->init();
1715  self::initKioskMode($GLOBALS["DIC"]);
1716  }
1717  }
1718 
1722  protected static function blockedAuthentication(string $a_current_script): bool
1723  {
1724  global $DIC;
1725 
1727  ilLoggerFactory::getLogger('init')->debug('Blocked authentication for WAC request.');
1728  return true;
1729  }
1731  ilLoggerFactory::getLogger('init')->debug('Blocked authentication for sso request.');
1732  return true;
1733  }
1735  ilLoggerFactory::getLogger('init')->debug('Blocked authentication for webdav request');
1736  return true;
1737  }
1739  ilLoggerFactory::getLogger('init')->debug('Blocked authentication for shibboleth request.');
1740  return true;
1741  }
1743  ilLoggerFactory::getLogger('init')->debug('Blocked authentication for lti provider requests.');
1744  return true;
1745  }
1747  ilLoggerFactory::getLogger('init')->debug('Blocked authentication for SAML request.');
1748  return true;
1749  }
1750  if (
1751  $a_current_script == "register.php" ||
1752  $a_current_script == "pwassist.php" ||
1753  $a_current_script == "confirmReg.php" ||
1754  $a_current_script == "il_securimage_play.php" ||
1755  $a_current_script == "il_securimage_show.php" ||
1756  $a_current_script == 'login.php'
1757  ) {
1758  ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for script: ' . $a_current_script);
1759  return true;
1760  }
1761 
1762  // @todo refinery undefined
1763  $requestBaseClass = strtolower((string) ($_GET['baseClass'] ?? ''));
1764  if ($requestBaseClass == strtolower(ilStartUpGUI::class)) {
1765  $requestCmdClass = strtolower((string) ($_GET['cmdClass'] ?? ''));
1766  if (
1767  $requestCmdClass == strtolower(ilAccountRegistrationGUI::class) ||
1768  $requestCmdClass == strtolower(ilPasswordAssistanceGUI::class)
1769  ) {
1770  ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for cmdClass: ' . $requestCmdClass);
1771  return true;
1772  }
1773  $cmd = $DIC->ctrl()->getCmd();
1774 
1775  if (in_array($cmd, [
1776  'showLegalDocuments',
1777  'showAccountMigration',
1778  'migrateAccount',
1779  'processCode',
1780  'showLoginPage',
1781  'showLogout',
1782  'doStandardAuthentication',
1783  'doCasAuthentication',
1784  ], true)) {
1785  ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for cmd: ' . $cmd);
1786  return true;
1787  }
1788  }
1789 
1790  $target = '';
1791  if ($DIC->http()->wrapper()->query()->has('target')) {
1792  // @todo refinery undefined
1793  $target = $_GET['target'];
1794  }
1795 
1796  // #12884
1797  if (
1798  ($a_current_script == "goto.php" && $target == "impr_0") ||
1799  $requestBaseClass == strtolower(ilImprintGUI::class)
1800  ) {
1801  // @todo refinery undefind
1802  ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for baseClass: ' . ($_GET['baseClass'] ?? ""));
1803  return true;
1804  }
1805 
1806  if (
1807  (strtolower($requestCmdClass ?? "") === strtolower(ilAccessibilityControlConceptGUI::class))
1808  ) {
1809  ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for cmdClass: ' . $requestCmdClass);
1810  return true;
1811  }
1812 
1813  if ($a_current_script == 'goto.php' && in_array($target, array(
1814  'usr_registration',
1815  'usr_nameassist',
1816  'usr_pwassist',
1817  'usr_agreement'
1818  ))) {
1819  ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for goto target: ' . $target);
1820  return true;
1821  }
1822 
1823 
1824  $current_ref_id = $DIC->http()->wrapper()->query()->has('ref_id')
1825  ? $DIC->http()->wrapper()->query()->retrieve('ref_id', $DIC->refinery()->kindlyTo()->int())
1826  : null;
1827 
1828  if (null !== $current_ref_id
1829  && $DIC->user()->getId() === 0
1830  && $DIC->access()->checkAccessOfUser(
1832  'visible',
1833  '',
1834  $current_ref_id
1835  )) {
1836  return true;
1837  }
1838 
1839 
1840  ilLoggerFactory::getLogger('auth')->debug('Authentication required');
1841  return false;
1842  }
1843 
1847  protected static function translateMessage(string $a_message_id, array $a_message_static = null): string
1848  {
1849  global $ilDB, $lng, $ilSetting, $ilClientIniFile, $ilUser;
1850 
1851  // current language
1852  if (!$lng) {
1853  $lang = "en";
1854  if ($ilUser) {
1855  $lang = $ilUser->getLanguage();
1856  } elseif (isset($_REQUEST["lang"])) {
1857  $lang = (string) $_REQUEST["lang"];
1858  } elseif ($ilSetting) {
1859  $lang = $ilSetting->get("language", '');
1860  } elseif ($ilClientIniFile) {
1861  $lang = $ilClientIniFile->readVariable("language", "default");
1862  }
1863  } else {
1864  $lang = $lng->getLangKey();
1865  }
1866 
1867  $message = "";
1868  if ($ilDB && $a_message_id) {
1869  if (!$lng) {
1870  $lng = new ilLanguage($lang);
1871  }
1872 
1873  $lng->loadLanguageModule("init");
1874  $message = $lng->txt($a_message_id);
1875  } elseif (is_array($a_message_static)) {
1876  if (!isset($a_message_static[$lang])) {
1877  $lang = "en";
1878  }
1879  $message = $a_message_static[$lang];
1880  }
1881  return $message;
1882  }
1883 
1887  protected static function redirect(
1888  string $a_target,
1889  string $a_message_id = '',
1890  array $a_message_static = null
1891  ): void {
1892  // #12739
1893  if (defined("ILIAS_HTTP_PATH") &&
1894  !stristr($a_target, ILIAS_HTTP_PATH)) {
1895  $a_target = ILIAS_HTTP_PATH . "/" . $a_target;
1896  }
1897 
1898  foreach (['ext_uid', 'soap_pw'] as $param) {
1899  if (false === strpos(
1900  $a_target,
1901  $param . '='
1902  ) && isset($GLOBALS['DIC']->http()->request()->getQueryParams()[$param])) {
1903  $a_target = \ilUtil::appendUrlParameterString($a_target, $param . '=' . \ilUtil::stripSlashes(
1904  $GLOBALS['DIC']->http()->request()->getQueryParams()[$param]
1905  ));
1906  }
1907  }
1908 
1910  ilUtil::redirect($a_target);
1911  } else {
1912  $message = self::translateMessage($a_message_id, $a_message_static);
1913 
1914  // user-directed linked message
1916  $link = self::translateMessage(
1917  "init_error_redirect_click",
1918  array("en" => 'Please click to continue.',
1919  "de" => 'Bitte klicken um fortzufahren.'
1920  )
1921  );
1922  $mess = $message .
1923  '<br /><a href="' . $a_target . '">' . $link . '</a>';
1924  } // plain text
1925  else {
1926  // not much we can do here
1927  $mess = $message;
1928 
1929  if (!trim($mess)) {
1930  $mess = self::translateMessage(
1931  "init_error_redirect_info",
1932  array("en" => 'Redirect not supported by context.',
1933  "de" => 'Weiterleitungen werden durch Kontext nicht unterstützt.'
1934  )
1935  ) .
1936  ' (' . $a_target . ')';
1937  }
1938  }
1939 
1940  self::abortAndDie($mess);
1941  }
1942  }
1943 
1944  public static function redirectToStartingPage(string $target = ''): void
1945  {
1946  global $DIC;
1947 
1948  // fallback, should never happen
1949  if ($DIC->user()->getId() === ANONYMOUS_USER_ID) {
1950  self::goToPublicSection();
1951  return;
1952  }
1953 
1954  if (
1955  $target === '' &&
1956  $DIC->http()->wrapper()->query()->has('target')
1957  ) {
1958  $target = $DIC->http()->wrapper()->query()->retrieve(
1959  'target',
1960  $DIC->refinery()->kindlyTo()->string()
1961  );
1962  }
1963 
1964  // for password change and incomplete profile
1965  // see ilDashboardGUI
1966  if ($target === '') {
1967  ilLoggerFactory::getLogger('init')->debug('Redirect to default starting page');
1968  $DIC->ctrl()->redirectToURL(ilUserUtil::getStartingPointAsUrl());
1969  } else {
1970  ilLoggerFactory::getLogger('init')->debug('Redirect to target: ' . $target);
1971  $DIC->ctrl()->redirectToURL("goto.php?target=" . $target);
1972  }
1973  }
1974 
1975  private static function initBackgroundTasks(\ILIAS\DI\Container $c): void
1976  {
1977  global $ilIliasIniFile;
1978 
1979  $n_of_tasks = $ilIliasIniFile->readVariable("background_tasks", "number_of_concurrent_tasks");
1980  $sync = $ilIliasIniFile->readVariable("background_tasks", "concurrency");
1981 
1982  $n_of_tasks = $n_of_tasks ?: 5;
1983  $sync = $sync ?: 'sync'; // The default value is sync.
1984 
1985  $c["bt.task_factory"] = function ($c) {
1986  return new \ILIAS\BackgroundTasks\Implementation\Tasks\BasicTaskFactory($c["di.injector"]);
1987  };
1988 
1989  $c["bt.persistence"] = function ($c) {
1990  return \ILIAS\BackgroundTasks\Implementation\Persistence\BasicPersistence::instance($c->database());
1991  };
1992 
1993  $c["bt.injector"] = function ($c) {
1994  return new \ILIAS\BackgroundTasks\Dependencies\Injector($c, new BaseDependencyMap());
1995  };
1996 
1997  $c["bt.task_manager"] = function ($c) use ($sync) {
1998  if ($sync == 'sync') {
1999  return new \ILIAS\BackgroundTasks\Implementation\TaskManager\SyncTaskManager($c["bt.persistence"]);
2000  } elseif ($sync == 'async') {
2001  return new \ILIAS\BackgroundTasks\Implementation\TaskManager\AsyncTaskManager($c["bt.persistence"]);
2002  } else {
2003  throw new ilException("The supported Background Task Managers are sync and async. $sync given.");
2004  }
2005  };
2006  }
2007 
2008  private static function initInjector(\ILIAS\DI\Container $c): void
2009  {
2010  $c["di.dependency_map"] = function ($c) {
2011  return new \ILIAS\BackgroundTasks\Dependencies\DependencyMap\BaseDependencyMap();
2012  };
2013 
2014  $c["di.injector"] = function ($c) {
2015  return new \ILIAS\BackgroundTasks\Dependencies\Injector($c, $c["di.dependency_map"]);
2016  };
2017  }
2018 
2019  private static function initKioskMode(\ILIAS\DI\Container $c): void
2020  {
2021  $c["service.kiosk_mode"] = function ($c) {
2022  return new ilKioskModeService(
2023  $c['ilCtrl'],
2024  $c['lng'],
2025  $c['ilAccess'],
2026  $c['objDefinition']
2027  );
2028  };
2029  }
2030 }
static initHTTPServices(\ILIAS\DI\Container $container)
then(callable $f)
Get a new result from the callable or do nothing if this is an error.
static initAvatar(\ILIAS\DI\Container $c)
Class ilGSProviderFactory.
static handleMaintenanceMode()
handle maintenance mode
$_GET["client_id"]
Definition: webdav.php:30
static hasUser()
Based on user authentication?
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
const CONTEXT_WAC
const CONTEXT_HTTP
HTTP Auth used for WebDAV and CalDAV If a special handling for WebDAV or CalDAV is required overwrite...
Class InitCtrlService wraps the initialization of ilCtrl.
static initRefinery(\ILIAS\DI\Container $container)
const ANONYMOUS_USER_ID
Definition: constants.php:27
static getLogger(string $a_component_id)
Get component logger.
const ILIAS_VERSION_NUMERIC
static includePhp5Compliance()
This is a hack for authentication.
This describes a facility that the UI framework can use to retrieve some help text.
static usesHTTP()
Uses HTTP aka browser.
static initFileUploadService(\ILIAS\DI\Container $dic)
Initializes the file upload service.
const ROOT_FOLDER_ID
Definition: constants.php:32
static initHTML()
init HTML output (level 3)
static orderBy(string $orderBy, string $orderDirection='ASC')
const CONTEXT_WEBDAV
static _exists(string $a_session_id)
Check whether session exists.
Class ChatMainBarProvider .
static initKioskMode(\ILIAS\DI\Container $c)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
Database Session Handling.
static abortAndDie(string $a_message)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static updateAccess(ilObjUser $user)
Responsible for loading the Resource Storage into the dependency injection container of ILIAS...
A result encapsulates a value or an error and simplifies the handling of those.
Definition: Result.php:14
const SESSION_CLOSE_LOGIN
static determineClient()
This method determines the current client and sets the constant CLIENT_ID.
static redirect(string $a_target, string $a_message_id='', array $a_message_static=null)
Redirects to target url if context supports it.
static init(Container $c)
Definition: Init.php:36
static isAuthenticationForced()
Check if authentication is should be forced.
const CONTEXT_LTI_PROVIDER
static initDefaultTimeZone(ilIniFile $ini)
Initialize default timezone from system settings.
const CONTEXT_SHIBBOLETH
static goToPublicSection()
go to public section
static blockedAuthentication(string $a_current_script)
Block authentication based on current request.
static modifyHttpPath(string $httpPath)
static resumeUserSession()
Resume an existing user session.
const IL_COOKIE_PATH
Definition: module.php:33
static setSessionHandler()
set session handler to db Used in Soap/CAS
static initSession()
Init auth session.
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
Class SuperGlobalDropInReplacement This Class wraps SuperGlobals such as $_GET and $_POST to prevent ...
static getGlobalInstance()
Builds the global language object.
$ilErr
Definition: raiseError.php:17
$path
Definition: ltiservices.php:32
static removeTrailingPathSeparators(string $path)
$container
Definition: wac.php:14
static initBackgroundTasks(\ILIAS\DI\Container $c)
static initAccessHandling()
$ilAccess and $rbac...
$ilIliasIniFile
Definition: server.php:26
Responsible for loading the UI Framework into the dependency injection container of ILIAS...
static getWrapper(string $a_type)
const SESSION_CLOSE_EXPIRE
static initLegalDocuments(Container $c)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static initCron(\ILIAS\DI\Container $c)
static initILIAS()
ilias initialisation
static handleForcedAuthentication()
static http()
Fetches the global http state from ILIAS.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static initDatabase()
initialise database object $ilDB
static initCustomObjectIcons(\ILIAS\DI\Container $c)
const CONTEXT_SAML
static initUIFramework(\ILIAS\DI\Container $c)
init the ILIAS UI framework.
$GLOBALS["DIC"]
Definition: wac.php:31
$lng
$log
Definition: result.php:33
static initClientIniFile()
This method provides a global instance of class ilIniFile for the client.ini.php file in variable $il...
static setCookie(string $a_cookie_name, string $a_cookie_value='', bool $a_also_set_super_global=true, bool $a_set_cookie_invalid=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static hasHTML()
Has HTML output.
Class HTTPServicesTest.
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
$param
Definition: xapitoken.php:46
const CLIENT_ID
Definition: constants.php:41
A result encapsulates a value or an error and simplifies the handling of those.
Definition: Ok.php:16
string $key
Consumer key/client ID value.
Definition: System.php:193
static initGlobal(string $a_name, $a_class, ?string $a_source_file=null, ?bool $destroy_existing=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static initLocale()
Init Locale.
static requireCommonIncludes()
get common include code files
const CLIENT_WEB_DIR
Definition: constants.php:47
static initLog()
Init log instance.
static initStyle()
provide $styleDefinition object
static getFallbackInstance()
Builds a global default language instance.
if(!isset($GLOBALS['ilGlobalStartTime'])||! $GLOBALS['ilGlobalStartTime']) global $DIC
static initClient()
Init client-based objects (level 1)
const ILIAS_DATA_DIR
Definition: constants.php:44
static initIliasIniFile()
This method provides a global instance of class ilIniFile for the ilias.ini.php file in variable $ilI...
Class ilFileServicesFilenameSanitizer.
static _isAnonymous(int $usr_id)
static redirect(string $a_script)
const SESSION_CLOSE_PUBLIC
static _destroy($a_session_id, ?int $a_closing_context=null, $a_expired_at=null)
Destroy session.
$lang
Definition: xapiexit.php:26
static initUploadPolicies(\ILIAS\DI\Container $dic)
static removeUnsafeCharacters()
Remove unsafe characters from GET.
static initCore()
Init core objects (level 0)
static setSessionCookieParams()
set session cookie params
static translateMessage(string $a_message_id, array $a_message_static=null)
Translate message if possible.
static supportsPersistentSessions()
Check if context supports persistent session handling.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static redirectToStartingPage(string $target='')
Central entry point for users of the service.
global $ilSetting
Definition: privfeed.php:18
static setClosingContext(int $a_context)
set closing context (for statistics)
static initClient()
Init client.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A transformation is a function from one datatype to another.
static initInjector(\ILIAS\DI\Container $c)
static getClientIdTransformation()
Refinery is not initialized early enough to provide a transformation to be used with the implementat...
static initComponentService(\ILIAS\DI\Container $container)
$dic
Definition: result.php:32
$client_id
Definition: ltiauth.php:68
const ILIAS_MODULE
Definition: server.php:15
$message
Definition: xapiexit.php:32
static goToLogin()
go to login
static initAccessibilityControlConcept(\ILIAS\DI\Container $c)
static getInstance(\ilLogger $logger)
Get instance.
static getType()
Get context type.
static initGlobalScreen(\ILIAS\DI\Container $c)
static initUserAccount()
Init user with current account id.
$_COOKIE[session_name()]
Definition: xapitoken.php:54
static recursivelyRemoveUnsafeCharacters($var)
const CONTEXT_SOAP
static handleErrorReporting()
Set error reporting level.
$cookie_path
Definition: module.php:21
static initSettings()
initialise $ilSettings object and define constants Used in Soap
static set(string $a_var, $a_val)
Set a value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const CONTEXT_APACHE_SSO
static initUser()
Init user / authentification (level 2)
static buildHTTPPath()
builds http path
Responsible for loading the HTTP Service into the dependency injection container of ILIAS...
static getRootLogger()
The unique root logger has a fixed error level.
const ILIAS_WEB_DIR
Definition: constants.php:45
static supportsRedirects()
Are redirects supported?
static handleDevMode()
Prepare developer tools.