49require_once(
"libs/composer/vendor/autoload.php");
52if (!isset(
$GLOBALS[
'ilGlobalStartTime']) || !
$GLOBALS[
'ilGlobalStartTime']) {
53 $GLOBALS[
'ilGlobalStartTime'] = microtime();
93 foreach ($var as $k => $v) {
101 array(
"\x00",
"\n",
"\r",
"\\",
"'",
'"',
"\x1a"),
114 require_once
"include/inc.ilias_version.php";
116 self::initGlobal(
"ilBench",
"ilBenchmark",
"./Services/Utilities/classes/class.ilBenchmark.php");
127 require_once(
"include/inc.xml5compliance.php");
130 require_once(
"include/inc.xsl5compliance.php");
146 if (!defined(
'ILIAS_DATA_DIR')) {
147 define(
"ILIAS_DATA_DIR",
$ilIliasIniFile->readVariable(
"clients",
"datadir"));
149 if (!defined(
'ILIAS_WEB_DIR')) {
150 define(
"ILIAS_WEB_DIR",
$ilIliasIniFile->readVariable(
"clients",
"path"));
152 if (!defined(
"ILIAS_ABSOLUTE_PATH")) {
153 define(
"ILIAS_ABSOLUTE_PATH",
$ilIliasIniFile->readVariable(
'server',
'absolute_path'));
158 define(
"ILIAS_LOG_FILE",
$ilIliasIniFile->readVariable(
"log",
"file"));
159 if (!defined(
"ILIAS_LOG_ENABLED")) {
160 define(
"ILIAS_LOG_ENABLED",
$ilIliasIniFile->readVariable(
"log",
"enabled"));
162 define(
"ILIAS_LOG_LEVEL",
$ilIliasIniFile->readVariable(
"log",
"level"));
165 define(
"PATH_TO_CONVERT",
$ilIliasIniFile->readVariable(
"tools",
"convert"));
166 define(
"PATH_TO_FFMPEG",
$ilIliasIniFile->readVariable(
"tools",
"ffmpeg"));
168 define(
"PATH_TO_MKISOFS",
$ilIliasIniFile->readVariable(
"tools",
"mkisofs"));
169 define(
"PATH_TO_UNZIP",
$ilIliasIniFile->readVariable(
"tools",
"unzip"));
170 define(
"PATH_TO_GHOSTSCRIPT",
$ilIliasIniFile->readVariable(
"tools",
"ghostscript"));
171 define(
"PATH_TO_JAVA",
$ilIliasIniFile->readVariable(
"tools",
"java"));
172 define(
"URL_TO_LATEX",
$ilIliasIniFile->readVariable(
"tools",
"latex"));
174 define(
"PATH_TO_LESSC",
$ilIliasIniFile->readVariable(
"tools",
"lessc"));
175 define(
"PATH_TO_PHANTOMJS",
$ilIliasIniFile->readVariable(
"tools",
"phantomjs"));
179 define(
"ERROR_EDITOR_URL",
$ilIliasIniFile->readVariable(
'error',
'editor_url'));
182 if (
$ilIliasIniFile->variableExists(
'error',
'editor_path_translations')) {
184 "ERROR_EDITOR_PATH_TRANSLATIONS",
193 define(
"IL_VIRUS_SCANNER",
"Sophos");
194 define(
"IL_VIRUS_SCAN_COMMAND",
$ilIliasIniFile->readVariable(
"tools",
"scancommand"));
195 define(
"IL_VIRUS_CLEAN_COMMAND",
$ilIliasIniFile->readVariable(
"tools",
"cleancommand"));
199 define(
"IL_VIRUS_SCANNER",
"AntiVir");
200 define(
"IL_VIRUS_SCAN_COMMAND",
$ilIliasIniFile->readVariable(
"tools",
"scancommand"));
201 define(
"IL_VIRUS_CLEAN_COMMAND",
$ilIliasIniFile->readVariable(
"tools",
"cleancommand"));
205 define(
"IL_VIRUS_SCANNER",
"ClamAV");
206 define(
"IL_VIRUS_SCAN_COMMAND",
$ilIliasIniFile->readVariable(
"tools",
"scancommand"));
207 define(
"IL_VIRUS_CLEAN_COMMAND",
$ilIliasIniFile->readVariable(
"tools",
"cleancommand"));
210 define(
"IL_VIRUS_SCANNER",
"icap");
211 define(
"IL_ICAP_HOST",
$ilIliasIniFile->readVariable(
"tools",
"icap_host"));
212 define(
"IL_ICAP_PORT",
$ilIliasIniFile->readVariable(
"tools",
"icap_port"));
213 define(
"IL_ICAP_AV_COMMAND",
$ilIliasIniFile->readVariable(
"tools",
"icap_service_name"));
214 define(
"IL_ICAP_CLIENT",
$ilIliasIniFile->readVariable(
"tools",
"icap_client_path"));
218 define(
"IL_VIRUS_SCANNER",
"None");
219 define(
"IL_VIRUS_CLEAN_COMMAND",
'');
224 define(
"IL_TIMEZONE", $tz);
243 public static function bootstrapFilesystems(): void
247 $DIC[
'filesystem.security.sanitizing.filename'] =
function (
Container $c) {
249 $c->fileServiceSettings()
253 $DIC[
'filesystem.factory'] =
function (
$c) {
254 return new \ILIAS\Filesystem\Provider\DelegatingFilesystemFactory(
$c[
'filesystem.security.sanitizing.filename']);
257 $DIC[
'filesystem.web'] =
function (
$c) {
263 $delegatingFactory =
$c[
'filesystem.factory'];
264 $webConfiguration = new \ILIAS\Filesystem\Provider\Configuration\LocalConfig(ILIAS_ABSOLUTE_PATH .
'/' .
ILIAS_WEB_DIR .
'/' .
CLIENT_ID);
265 return $delegatingFactory->getLocal($webConfiguration);
268 $DIC[
'filesystem.storage'] =
function (
$c) {
274 $delegatingFactory =
$c[
'filesystem.factory'];
275 $storageConfiguration = new \ILIAS\Filesystem\Provider\Configuration\LocalConfig(
ILIAS_DATA_DIR .
'/' .
CLIENT_ID);
276 return $delegatingFactory->getLocal($storageConfiguration);
279 $DIC[
'filesystem.temp'] =
function (
$c) {
285 $delegatingFactory =
$c[
'filesystem.factory'];
286 $tempConfiguration = new \ILIAS\Filesystem\Provider\Configuration\LocalConfig(
ILIAS_DATA_DIR .
'/' .
CLIENT_ID .
'/temp');
287 return $delegatingFactory->getLocal($tempConfiguration);
290 $DIC[
'filesystem.customizing'] =
function (
$c) {
296 $delegatingFactory =
$c[
'filesystem.factory'];
297 $customizingConfiguration = new \ILIAS\Filesystem\Provider\Configuration\LocalConfig(ILIAS_ABSOLUTE_PATH .
'/' .
'Customizing');
298 return $delegatingFactory->getLocal($customizingConfiguration);
301 $DIC[
'filesystem.libs'] =
function (
$c) {
307 $delegatingFactory =
$c[
'filesystem.factory'];
308 $customizingConfiguration = new \ILIAS\Filesystem\Provider\Configuration\LocalConfig(ILIAS_ABSOLUTE_PATH .
'/' .
'libs');
309 return $delegatingFactory->getLocal($customizingConfiguration,
true);
312 $DIC[
'filesystem.node_modules'] =
function (
$c) {
318 $delegatingFactory =
$c[
'filesystem.factory'];
319 $customizingConfiguration = new \ILIAS\Filesystem\Provider\Configuration\LocalConfig(ILIAS_ABSOLUTE_PATH .
'/' .
'node_modules');
320 return $delegatingFactory->getLocal($customizingConfiguration,
true);
323 $DIC[
'filesystem'] =
function (
$c) {
324 return new \ILIAS\Filesystem\FilesystemsImpl(
325 $c[
'filesystem.storage'],
326 $c[
'filesystem.web'],
327 $c[
'filesystem.temp'],
328 $c[
'filesystem.customizing'],
329 $c[
'filesystem.libs'],
330 $c[
'filesystem.node_modules']
343 $dic[
'upload.processor-manager'] =
function (
$c) {
348 $fileUploadImpl = new \ILIAS\FileUpload\FileUploadImpl(
349 $c[
'upload.processor-manager'],
353 if ((defined(
'IL_VIRUS_SCANNER') && IL_VIRUS_SCANNER !=
"None") || (defined(
'IL_SCANNER_TYPE') && IL_SCANNER_TYPE ==
"1")) {
358 $fileUploadImpl->register(
360 $c->fileServiceSettings(),
361 $c->language()->txt(
"msg_info_blacklisted")
366 $c->language()->txt(
"upload_svg_rejection_message"),
367 $c->language()->txt(
"upload_svg_rejection_message_script"),
368 $c->language()->txt(
"upload_svg_rejection_message_base64"),
369 $c->language()->txt(
"upload_svg_rejection_message_foreign_object"),
370 $c->language()->txt(
"upload_svg_rejection_message_elements")
373 return $fileUploadImpl;
384 if (
$DIC[
'https']->isDetected()) {
385 $protocol =
'https://';
387 $protocol =
'http://';
391 $rq_uri = strip_tags(
$_SERVER[
'REQUEST_URI']);
395 if (is_int($pos = strpos($rq_uri,
"?"))) {
396 $rq_uri = substr($rq_uri, 0, $pos);
399 if (!defined(
'ILIAS_MODULE')) {
400 $path = pathinfo($rq_uri);
401 if (isset(
$path[
'extension']) &&
$path[
'extension'] !==
'') {
402 $uri = dirname($rq_uri);
408 $path = dirname($rq_uri);
413 $dirs = explode(
'/', $module);
415 foreach ($dirs as $dir) {
416 $uri = dirname($uri);
423 $ilias_http_path = preg_replace(
'/(http|https)(:\/\/)(.*?\/.*?\.php).*/',
'$1$2$3', $ilias_http_path);
425 $f = new \ILIAS\Data\Factory();
428 $base_URI = $uri->getBaseURI();
430 return define(
'ILIAS_HTTP_PATH', $base_URI);
439 if (defined(
'CLIENT_ID')) {
443 $df = new \ILIAS\Data\Factory();
446 if (!
$DIC->isDependencyAvailable(
'iliasIni')) {
447 self::abortAndDie(
'Fatal Error: ilInitialisation::determineClient called without initialisation of ILIAS ini file object.');
451 $default_client_id =
$DIC->iliasIni()->readVariable(
'clients',
'default');
453 if (
$DIC->http()->wrapper()->query()->has(
'client_id')) {
454 $client_id_from_get =
$DIC->http()->wrapper()->query()->retrieve(
456 self::getClientIdTransformation()
459 if (
$DIC->http()->wrapper()->cookie()->has(
'ilClientId')) {
460 $client_id_from_cookie =
$DIC->http()->wrapper()->cookie()->retrieve(
462 self::getClientIdTransformation()
467 $client_id_to_use =
'';
468 if (isset($client_id_from_get) && $client_id_from_get !==
'') {
469 $client_id_to_use = $client_id_from_get;
472 if ($client_id_to_use ===
'' && isset($client_id_from_cookie)) {
473 $client_id_to_use = $client_id_from_cookie;
476 $client_id_to_use = $client_id_to_use ?: $default_client_id;
478 define(
'CLIENT_ID', $df->clientId($client_id_to_use)->toString());
494 public function transform($from):
string
496 if (!is_string($from)) {
497 throw new InvalidArgumentException(__METHOD__ .
" the argument is not a string.");
499 return strip_tags($from);
507 return $result->
then(
function ($value):
Result {
509 return new Ok($this->transform($value));
510 }
catch (Exception $exception) {
511 return new Error($exception);
519 public function __invoke($from):
string
521 return $this->transform($from);
541 self::abortAndDie(
"Fatal Error: ilInitialisation::initClientIniFile called without ILIAS_WEB_DIR.");
546 self::abortAndDie(
"Fatal Error: ilInitialisation::initClientIniFile called without CLIENT_ID.");
549 $ini_file =
"/client.ini.php";
550 if (defined(
'CLIENT_WEB_DIR')) {
557 $ilClientIniFile =
new ilIniFile($ini_file);
558 $ilClientIniFile->read();
561 if ($ilClientIniFile->ERROR !=
"") {
564 $mess = array(
"en" =>
"Client does not exist.",
565 "de" =>
"Mandant ist ungültig."
567 self::redirect(
"index.php?client_id=" . $default_client,
'', $mess);
569 self::abortAndDie(
"Fatal Error: ilInitialisation::initClientIniFile initializing client ini file abborted with: " . $ilClientIniFile->ERROR);
575 define(
"DEBUG", (
int) $ilClientIniFile->readVariable(
"system",
"DEBUG"));
576 define(
"DEVMODE", (
int) $ilClientIniFile->readVariable(
"system",
"DEVMODE"));
577 define(
"SHOWNOTICES", (
int) $ilClientIniFile->readVariable(
"system",
"SHOWNOTICES"));
578 if (!defined(
"ROOT_FOLDER_ID")) {
579 define(
"ROOT_FOLDER_ID", (
int) $ilClientIniFile->readVariable(
'system',
'ROOT_FOLDER_ID'));
581 if (!defined(
"SYSTEM_FOLDER_ID")) {
582 define(
"SYSTEM_FOLDER_ID", (
int) $ilClientIniFile->readVariable(
'system',
'SYSTEM_FOLDER_ID'));
584 if (!defined(
"ROLE_FOLDER_ID")) {
585 define(
"ROLE_FOLDER_ID", (
int) $ilClientIniFile->readVariable(
'system',
'ROLE_FOLDER_ID'));
587 define(
"MAIL_SETTINGS_ID", (
int) $ilClientIniFile->readVariable(
'system',
'MAIL_SETTINGS_ID'));
588 $error_handler = $ilClientIniFile->readVariable(
'system',
'ERROR_HANDLER');
589 define(
"ERROR_HANDLER", $error_handler ?:
"PRETTY_PAGE");
593 define(
"OH_REF_ID", (
int) $ilClientIniFile->readVariable(
"system",
"OH_REF_ID"));
599 if (!defined(
"CLIENT_DATA_DIR")) {
602 if (!defined(
"CLIENT_WEB_DIR")) {
605 define(
"CLIENT_NAME", $ilClientIniFile->readVariable(
'client',
'name'));
607 $db_type = $ilClientIniFile->readVariable(
"db",
"type");
608 if ($db_type ===
"") {
611 define(
"IL_DB_TYPE", $db_type);
615 $ilGlobalCacheSettings->readFromIniFile($ilClientIniFile);
624 global $ilClientIniFile;
626 if (!$ilClientIniFile->readVariable(
"client",
"access")) {
628 "en" =>
"The server is not available due to maintenance." .
629 " We apologise for any inconvenience.",
630 "de" =>
"Der Server ist aufgrund von Wartungsarbeiten aktuell nicht verfügbar." .
631 " Wir bitten um Verständnis. Versuchen Sie es später noch einmal."
633 $mess_id =
"init_error_maintenance";
651 $ilDB->initFromIniFile();
664 if (!$db_session_handler->setSaveHandler()) {
671 if (function_exists(
"session_status") && session_status() == PHP_SESSION_ACTIVE) {
672 session_regenerate_id();
684 } elseif (isset(
$GLOBALS[
'COOKIE_PATH'])) {
702 define(
'IL_COOKIE_HTTPONLY',
true);
703 define(
'IL_COOKIE_EXPIRE', 0);
704 define(
'IL_COOKIE_DOMAIN',
'');
705 if (!defined(
'IL_COOKIE_PATH')) {
713 if (defined(
'CLIENT_ID') &&
714 !defined(
'IL_PHPUNIT_TEST') &&
727 if (!defined(
'IL_COOKIE_SECURE')) {
731 $cookie_secure = !
$ilSetting->get(
'https',
'0') &&
$DIC[
'https']->isDetected();
732 define(
'IL_COOKIE_SECURE', $cookie_secure);
734 $cookie_parameters = [
735 'lifetime' => IL_COOKIE_EXPIRE,
737 'domain' => IL_COOKIE_DOMAIN,
738 'secure' => IL_COOKIE_SECURE,
739 'httponly' => IL_COOKIE_HTTPONLY,
744 (!isset(session_get_cookie_params()[
'samesite']) || strtolower(session_get_cookie_params()[
'samesite']) !==
'strict')
746 $cookie_parameters[
'samesite'] =
'Lax';
749 session_set_cookie_params($cookie_parameters);
756 return new \ilMailMimeTransportFactory(
$c->settings(),
$c->event());
759 return new \ilMailMimeSenderFactory(
$c->settings());
772 $c->logger()->cron(),
773 $c[
'component.repository'],
774 $c[
'component.factory']
780 $c[
'cron.repository'],
783 $c->logger()->cron(),
794 $c[
"object.customicons.factory"] =
function (
$c) {
796 $c->filesystem()->web(),
805 $c[
"user.avatar.factory"] =
function (
$c) {
806 return new \ilUserAvatarFactory(
$c);
812 $c[
'tos.criteria.type.factory'] =
function (
816 $c->rbac()->review(),
817 $c[
'ilObjDataCache'],
824 $persistence->setDatabaseAdapter(
$c->database());
827 $c[
'tos.document.evaluator'],
828 $c[
'tos.criteria.type.factory'],
836 $c[
'tos.criteria.type.factory'],
856 $c[
'acc.criteria.type.factory'],
878 "Services/Administration/classes/class.ilSetting.php"
887 define(
"ANONYMOUS_USER_ID", (
int)
$ilSetting->get(
"anonymous_user_id"));
888 define(
"ANONYMOUS_ROLE_ID", (
int)
$ilSetting->get(
"anonymous_role_id"));
889 define(
"SYSTEM_USER_ID", (
int)
$ilSetting->get(
"system_user_id"));
890 define(
"SYSTEM_ROLE_ID", (
int)
$ilSetting->get(
"system_role_id"));
891 define(
"USER_FOLDER_ID", 7);
894 define(
"RECOVERY_FOLDER_ID", (
int)
$ilSetting->get(
"recovery_folder_id"));
897 define(
"IL_INST_ID",
$ilSetting->get(
"inst_id",
'0'));
900 define(
"SUFFIX_REPL_DEFAULT",
"php,php3,php4,inc,lang,phtml,htaccess");
901 define(
"SUFFIX_REPL_ADDITIONAL",
$ilSetting->get(
"suffix_repl_additional",
""));
914 $component_factory =
$DIC[
"component.factory"];
920 "./Services/Style/System/classes/class.ilStyleDefinition.php"
924 foreach ($component_factory->getActivePluginsInSlot(
"uihk") as $ui_plugin) {
925 $gui_class = $ui_plugin->getUIClassInstance();
926 $gui_class->modifyGUI(
"Services/Init",
"init_style", array(
"styleDefinition" =>
$DIC->systemStyle()));
937 static $context_init;
939 $uid =
$GLOBALS[
'DIC'][
'ilAuthSession']->getUserId();
941 $DIC->user()->setId($uid);
942 $DIC->user()->read();
943 if (!isset($context_init)) {
944 if (
$DIC->user()->isAnonymous()) {
945 $DIC->globalScreen()->tool()->context()->claim()->external();
947 $DIC->globalScreen()->tool()->context()->claim()->internal();
949 $context_init =
true;
969 if (trim(
$ilSetting->get(
"locale",
'')) !=
"") {
970 $larr = explode(
",", trim(
$ilSetting->get(
"locale")));
973 foreach ($larr as $l) {
974 if (trim($l) !=
"") {
978 if (count($ls) > 0) {
979 setlocale(LC_ALL, $ls);
982 setlocale(LC_NUMERIC,
"C");
998 $session_destroyed =
false;
999 if (
$DIC[
'ilAuthSession']->isExpired()) {
1000 $session_destroyed =
true;
1003 if (!
$DIC[
'ilAuthSession']->isAuthenticated()) {
1004 $session_destroyed =
true;
1008 if ($session_destroyed) {
1015 if (
$DIC->http()->wrapper()->query()->has(
'target')) {
1016 $target =
$DIC->http()->wrapper()->query()->retrieve(
1018 $DIC->refinery()->kindlyTo()->string()
1023 if (strlen($target)) {
1025 $current_script = substr(strrchr(
$_SERVER[
"PHP_SELF"],
"/"), 1);
1026 if ($current_script ==
"goto.php") {
1035 "ilias.php?baseClass=ilrepositorygui&reloadpublic=1&cmd=&ref_id=" . (defined(
1048 $session_expired =
false;
1051 if (
$DIC[
'ilAuthSession']->isExpired()) {
1053 $session_expired =
true;
1055 if (!
$DIC[
'ilAuthSession']->isAuthenticated()) {
1059 $target =
$DIC->http()->wrapper()->query()->has(
'target')
1060 ?
$DIC->http()->wrapper()->query()->retrieve(
1062 $DIC->refinery()->kindlyTo()->string()
1066 if (strlen($target)) {
1067 $target =
"target=" . $target .
"&";
1072 $DIC->refinery()->byTrying([
1073 $DIC->refinery()->kindlyTo()->string(),
1074 $DIC->refinery()->always(
'')
1077 $script =
"login.php?" . $target .
"client_id=" .
$client_id;
1078 $script .= $session_expired ?
"&session_expired=1" :
"";
1082 "init_error_authentication_fail",
1084 "en" =>
"Authentication failed.",
1085 "de" =>
"Authentifizierung fehlgeschlagen."
1093 protected static function initLanguage(
bool $a_use_user_language =
true): void
1102 if ($a_use_user_language) {
1103 if (
$DIC->offsetExists(
'lng')) {
1104 $DIC->offsetUnset(
'lng');
1110 if (is_object($rbacsystem) &&
$DIC->offsetExists(
'tree')) {
1111 $rbacsystem->initMemberView();
1123 './Services/AccessControl/classes/class.ilRbacReview.php',
1133 './Services/AccessControl/classes/class.ilRbacAdmin.php',
1140 './Services/AccessControl/classes/class.ilAccess.php',
1163 ?
string $a_source_file =
null,
1164 ?
bool $destroy_existing =
false
1168 if ($destroy_existing) {
1172 if (isset(
$DIC[$a_name])) {
1173 unset(
$DIC[$a_name]);
1177 $GLOBALS[$a_name] = is_object($a_class) ? $a_class :
new $a_class();
1187 $GLOBALS[
'ilLog']->write(
"Fatal Error: ilInitialisation - " . $a_message);
1198 if ((defined(SHOWNOTICES) && SHOWNOTICES) || version_compare(PHP_VERSION,
'8.0',
'>=')) {
1199 error_reporting(-1);
1203 protected static bool $already_initialized =
false;
1207 self::$already_initialized =
false;
1214 self::initSession();
1218 self::resumeUserSession();
1228 if (self::$already_initialized) {
1233 $GLOBALS[
"DIC"][
"ilLoggerFactory"] =
function (
$c) {
1237 self::$already_initialized =
true;
1240 self::initHTTPServices(
$GLOBALS[
"DIC"]);
1243 self::initFileUploadService(
$GLOBALS[
"DIC"]);
1244 self::initSession();
1250 self::resumeUserSession();
1255 self::includePhp5Compliance();
1258 self::initLanguage(
true);
1259 $GLOBALS[
'DIC'][
'tree']->initLangCode();
1261 self::initInjector(
$GLOBALS[
'DIC']);
1262 self::initBackgroundTasks(
$GLOBALS[
'DIC']);
1263 self::initKioskMode(
$GLOBALS[
'DIC']);
1273 self::replaceSuperGlobals(
$GLOBALS[
'DIC']);
1281 if (isset(
$GLOBALS[
'DIC'][
'ilAuthSession'])) {
1282 unset(
$GLOBALS[
'DIC'][
'ilAuthSession']);
1287 $c[
'ilLoggerFactory']->getLogger(
'auth')
1289 $auth_session->init();
1290 return $auth_session;
1300 error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
1313 self::handleErrorReporting();
1318 self::requireCommonIncludes();
1326 "./Services/Init/classes/class.ilErrorHandling.php"
1335 self::removeUnsafeCharacters();
1337 self::initIliasIniFile();
1339 define(
'IL_INITIAL_WD', getcwd());
1342 self::initGlobal(
"ilias",
"ILIAS",
"./Services/Init/classes/class.ilias.php");
1352 self::setCookieConstants();
1354 self::determineClient();
1356 self::bootstrapFilesystems();
1358 self::initResourceStorage();
1360 self::initClientIniFile();
1367 self::handleDevMode();
1370 self::handleMaintenanceMode();
1372 self::initDatabase();
1374 self::initComponentService(
$DIC);
1377 self::initLanguage(
false);
1383 "ilAppEventHandler",
1384 "ilAppEventHandler",
1385 "./Services/EventHandling/classes/class.ilAppEventHandler.php"
1397 "./Services/Component/classes/class.ilPluginAdmin.php"
1400 self::initGlobal(
"https",
"ilHTTPS",
"./Services/Http/classes/class.ilHTTPS.php");
1401 self::initSettings();
1402 self::setSessionHandler();
1406 self::initCustomObjectIcons(
$GLOBALS[
'DIC']);
1407 self::initTermsOfService(
$GLOBALS[
'DIC']);
1408 self::initAccessibilityControlConcept(
$GLOBALS[
'DIC']);
1415 $https->enableSecureCookies();
1416 $https->checkProtocolAndRedirectIfNeeded();
1423 "ilObjectDataCache",
1424 "./Services/Object/classes/class.ilObjectDataCache.php"
1429 "ilObjectDefinition",
1430 "./Services/Object/classes/class.ilObjectDefinition.php"
1435 self::initGlobal(
"tree", $tree);
1438 self::setSessionCookieParams();
1439 self::setClientIdCookie();
1441 self::initRefinery(
$DIC);
1446 self::initGlobalScreen(
$DIC);
1460 "./Services/User/classes/class.ilObjUser.php",
1465 self::initAccessHandling();
1480 !
$DIC[
'ilAuthSession']->isAuthenticated() or
1481 $DIC[
'ilAuthSession']->isExpired()
1483 if (
$GLOBALS[
'DIC'][
'ilAuthSession']->isExpired()) {
1487 $current_script = substr(strrchr(
$_SERVER[
"PHP_SELF"],
"/"), 1);
1488 if (self::blockedAuthentication($current_script)) {
1494 self::handleAuthenticationFail();
1499 self::initUserAccount();
1505 protected static function handleAuthenticationSuccess(): void
1528 throw new Exception(
"Authentication failed.");
1531 if ((
$DIC->http()->request()->getQueryParams()[
'cmdMode'] ?? 0) ===
'asynch') {
1532 $DIC->language()->loadLanguageModule(
'init');
1533 $DIC->http()->saveResponse(
1534 $DIC->http()->response()
1536 ->withBody(Streams::ofString(
$DIC->language()->txt(
'init_error_authentication_fail')))
1538 $DIC->http()->sendResponse();
1539 $DIC->http()->close();
1542 $DIC[
'ilAuthSession']->isExpired() &&
1551 self::goToPublicSection();
1572 $c[
'global_screen'] =
function () use (
$c) {
1579 $c->globalScreen()->tool()->context()->stack()->clear();
1580 $c->globalScreen()->tool()->context()->claim()->main();
1591 $component_repository =
$c[
"component.repository"];
1592 $component_factory =
$c[
"component.factory"];
1593 foreach ($component_repository->getPlugins() as $pl) {
1594 if (!$pl->isActive()) {
1597 $plugin = $component_factory->getPlugin($pl->getId());
1598 $c[
'ui.renderer'] =
$plugin->exchangeUIRendererAfterInitialization(
$c);
1600 foreach (
$c->keys() as
$key) {
1601 if (strpos(
$key,
"ui.factory") === 0) {
1614 $dataFactory = new \ILIAS\Data\Factory();
1617 return new \ILIAS\Refinery\Factory($dataFactory, $language);
1629 $replace_super_globals = (
1630 !$client_ini->variableExists(
'server',
'prevent_super_global_replacement') ||
1631 !(bool) $client_ini->readVariable(
'server',
'prevent_super_global_replacement')
1634 if ($replace_super_globals) {
1635 $throwOnValueAssignment = defined(
'DEVMODE') && DEVMODE;
1663 self::initUIFramework(
$GLOBALS[
"DIC"]);
1665 self::initGlobal(
"tpl",
$tpl);
1668 $dispatcher = new \ILIAS\Init\StartupSequence\StartUpSequenceDispatcher(
$DIC);
1669 $dispatcher->dispatch();
1673 "ilNavigationHistory",
1674 "ilNavigationHistory",
1675 "Services/Navigation/classes/class.ilNavigationHistory.php"
1681 "Services/Help/classes/class.ilHelpGUI.php"
1687 "./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php"
1693 "./Services/Locator/classes/class.ilLocatorGUI.php"
1699 "./Services/UIComponent/Tabs/classes/class.ilTabsGUI.php"
1714 if (isset(
$_GET[
'offset']) &&
$_GET[
'offset'] !=
"") {
1718 self::initGlobal(
"lti",
"ilLTIViewGUI",
"./Services/LTI/classes/class.ilLTIViewGUI.php");
1720 self::initKioskMode(
$GLOBALS[
"DIC"]);
1726 $cmd = $_POST[
'cmd'] ?? (
$_GET[
'cmd'] ??
'');
1728 if (is_array($cmd)) {
1729 $cmd_keys = array_keys($cmd);
1730 $cmd = array_shift($cmd_keys) ??
'';
1768 $a_current_script ==
"register.php" ||
1769 $a_current_script ==
"pwassist.php" ||
1770 $a_current_script ==
"confirmReg.php" ||
1771 $a_current_script ==
"il_securimage_play.php" ||
1772 $a_current_script ==
"il_securimage_show.php" ||
1773 $a_current_script ==
'login.php'
1779 $requestBaseClass = strtolower((
string) (
$_GET[
'baseClass'] ??
''));
1780 if ($requestBaseClass == strtolower(ilStartUpGUI::class)) {
1781 $requestCmdClass = strtolower((
string) (
$_GET[
'cmdClass'] ??
''));
1783 $requestCmdClass == strtolower(ilAccountRegistrationGUI::class) ||
1784 $requestCmdClass == strtolower(ilPasswordAssistanceGUI::class)
1789 $cmd = self::getCurrentCmd();
1791 $cmd ==
"showTermsOfService" ||
1792 $cmd ==
'showAccountMigration' || $cmd ==
'migrateAccount' ||
1793 $cmd ==
'processCode' || $cmd ==
'showLoginPage' || $cmd ==
'showLogout' ||
1794 $cmd ==
'doStandardAuthentication' || $cmd ==
'doCasAuthentication'
1802 if (
$DIC->http()->wrapper()->query()->has(
'target')) {
1804 $target =
$_GET[
'target'];
1809 ($a_current_script ==
"goto.php" && $target ==
"impr_0") ||
1810 $requestBaseClass == strtolower(ilImprintGUI::class)
1817 (strtolower($requestCmdClass ??
"") === strtolower(ilAccessibilityControlConceptGUI::class))
1823 if ($a_current_script ==
'goto.php' && in_array($target, array(
1839 protected static function translateMessage(
string $a_message_id, array $a_message_static =
null): string
1848 } elseif (isset($_REQUEST[
"lang"])) {
1849 $lang = (string) $_REQUEST[
"lang"];
1852 } elseif ($ilClientIniFile) {
1853 $lang = $ilClientIniFile->readVariable(
"language",
"default");
1860 if (
$ilDB && $a_message_id) {
1865 $lng->loadLanguageModule(
"init");
1867 } elseif (is_array($a_message_static)) {
1868 if (!isset($a_message_static[
$lang])) {
1881 string $a_message_id =
'',
1882 array $a_message_static =
null
1885 if (defined(
"ILIAS_HTTP_PATH") &&
1886 !stristr($a_target, ILIAS_HTTP_PATH)) {
1887 $a_target = ILIAS_HTTP_PATH .
"/" . $a_target;
1890 foreach ([
'ext_uid',
'soap_pw'] as
$param) {
1891 if (
false === strpos(
1904 $message = self::translateMessage($a_message_id, $a_message_static);
1908 $link = self::translateMessage(
1909 "init_error_redirect_click",
1910 array(
"en" =>
'Please click to continue.',
1911 "de" =>
'Bitte klicken um fortzufahren.'
1915 '<br /><a href="' . $a_target .
'">' . $link .
'</a>';
1922 $mess = self::translateMessage(
1923 "init_error_redirect_info",
1924 array(
"en" =>
'Redirect not supported by context.',
1925 "de" =>
'Weiterleitungen werden durch Kontext nicht unterstützt.'
1928 ' (' . $a_target .
')';
1932 self::abortAndDie($mess);
1942 self::goToPublicSection();
1948 $DIC->http()->wrapper()->query()->has(
'target')
1950 $target =
$DIC->http()->wrapper()->query()->retrieve(
1952 $DIC->refinery()->kindlyTo()->string()
1958 if ($target ===
'') {
1960 $DIC->ctrl()->redirectToURL(ilUserUtil::getStartingPointAsUrl());
1963 $DIC->ctrl()->redirectToURL(
"goto.php?target=" . $target);
1971 $n_of_tasks =
$ilIliasIniFile->readVariable(
"background_tasks",
"number_of_concurrent_tasks");
1972 $sync =
$ilIliasIniFile->readVariable(
"background_tasks",
"concurrency");
1974 $n_of_tasks = $n_of_tasks ?: 5;
1975 $sync = $sync ?:
'sync';
1977 $c[
"bt.task_factory"] =
function (
$c) {
1978 return new \ILIAS\BackgroundTasks\Implementation\Tasks\BasicTaskFactory(
$c[
"di.injector"]);
1981 $c[
"bt.persistence"] =
function (
$c) {
1982 return \ILIAS\BackgroundTasks\Implementation\Persistence\BasicPersistence::instance(
$c->database());
1985 $c[
"bt.injector"] =
function (
$c) {
1989 $c[
"bt.task_manager"] =
function (
$c) use ($sync) {
1990 if ($sync ==
'sync') {
1991 return new \ILIAS\BackgroundTasks\Implementation\TaskManager\SyncTaskManager(
$c[
"bt.persistence"]);
1992 } elseif ($sync ==
'async') {
1993 return new \ILIAS\BackgroundTasks\Implementation\TaskManager\AsyncTaskManager(
$c[
"bt.persistence"]);
1995 throw new ilException(
"The supported Background Task Managers are sync and async. $sync given.");
2002 $c[
"di.dependency_map"] =
function (
$c) {
2003 return new \ILIAS\BackgroundTasks\Dependencies\DependencyMap\BaseDependencyMap();
2006 $c[
"di.injector"] =
function (
$c) {
2007 return new \ILIAS\BackgroundTasks\Dependencies\Injector(
$c,
$c[
"di.dependency_map"]);
2013 $c[
"service.kiosk_mode"] =
function (
$c) {
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
const PEAR_ERROR_CALLBACK
static orderBy($orderBy, string $orderDirection='ASC')
Customizing of pimple-DIC for ILIAS.
A result encapsulates a value or an error and simplifies the handling of those.
A result encapsulates a value or an error and simplifies the handling of those.
Class FilenameSanitizerPreProcessor.
Class InsecureFilenameSanitizerPreProcessor.
Class PreProcessorManagerImpl.
Class SVGBlacklistPreProcessor.
Class SuperGlobalDropInReplacement This Class wraps SuperGlobals such as $_GET and $_POST to prevent ...
Class WhiteAndBlacklistedFileNamePolicy.
Class DBRepositoryPreloader.
Class ResourceDBRepository.
Class RevisionDBRepository.
Interface StakeholderDBRepository.
Class FileSystemStorageHandler.
Class StorageHandlerFactory.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class InitCtrlService wraps the initialization of ilCtrl.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Responsible for loading the Resource Storage into the dependency injection container of ILIAS.
Responsible for loading the UI Framework into the dependency injection container of ILIAS.
static setErrorHandling($mode=null, $options=null)
Sets how errors generated by this object should be handled.
if(!isset($GLOBALS['ilGlobalStartTime'])||! $GLOBALS['ilGlobalStartTime']) global $DIC
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const CONTEXT_HTTP
HTTP Auth used for WebDAV and CalDAV If a special handling for WebDAV or CalDAV is required overwrite...
static getInstance(\ilLogger $logger)
Get instance.
static isAuthenticationForced()
Check if authentication is should be forced.
static handleForcedAuthentication()
static modifyHttpPath(string $httpPath)
static supportsRedirects()
Are redirects supported?
static hasUser()
Based on user authentication?
static supportsPersistentSessions()
Check if context supports persistent session handling.
static getType()
Get context type.
static hasHTML()
Has HTML output.
static usesHTTP()
Uses HTTP aka browser.
const CONTEXT_LTI_PROVIDER
static initClient()
Init client.
static getCountryCodes()
Get country codes (DIN EN 3166-1)
static getWrapper(string $a_type)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilFileServicesFilenameSanitizer.
Class ilFileServicesPolicy.
static removeTrailingPathSeparators(string $path)
Class ilGSProviderFactory.
Class ilGlobalCacheSettings.
static setup(ilGlobalCacheSettings $ilGlobalCacheSettings)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS Initialisation Utility Class perform basic setup: init database handler, load configuration fil...
static setClientIdCookie()
static initDatabase()
initialise database object $ilDB
static initHTTPServices(\ILIAS\DI\Container $container)
static goToLogin()
go to login
static initILIAS()
ilias initialisation
static initLocale()
Init Locale.
static removeUnsafeCharacters()
Remove unsafe characters from GET.
static buildHTTPPath()
builds http path
static requireCommonIncludes()
get common include code files
static initClientIniFile()
This method provides a global instance of class ilIniFile for the client.ini.php file in variable $il...
static initSession()
Init auth session.
static initClient()
Init client-based objects (level 1)
static initCore()
Init core objects (level 0)
static recursivelyRemoveUnsafeCharacters($var)
static initUIFramework(\ILIAS\DI\Container $c)
init the ILIAS UI framework.
static includePhp5Compliance()
This is a hack for authentication.
static handleErrorReporting()
Set error reporting level.
static initFileUploadService(\ILIAS\DI\Container $dic)
Initializes the file upload service.
static initComponentService(\ILIAS\DI\Container $container)
static redirect(string $a_target, string $a_message_id='', array $a_message_static=null)
Redirects to target url if context supports it.
static determineClient()
This method determines the current client and sets the constant CLIENT_ID.
static initHTML()
init HTML output (level 3)
static initLog()
Init log instance.
static initAvatar(\ILIAS\DI\Container $c)
static goToPublicSection()
go to public section
static resumeUserSession()
Resume an existing user session.
static setSessionHandler()
set session handler to db Used in Soap/CAS
static handleDevMode()
Prepare developer tools.
static setCookieConstants()
static initUser()
Init user / authentification (level 2)
static initKioskMode(\ILIAS\DI\Container $c)
static initGlobal(string $a_name, $a_class, ?string $a_source_file=null, ?bool $destroy_existing=false)
static handleAuthenticationFail()
static initBackgroundTasks(\ILIAS\DI\Container $c)
static initInjector(\ILIAS\DI\Container $c)
static setSessionCookieParams()
set session cookie params
static initResourceStorage()
static abortAndDie(string $a_message)
static blockedAuthentication(string $a_current_script)
Block authentication based on current request.
static initSettings()
initialise $ilSettings object and define constants Used in Soap
static initGlobalScreen(\ILIAS\DI\Container $c)
static initMail(\ILIAS\DI\Container $c)
static redirectToStartingPage(string $target='')
static initTermsOfService(\ILIAS\DI\Container $c)
static initRefinery(\ILIAS\DI\Container $container)
static initAccessibilityControlConcept(\ILIAS\DI\Container $c)
static getClientIdTransformation()
Refinery is not initialized early enough to provide a transformation to be used with the \ILIAS\HTTP ...
static handleMaintenanceMode()
handle maintenance mode
static initAccessHandling()
$ilAccess and $rbac... initialisation
static initUserAccount()
Init user with current account id.
static initCustomObjectIcons(\ILIAS\DI\Container $c)
static initCron(\ILIAS\DI\Container $c)
static initIliasIniFile()
This method provides a global instance of class ilIniFile for the ilias.ini.php file in variable $ilI...
static initStyle()
provide $styleDefinition object
static translateMessage(string $a_message_id, array $a_message_static=null)
Translate message if possible.
Central entry point for users of the service.
static getFallbackInstance()
Builds a global default language instance.
static getGlobalInstance()
Builds the global language object.
static getRootLogger()
The unique root logger has a fixed error level.
static getLogger(string $a_component_id)
Get component logger.
Class ilMailTemplateRepository.
Class ilObjTermsOfService.
static _isAnonymous(int $usr_id)
static updateAccess(ilObjUser $user)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Database Session Handling.
static _exists(string $a_session_id)
Check whether session exists.
const SESSION_CLOSE_LOGIN
static setClosingContext(int $a_context)
set closing context (for statistics)
static _destroy($a_session_id, ?int $a_closing_context=null, $a_expired_at=null)
Destroy session.
const SESSION_CLOSE_PUBLIC
static set(string $a_var, $a_val)
Set a value.
const SESSION_CLOSE_EXPIRE
Class ilTermsOfServiceCriterionTypeFactory.
Class ilTermsOfServiceDataGatewayFactory.
Class ilTermsOfServiceHelper.
Interface ilTermsOfServiceLogicalAndDocumentCriteriaEvaluation.
Interface ilTermsOfServiceSequentialDocumentEvaluation.
static initDefaultTimeZone(ilIniFile $ini)
Initialize default timezone from system settings.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
static redirect(string $a_script)
static setCookie(string $a_cookie_name, string $a_cookie_value='', bool $a_also_set_super_global=true, bool $a_set_cookie_invalid=false)
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const ILIAS_VERSION_NUMERIC
A result encapsulates a value or an error and simplifies the handling of those.
then(callable $f)
Get a new result from the callable or do nothing if this is an error.
Interface FilesystemFactory.
Interface ilTermsOfServiceCriterionTypeFactoryInterface.
Interface ilTermsOfServiceDocumentEvaluation.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
static http()
Fetches the global http state from ILIAS.
applyTo(Result $result)
@inheritDoc
__invoke($from)
@inheritDoc
Class ChatMainBarProvider \MainMenu\Provider.