ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilInitialisation.php
Go to the documentation of this file.
1<?php
18// TODO:
41
42require_once("libs/composer/vendor/autoload.php");
43
44// needed for slow queries, etc.
45if (!isset($GLOBALS['ilGlobalStartTime']) || !$GLOBALS['ilGlobalStartTime']) {
46 $GLOBALS['ilGlobalStartTime'] = microtime();
47}
48
49global $DIC;
50if (null === $DIC) {
51 // Don't remove this, intellisense autocompletion does not work in PhpStorm without a top level assignment
52 $DIC = new Container();
53}
54
55include_once "Services/Context/classes/class.ilContext.php";
56
73{
77 protected static function removeUnsafeCharacters()
78 {
79 // Remove unsafe characters from GET parameters.
80 // We do not need this characters in any case, so it is
81 // feasible to filter them everytime. POST parameters
82 // need attention through ilUtil::stripSlashes() and similar functions)
84 }
85
86 protected static function recursivelyRemoveUnsafeCharacters($var)
87 {
88 if (is_array($var)) {
89 $mod = [];
90 foreach ($var as $k => $v) {
93 }
94 return $mod;
95 }
96 return strip_tags(
97 str_replace(
98 array("\x00", "\n", "\r", "\\", "'", '"', "\x1a"),
99 "",
100 $var
101 )
102 );
103 }
104
108 protected static function requireCommonIncludes()
109 {
110 // ilTemplate
112 require_once "./Services/UICore/classes/class.ilTemplate.php";
113 }
114
115 // really always required?
116 require_once "./Services/Utilities/classes/class.ilUtil.php";
117 require_once "./Services/Calendar/classes/class.ilDatePresentation.php";
118 require_once "include/inc.ilias_version.php";
119
120 include_once './Services/Authentication/classes/class.ilAuthUtils.php';
121
122 self::initGlobal("ilBench", "ilBenchmark", "./Services/Utilities/classes/class.ilBenchmark.php");
123 }
124
130 protected static function includePhp5Compliance()
131 {
132 include_once 'Services/Authentication/classes/class.ilAuthFactory.php';
134 require_once("include/inc.xml5compliance.php");
135 }
136 require_once("include/inc.xsl5compliance.php");
137 }
138
146 protected static function initIliasIniFile()
147 {
148 require_once("./Services/Init/classes/class.ilIniFile.php");
149 $ilIliasIniFile = new ilIniFile("./ilias.ini.php");
150 $ilIliasIniFile->read();
151 self::initGlobal('ilIliasIniFile', $ilIliasIniFile);
152
153 // initialize constants
154 define("ILIAS_DATA_DIR", $ilIliasIniFile->readVariable("clients", "datadir"));
155 define("ILIAS_WEB_DIR", $ilIliasIniFile->readVariable("clients", "path"));
156 define("ILIAS_ABSOLUTE_PATH", $ilIliasIniFile->readVariable('server', 'absolute_path'));
157
158 // logging
159 define("ILIAS_LOG_DIR", $ilIliasIniFile->readVariable("log", "path"));
160 define("ILIAS_LOG_FILE", $ilIliasIniFile->readVariable("log", "file"));
161 define("ILIAS_LOG_ENABLED", $ilIliasIniFile->readVariable("log", "enabled"));
162 define("ILIAS_LOG_LEVEL", $ilIliasIniFile->readVariable("log", "level"));
163 define("SLOW_REQUEST_TIME", $ilIliasIniFile->readVariable("log", "slow_request_time"));
164
165 // read path + command for third party tools from ilias.ini
166 define("PATH_TO_CONVERT", $ilIliasIniFile->readVariable("tools", "convert"));
167 define("PATH_TO_FFMPEG", $ilIliasIniFile->readVariable("tools", "ffmpeg"));
168 define("PATH_TO_ZIP", $ilIliasIniFile->readVariable("tools", "zip"));
169 define("PATH_TO_MKISOFS", $ilIliasIniFile->readVariable("tools", "mkisofs"));
170 define("PATH_TO_UNZIP", $ilIliasIniFile->readVariable("tools", "unzip"));
171 define("PATH_TO_GHOSTSCRIPT", $ilIliasIniFile->readVariable("tools", "ghostscript"));
172 define("PATH_TO_JAVA", $ilIliasIniFile->readVariable("tools", "java"));
173 define("URL_TO_LATEX", $ilIliasIniFile->readVariable("tools", "latex"));
174 define("PATH_TO_FOP", $ilIliasIniFile->readVariable("tools", "fop"));
175 define("PATH_TO_LESSC", $ilIliasIniFile->readVariable("tools", "lessc"));
176 define("PATH_TO_PHANTOMJS", $ilIliasIniFile->readVariable("tools", "phantomjs"));
177
178 if ($ilIliasIniFile->groupExists('error')) {
179 if ($ilIliasIniFile->variableExists('error', 'editor_url')) {
180 define("ERROR_EDITOR_URL", $ilIliasIniFile->readVariable('error', 'editor_url'));
181 }
182
183 if ($ilIliasIniFile->variableExists('error', 'editor_path_translations')) {
184 define("ERROR_EDITOR_PATH_TRANSLATIONS", $ilIliasIniFile->readVariable('error', 'editor_path_translations'));
185 }
186 }
187
188 // read virus scanner settings
189 switch ($ilIliasIniFile->readVariable("tools", "vscantype")) {
190 case "sophos":
191 define("IL_VIRUS_SCANNER", "Sophos");
192 define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
193 define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
194 break;
195
196 case "antivir":
197 define("IL_VIRUS_SCANNER", "AntiVir");
198 define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
199 define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
200 break;
201
202 case "clamav":
203 define("IL_VIRUS_SCANNER", "ClamAV");
204 define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
205 define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
206 break;
207 case "icap":
208 define("IL_VIRUS_SCANNER", "icap");
209 define("IL_ICAP_HOST", $ilIliasIniFile->readVariable("tools", "icap_host"));
210 define("IL_ICAP_PORT", $ilIliasIniFile->readVariable("tools", "icap_port"));
211 define("IL_ICAP_AV_COMMAND", $ilIliasIniFile->readVariable("tools", "icap_service_name"));
212 define("IL_ICAP_CLIENT", $ilIliasIniFile->readVariable("tools", "icap_client_path"));
213 break;
214
215 default:
216 define("IL_VIRUS_SCANNER", "None");
217 break;
218 }
219 define("IL_VIRUS_CLEAN_COMMAND", '');
220
221 include_once './Services/Calendar/classes/class.ilTimeZone.php';
223 define("IL_TIMEZONE", $tz);
224 }
225
226 protected static function initResourceStorage() : void
227 {
228 global $DIC;
229
230 $DIC['resource_storage'] = static function (Container $c) : \ILIAS\ResourceStorage\Services {
231 $revision_repository = new RevisionDBRepository($c->database());
232 $resource_repository = new ResourceDBRepository($c->database());
233 $information_repository = new InformationDBRepository($c->database());
234 $stakeholder_repository = new StakeholderDBRepository($c->database());
235 return new \ILIAS\ResourceStorage\Services(
237 new MaxNestingFileSystemStorageHandler($c['filesystem.storage'], Location::STORAGE),
238 new FileSystemStorageHandler($c['filesystem.storage'], Location::STORAGE)
239 ]),
240 $revision_repository,
241 $resource_repository,
242 $information_repository,
243 $stakeholder_repository,
244 new LockHandlerilDB($c->database()),
247 $c->database(),
248 $resource_repository,
249 $revision_repository,
250 $information_repository,
251 $stakeholder_repository
252 )
253 );
254 };
255 }
256
257
269 public static function bootstrapFilesystems()
270 {
271 global $DIC;
272
273 $DIC['filesystem.security.sanitizing.filename'] = function ($c) {
274 return new FilenameSanitizerImpl();
275 };
276
277 $DIC['filesystem.factory'] = function ($c) {
278 return new \ILIAS\Filesystem\Provider\DelegatingFilesystemFactory($c['filesystem.security.sanitizing.filename']);
279 };
280
281 $DIC['filesystem.web'] = function ($c) {
282 //web
283
287 $delegatingFactory = $c['filesystem.factory'];
288 $webConfiguration = new \ILIAS\Filesystem\Provider\Configuration\LocalConfig(ILIAS_ABSOLUTE_PATH . '/' . ILIAS_WEB_DIR . '/' . CLIENT_ID);
289 return $delegatingFactory->getLocal($webConfiguration);
290 };
291
292 $DIC['filesystem.storage'] = function ($c) {
293 //storage
294
298 $delegatingFactory = $c['filesystem.factory'];
299 $storageConfiguration = new \ILIAS\Filesystem\Provider\Configuration\LocalConfig(ILIAS_DATA_DIR . '/' . CLIENT_ID);
300 return $delegatingFactory->getLocal($storageConfiguration);
301 };
302
303 $DIC['filesystem.temp'] = function ($c) {
304 //temp
305
309 $delegatingFactory = $c['filesystem.factory'];
310 $tempConfiguration = new \ILIAS\Filesystem\Provider\Configuration\LocalConfig(ILIAS_DATA_DIR . '/' . CLIENT_ID . '/temp');
311 return $delegatingFactory->getLocal($tempConfiguration);
312 };
313
314 $DIC['filesystem.customizing'] = function ($c) {
315 //customizing
316
320 $delegatingFactory = $c['filesystem.factory'];
321 $customizingConfiguration = new \ILIAS\Filesystem\Provider\Configuration\LocalConfig(ILIAS_ABSOLUTE_PATH . '/' . 'Customizing');
322 return $delegatingFactory->getLocal($customizingConfiguration);
323 };
324
325 $DIC['filesystem.libs'] = function ($c) {
326 //customizing
327
331 $delegatingFactory = $c['filesystem.factory'];
332 $customizingConfiguration = new \ILIAS\Filesystem\Provider\Configuration\LocalConfig(ILIAS_ABSOLUTE_PATH . '/' . 'libs');
333 return $delegatingFactory->getLocal($customizingConfiguration, true);
334 };
335
336 $DIC['filesystem.node_modules'] = function ($c) {
337 //customizing
338
342 $delegatingFactory = $c['filesystem.factory'];
343 $customizingConfiguration = new \ILIAS\Filesystem\Provider\Configuration\LocalConfig(ILIAS_ABSOLUTE_PATH . '/' . 'node_modules');
344 return $delegatingFactory->getLocal($customizingConfiguration, true);
345 };
346
347 $DIC['filesystem'] = function ($c) {
348 return new \ILIAS\Filesystem\FilesystemsImpl(
349 $c['filesystem.storage'],
350 $c['filesystem.web'],
351 $c['filesystem.temp'],
352 $c['filesystem.customizing'],
353 $c['filesystem.libs'],
354 $c['filesystem.node_modules']
355 );
356 };
357 }
358
359
368 public static function initFileUploadService(\ILIAS\DI\Container $dic)
369 {
370 $dic['upload.processor-manager'] = function ($c) {
371 return new PreProcessorManagerImpl();
372 };
373
374 $dic['upload'] = function (\ILIAS\DI\Container $c) {
375 $fileUploadImpl = new \ILIAS\FileUpload\FileUploadImpl($c['upload.processor-manager'], $c['filesystem'], $c['http']);
376 if ((defined('IL_VIRUS_SCANNER') && IL_VIRUS_SCANNER != "None") || (defined('IL_SCANNER_TYPE') && IL_SCANNER_TYPE == "1")) {
377 $fileUploadImpl->register(new VirusScannerPreProcessor(ilVirusScannerFactory::_getInstance()));
378 }
379
380 $fileUploadImpl->register(new FilenameSanitizerPreProcessor());
381 $fileUploadImpl->register(new InsecureFilenameSanitizerPreProcessor());
382 $fileUploadImpl->register(new BlacklistExtensionPreProcessor(ilFileUtils::getExplicitlyBlockedFiles(), $c->language()->txt("msg_info_blacklisted")));
383 $fileUploadImpl->register(new SVGBlacklistPreProcessor());
384
385 return $fileUploadImpl;
386 };
387 }
388
392 protected static function buildHTTPPath()
393 {
394 include_once './Services/Http/classes/class.ilHTTPS.php';
395 $https = new ilHTTPS();
396
397 if ($https->isDetected()) {
398 $protocol = 'https://';
399 } else {
400 $protocol = 'http://';
401 }
402 $host = $_SERVER['HTTP_HOST'];
403
404 $rq_uri = strip_tags($_SERVER['REQUEST_URI']);
405
406 // security fix: this failed, if the URI contained "?" and following "/"
407 // -> we remove everything after "?"
408 if (is_int($pos = strpos($rq_uri, "?"))) {
409 $rq_uri = substr($rq_uri, 0, $pos);
410 }
411
412 if (!defined('ILIAS_MODULE')) {
413 $path = pathinfo($rq_uri);
414 if (!$path['extension']) {
415 $uri = $rq_uri;
416 } else {
417 $uri = dirname($rq_uri);
418 }
419 } else {
420 // if in module remove module name from HTTP_PATH
421 $path = dirname($rq_uri);
422
423 // dirname cuts the last directory from a directory path e.g content/classes return content
425
426 $dirs = explode('/', $module);
427 $uri = $path;
428 foreach ($dirs as $dir) {
429 $uri = dirname($uri);
430 }
431 }
432
433 $ilias_http_path = ilContext::modifyHttpPath(implode('', [$protocol, $host, $uri]));
434
435 // remove everything after the first .php in the path
436 $ilias_http_path = preg_replace('/(http|https)(:\/\/)(.*?\/.*?\.php).*/', '$1$2$3', $ilias_http_path);
437
438 $f = new \ILIAS\Data\Factory();
439 $uri = $f->uri(ilUtil::removeTrailingPathSeparators($ilias_http_path));
440
441 $base_URI = $uri->getBaseURI();
442
443 return define('ILIAS_HTTP_PATH', $base_URI);
444 }
445
450 protected static function determineClient() : void
451 {
452 global $ilIliasIniFile;
453
454 if (defined('CLIENT_ID')) {
455 return;
456 }
457
458 // check whether ini file object exists
459 if (!is_object($ilIliasIniFile)) {
460 self::abortAndDie('Fatal Error: ilInitialisation::determineClient called without initialisation of ILIAS ini file object.');
461 }
462
463 $default_client_id = $ilIliasIniFile->readVariable('clients', 'default');
464
465 $client_id_to_use = '';
466 if (isset($_GET['client_id']) && is_string($_GET['client_id'])) {
467 $client_id_to_use = $_GET['client_id'];
468 }
469
470 if ($client_id_to_use === '' && isset($_COOKIE['ilClientId']) && is_string($_COOKIE['ilClientId'])) {
471 $client_id_to_use = $_COOKIE['ilClientId'];
472 }
473
474 $client_id_to_use = $client_id_to_use ?: $default_client_id;
475
476 define('CLIENT_ID', ilUtil::getClientIdByString($client_id_to_use)->toString());
477 }
478
491 protected static function initClientIniFile()
492 {
493 global $ilIliasIniFile;
494
495 // check whether ILIAS_WEB_DIR is set.
496 if (ILIAS_WEB_DIR == "") {
497 self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile called without ILIAS_WEB_DIR.");
498 }
499
500 // check whether CLIENT_ID is set.
501 if (CLIENT_ID == "") {
502 self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile called without CLIENT_ID.");
503 }
504
505 $ini_file = "./" . ILIAS_WEB_DIR . "/" . CLIENT_ID . "/client.ini.php";
506
507 // get settings from ini file
508 $ilClientIniFile = new ilIniFile($ini_file);
509 $ilClientIniFile->read();
510
511 // invalid client id / client ini
512 if ($ilClientIniFile->ERROR != "") {
513 $default_client = $ilIliasIniFile->readVariable("clients", "default");
514 if (CLIENT_ID !== $default_client) {
515 $mess = array("en" => "Client does not exist.",
516 "de" => "Mandant ist ungültig.");
517 self::redirect("index.php?client_id=" . $default_client, null, $mess);
518 } else {
519 self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile initializing client ini file abborted with: " . $ilClientIniFile->ERROR);
520 }
521 }
522
523 self::initGlobal("ilClientIniFile", $ilClientIniFile);
524
525 // set constants
526 define("SESSION_REMINDER_LEADTIME", 30);
527 define("DEBUG", $ilClientIniFile->readVariable("system", "DEBUG"));
528 define("DEVMODE", $ilClientIniFile->readVariable("system", "DEVMODE"));
529 define("SHOWNOTICES", $ilClientIniFile->readVariable("system", "SHOWNOTICES"));
530 define("DEBUGTOOLS", $ilClientIniFile->readVariable("system", "DEBUGTOOLS"));
531 define("ROOT_FOLDER_ID", $ilClientIniFile->readVariable('system', 'ROOT_FOLDER_ID'));
532 define("SYSTEM_FOLDER_ID", $ilClientIniFile->readVariable('system', 'SYSTEM_FOLDER_ID'));
533 define("ROLE_FOLDER_ID", $ilClientIniFile->readVariable('system', 'ROLE_FOLDER_ID'));
534 define("MAIL_SETTINGS_ID", $ilClientIniFile->readVariable('system', 'MAIL_SETTINGS_ID'));
535 $error_handler = $ilClientIniFile->readVariable('system', 'ERROR_HANDLER');
536 define("ERROR_HANDLER", $error_handler ? $error_handler : "PRETTY_PAGE");
537
538 // this is for the online help installation, which sets OH_REF_ID to the
539 // ref id of the online module
540 define("OH_REF_ID", $ilClientIniFile->readVariable("system", "OH_REF_ID"));
541
542 define("SYSTEM_MAIL_ADDRESS", $ilClientIniFile->readVariable('system', 'MAIL_SENT_ADDRESS')); // Change SS
543 define("MAIL_REPLY_WARNING", $ilClientIniFile->readVariable('system', 'MAIL_REPLY_WARNING')); // Change SS
544
545 // see ilObject::TITLE_LENGTH, ilObject::DESC_LENGTH
546 // define ("MAXLENGTH_OBJ_TITLE",125);#$ilClientIniFile->readVariable('system','MAXLENGTH_OBJ_TITLE'));
547 // define ("MAXLENGTH_OBJ_DESC",$ilClientIniFile->readVariable('system','MAXLENGTH_OBJ_DESC'));
548
549 define("CLIENT_DATA_DIR", ILIAS_DATA_DIR . "/" . CLIENT_ID);
550 define("CLIENT_WEB_DIR", ILIAS_ABSOLUTE_PATH . "/" . ILIAS_WEB_DIR . "/" . CLIENT_ID);
551 define("CLIENT_NAME", $ilClientIniFile->readVariable('client', 'name')); // Change SS
552
553 $val = $ilClientIniFile->readVariable("db", "type");
554 if ($val == "") {
555 define("IL_DB_TYPE", "mysql");
556 } else {
557 define("IL_DB_TYPE", $val);
558 }
559
560 $ilGlobalCacheSettings = new ilGlobalCacheSettings();
561 $ilGlobalCacheSettings->readFromIniFile($ilClientIniFile);
562 ilGlobalCache::setup($ilGlobalCacheSettings);
563
564 return true;
565 }
566
570 protected static function handleMaintenanceMode()
571 {
572 global $ilClientIniFile;
573
574 if (!$ilClientIniFile->readVariable("client", "access")) {
575 $mess = array(
576 "en" => "The server is not available due to maintenance." .
577 " We apologise for any inconvenience.",
578 "de" => "Der Server ist aufgrund von Wartungsarbeiten aktuell nicht verf&uuml;gbar." .
579 " Wir bitten um Verst&auml;ndnis. Versuchen Sie es sp&auml;ter noch einmal."
580 );
581 $mess_id = "init_error_maintenance";
582
583 if (ilContext::hasHTML() && is_file("./maintenance.html")) {
584 self::redirect("./maintenance.html", $mess_id, $mess);
585 } else {
586 $mess = self::translateMessage($mess_id, $mess);
587 self::abortAndDie($mess);
588 }
589 }
590 }
591
596 protected static function initDatabase()
597 {
598 // build dsn of database connection and connect
600 $ilDB->initFromIniFile();
601 $ilDB->connect();
602
603 self::initGlobal("ilDB", $ilDB);
604 }
605
611 public static function setSessionHandler()
612 {
613 if (ini_get('session.save_handler') != 'user' && version_compare(PHP_VERSION, '7.2.0', '<')) {
614 ini_set("session.save_handler", "user");
615 }
616
617 require_once "Services/Authentication/classes/class.ilSessionDBHandler.php";
618 $db_session_handler = new ilSessionDBHandler();
619 if (!$db_session_handler->setSaveHandler()) {
620 self::abortAndDie("Please turn off Safe mode OR set session.save_handler to \"user\" in your php.ini");
621 }
622
623 // Do not accept external session ids
624 if (!ilSession::_exists(session_id()) && !defined('IL_PHPUNIT_TEST')) {
625 // php7-todo, correct-with-php5-removal : alex, 1.3.2016: added if, please check
626 if (function_exists("session_status") && session_status() == PHP_SESSION_ACTIVE) {
627 session_regenerate_id();
628 }
629 }
630 }
631
635 protected static function setCookieConstants()
636 {
637 include_once 'Services/Authentication/classes/class.ilAuthFactory.php';
639 $cookie_path = '/';
640 } elseif ($GLOBALS['COOKIE_PATH']) {
641 // use a predefined cookie path from WebAccessChecker
642 $cookie_path = $GLOBALS['COOKIE_PATH'];
643 } else {
644 $cookie_path = dirname($_SERVER['PHP_SELF']);
645 }
646
647 /* if ilias is called directly within the docroot $cookie_path
648 is set to '/' expecting on servers running under windows..
649 here it is set to '\'.
650 in both cases a further '/' won't be appended due to the following regex
651 */
652 $cookie_path .= (!preg_match("/[\/|\\\\]$/", $cookie_path)) ? "/" : "";
653
654 if ($cookie_path == "\\") {
655 $cookie_path = '/';
656 }
657
658 define('IL_COOKIE_HTTPONLY', true); // Default Value
659 define('IL_COOKIE_EXPIRE', 0);
660 define('IL_COOKIE_PATH', $cookie_path);
661 define('IL_COOKIE_DOMAIN', '');
662 }
663
664 private static function setClientIdCookie() : void
665 {
666 if (defined('CLIENT_ID') &&
667 !defined('IL_PHPUNIT_TEST') &&
669 ilUtil::setCookie('ilClientId', CLIENT_ID);
670 }
671 }
672
676 protected static function setSessionCookieParams()
677 {
678 global $ilSetting;
679
680 if (!defined('IL_COOKIE_SECURE')) {
681 // If this code is executed, we can assume that \ilHTTPS::enableSecureCookies was NOT called before
682 // \ilHTTPS::enableSecureCookies already executes session_set_cookie_params()
683
684 include_once './Services/Http/classes/class.ilHTTPS.php';
685 $cookie_secure = !$ilSetting->get('https', 0) && ilHTTPS::getInstance()->isDetected();
686 define('IL_COOKIE_SECURE', $cookie_secure); // Default Value
687
688 $cookie_parameters = [
689 'lifetime' => IL_COOKIE_EXPIRE,
690 'path' => IL_COOKIE_PATH,
691 'domain' => IL_COOKIE_DOMAIN,
692 'secure' => IL_COOKIE_SECURE,
693 'httponly' => IL_COOKIE_HTTPONLY,
694 ];
695
696 if (
697 $cookie_secure &&
698 (!isset(session_get_cookie_params()['samesite']) || strtolower(session_get_cookie_params()['samesite']) !== 'strict')
699 ) {
700 $cookie_parameters['samesite'] = 'Lax';
701 }
702
703 session_set_cookie_params($cookie_parameters);
704 }
705 }
706
710 protected static function initMail(\ILIAS\DI\Container $c)
711 {
712 $c["mail.mime.transport.factory"] = function (\ILIAS\DI\Container $c) {
713 return new \ilMailMimeTransportFactory($c->settings(), $c->event());
714 };
715 $c["mail.mime.sender.factory"] = function (\ILIAS\DI\Container $c) {
716 return new \ilMailMimeSenderFactory($c->settings());
717 };
718 $c["mail.texttemplates.service"] = function (\ILIAS\DI\Container $c) {
719 return new \ilMailTemplateService(new \ilMailTemplateRepository($c->database()));
720 };
721 }
722
726 protected static function initCustomObjectIcons(\ILIAS\DI\Container $c)
727 {
728 $c["object.customicons.factory"] = function ($c) {
729 require_once 'Services/Object/Icon/classes/class.ilObjectCustomIconFactory.php';
730 return new ilObjectCustomIconFactory(
731 $c->filesystem()->web(),
732 $c->upload(),
733 $c['ilObjDataCache']
734 );
735 };
736 }
737
741 protected static function initAvatar(\ILIAS\DI\Container $c)
742 {
743 $c["user.avatar.factory"] = function ($c) {
744 return new \ilUserAvatarFactory($c);
745 };
746 }
747
751 protected static function initTermsOfService(\ILIAS\DI\Container $c)
752 {
753 $c['tos.criteria.type.factory'] = function (
757 $c->rbac()->review(),
758 $c['ilObjDataCache'],
760 );
761 };
762
763 $c['tos.service'] = function (\ILIAS\DI\Container $c) : ilTermsOfServiceHelper {
764 $persistence = new ilTermsOfServiceDataGatewayFactory();
765 $persistence->setDatabaseAdapter($c->database());
766 return new ilTermsOfServiceHelper(
767 $persistence,
768 $c['tos.document.evaluator'],
769 $c['tos.criteria.type.factory'],
771 );
772 };
773
774 $c['tos.document.evaluator'] = function (\ILIAS\DI\Container $c) : ilTermsOfServiceDocumentEvaluation {
777 $c['tos.criteria.type.factory'],
778 $c->user(),
779 $c->logger()->tos()
780 ),
781 $c->user(),
782 $c->logger()->tos(),
783 ilTermsOfServiceDocument::orderBy('sorting')->get()
784 );
785 };
786 }
787
789 {
790 $c['acc.criteria.type.factory'] = function (\ILIAS\DI\Container $c) {
791 return new ilAccessibilityCriterionTypeFactory($c->rbac()->review(), $c['ilObjDataCache']);
792 };
793
794 $c['acc.document.evaluator'] = function (\ILIAS\DI\Container $c) {
797 $c['acc.criteria.type.factory'],
798 $c->user(),
799 $c->logger()->acc()
800 ),
801 $c->user(),
802 $c->logger()->acc(),
803 \ilAccessibilityDocument::orderBy('sorting')->get()
804 );
805 };
806 }
807
813 protected static function initSettings()
814 {
815 global $ilSetting;
816
818 "ilSetting",
819 "ilSetting",
820 "Services/Administration/classes/class.ilSetting.php"
821 );
822
823 // check correct setup
824 if (!$ilSetting->get("setup_ok")) {
825 self::abortAndDie("Setup is not completed. Please run setup routine again.");
826 }
827
828 // set anonymous user & role id and system role id
829 define("ANONYMOUS_USER_ID", $ilSetting->get("anonymous_user_id"));
830 define("ANONYMOUS_ROLE_ID", $ilSetting->get("anonymous_role_id"));
831 define("SYSTEM_USER_ID", $ilSetting->get("system_user_id"));
832 define("SYSTEM_ROLE_ID", $ilSetting->get("system_role_id"));
833 define("USER_FOLDER_ID", 7);
834
835 // recovery folder
836 define("RECOVERY_FOLDER_ID", $ilSetting->get("recovery_folder_id"));
837
838 // installation id
839 define("IL_INST_ID", $ilSetting->get("inst_id", 0));
840
841 // define default suffix replacements
842 define("SUFFIX_REPL_DEFAULT", "php,php3,php4,inc,lang,phtml,htaccess");
843 define("SUFFIX_REPL_ADDITIONAL", $ilSetting->get("suffix_repl_additional"));
844
845 if (ilContext::usesHTTP()) {
847 }
848 }
849
853 protected static function initStyle()
854 {
855 global $DIC, $ilPluginAdmin;
856
857 // load style definitions
859 "styleDefinition",
860 "ilStyleDefinition",
861 "./Services/Style/System/classes/class.ilStyleDefinition.php"
862 );
863
864 // add user interface hook for style initialisation
865 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
866 foreach ($pl_names as $pl) {
867 $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
868 $gui_class = $ui_plugin->getUIClassInstance();
869 $gui_class->modifyGUI("Services/Init", "init_style", array("styleDefinition" => $DIC->systemStyle()));
870 }
871 }
872
876 public static function initUserAccount()
877 {
878 global $DIC;
879
880 static $context_init;
881
882 $uid = $GLOBALS['DIC']['ilAuthSession']->getUserId();
883 if ($uid) {
884 $DIC->user()->setId($uid);
885 $DIC->user()->read();
886 if (!isset($context_init)) {
887 if ($DIC->user()->isAnonymous()) {
888 $DIC->globalScreen()->tool()->context()->claim()->external();
889 } else {
890 $DIC->globalScreen()->tool()->context()->claim()->internal();
891 }
892 $context_init = true;
893 }
894 // init console log handler
895 ilLoggerFactory::getInstance()->initUser($DIC->user()->getLogin());
896 \ilOnlineTracking::updateAccess($DIC->user());
897 } else {
898 if (is_object($GLOBALS['ilLog'])) {
899 $GLOBALS['ilLog']->logStack();
900 }
901 self::abortAndDie("Init user account failed");
902 }
903 }
904
908 protected static function initLocale()
909 {
910 global $ilSetting;
911
912 if (trim($ilSetting->get("locale") != "")) {
913 $larr = explode(",", trim($ilSetting->get("locale")));
914 $ls = array();
915 $first = $larr[0];
916 foreach ($larr as $l) {
917 if (trim($l) != "") {
918 $ls[] = $l;
919 }
920 }
921 if (count($ls) > 0) {
922 setlocale(LC_ALL, $ls);
923
924 // #15347 - making sure that floats are not changed
925 setlocale(LC_NUMERIC, "C");
926
927 if (class_exists("Collator")) {
928 $GLOBALS["ilCollator"] = new Collator($first);
929 $GLOBALS["DIC"]["ilCollator"] = function ($c) {
930 return $GLOBALS["ilCollator"];
931 };
932 }
933 }
934 }
935 }
936
942 public static function goToPublicSection()
943 {
944 global $ilAuth;
945
946 if (ANONYMOUS_USER_ID == "") {
947 self::abortAndDie("Public Section enabled, but no Anonymous user found.");
948 }
949
950 $session_destroyed = false;
951 if ($GLOBALS['DIC']['ilAuthSession']->isExpired()) {
952 $session_destroyed = true;
954 }
955 if (!$GLOBALS['DIC']['ilAuthSession']->isAuthenticated()) {
956 $session_destroyed = true;
958 }
959
960 if ($session_destroyed) {
961 $GLOBALS['DIC']['ilAuthSession']->setAuthenticated(true, ANONYMOUS_USER_ID);
962 }
963
965
966 // if target given, try to go there
967 if (strlen($_GET["target"])) {
968 // when we are already "inside" goto.php no redirect is needed
969 $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
970 if ($current_script == "goto.php") {
971 return;
972 }
973 // goto will check if target is accessible or redirect to login
974 self::redirect("goto.php?target=" . $_GET["target"]);
975 }
976
977 // check access of root folder otherwise redirect to login
978 #if(!$GLOBALS['DIC']->rbac()->system()->checkAccess('read', ROOT_FOLDER_ID))
979 #{
980 # return self::goToLogin();
981 #}
982
983 // we do not know if ref_id of request is accesible, so redirecting to root
984 $_GET["ref_id"] = ROOT_FOLDER_ID;
985 $_GET["cmd"] = "frameset";
987 "ilias.php?baseClass=ilrepositorygui&reloadpublic=1&cmd=" .
988 $_GET["cmd"] . "&ref_id=" . $_GET["ref_id"]
989 );
990 }
991
995 protected static function goToLogin()
996 {
997 ilLoggerFactory::getLogger('init')->debug('Redirecting to login page.');
998
999 $script = "login.php?target=" . $_GET["target"] . "&client_id=" . CLIENT_ID;
1000
1001 if ($GLOBALS['DIC']['ilAuthSession']->isExpired()) {
1003
1004 $script .= "&session_expired=1";
1005 }
1006 if (!$GLOBALS['DIC']['ilAuthSession']->isAuthenticated()) {
1008 }
1009
1011 $script,
1012 "init_error_authentication_fail",
1013 array(
1014 "en" => "Authentication failed.",
1015 "de" => "Authentifizierung fehlgeschlagen.")
1016 );
1017 }
1018
1022 protected static function initLanguage($a_use_user_language = true)
1023 {
1024 global $DIC;
1025
1029 global $rbacsystem;
1030
1031 require_once 'Services/Language/classes/class.ilLanguage.php';
1032
1033 if ($a_use_user_language) {
1034 if ($DIC->offsetExists('lng')) {
1035 $DIC->offsetUnset('lng');
1036 }
1038 } else {
1040 }
1041 if (is_object($rbacsystem) && $DIC->offsetExists('tree')) {
1042 $rbacsystem->initMemberView();
1043 }
1044 }
1045
1049 protected static function initAccessHandling()
1050 {
1052 "rbacreview",
1053 "ilRbacReview",
1054 "./Services/AccessControl/classes/class.ilRbacReview.php"
1055 );
1056
1057 require_once "./Services/AccessControl/classes/class.ilRbacSystem.php";
1058 $rbacsystem = ilRbacSystem::getInstance();
1059 self::initGlobal("rbacsystem", $rbacsystem);
1060
1062 "rbacadmin",
1063 "ilRbacAdmin",
1064 "./Services/AccessControl/classes/class.ilRbacAdmin.php"
1065 );
1066
1068 "ilAccess",
1069 "ilAccess",
1070 "./Services/AccessControl/classes/class.ilAccess.php"
1071 );
1072
1073 require_once "./Services/Conditions/classes/class.ilConditionHandler.php";
1074 }
1075
1079 protected static function initLog()
1080 {
1081 include_once './Services/Logging/classes/public/class.ilLoggerFactory.php';
1083
1084 self::initGlobal("ilLog", $log);
1085 // deprecated
1086 self::initGlobal("log", $log);
1087 }
1088
1096 protected static function initGlobal($a_name, $a_class, $a_source_file = null)
1097 {
1098 global $DIC;
1099
1100 if ($a_source_file) {
1101 include_once $a_source_file;
1102 $GLOBALS[$a_name] = new $a_class;
1103 } else {
1104 $GLOBALS[$a_name] = $a_class;
1105 }
1106
1107 $DIC[$a_name] = function ($c) use ($a_name) {
1108 return $GLOBALS[$a_name];
1109 };
1110 }
1111
1117 protected static function abortAndDie($a_message)
1118 {
1119 if (is_object($GLOBALS['ilLog'])) {
1120 $GLOBALS['ilLog']->write("Fatal Error: ilInitialisation - " . $a_message);
1121 $GLOBALS['ilLog']->logStack();
1122 }
1123 die($a_message);
1124 }
1125
1129 protected static function handleDevMode()
1130 {
1131 if (defined(SHOWNOTICES) && SHOWNOTICES) {
1132 // no further differentiating of php version regarding to 5.4 neccessary
1133 // when the error reporting is set to E_ALL anyway
1134
1135 // add notices to error reporting
1136 error_reporting(E_ALL);
1137 } else {
1138 error_reporting(E_ALL & ~E_NOTICE);
1139 }
1140
1141 if (defined('DEBUGTOOLS') && DEBUGTOOLS) {
1142 include_once "include/inc.debug.php";
1143 }
1144 }
1145
1146 protected static $already_initialized;
1147
1148
1149 public static function reinitILIAS()
1150 {
1151 self::$already_initialized = false;
1153 }
1154
1158 public static function initILIAS()
1159 {
1160 if (self::$already_initialized) {
1161 return;
1162 }
1163
1164 $GLOBALS["DIC"] = new Container();
1165 $GLOBALS["DIC"]["ilLoggerFactory"] = function ($c) {
1167 };
1168
1169 self::$already_initialized = true;
1170
1173 if (ilContext::initClient()) {
1177
1178 if (ilContext::hasUser()) {
1180
1183 }
1184 }
1185
1186 // init after Auth otherwise breaks CAS
1188
1189 // language may depend on user setting
1190 self::initLanguage(true);
1191 $GLOBALS['DIC']['tree']->initLangCode();
1192
1196
1197 if (ilContext::hasHTML()) {
1199 }
1201 }
1202 }
1203
1207 protected static function initSession()
1208 {
1209 $GLOBALS["DIC"]["ilAuthSession"] = function ($c) {
1210 $auth_session = ilAuthSession::getInstance(
1211 $c['ilLoggerFactory']->getLogger('auth')
1212 );
1213 $auth_session->init();
1214 return $auth_session;
1215 };
1216 }
1217
1218
1222 public static function handleErrorReporting()
1223 {
1224 // push the error level as high as possible / sane
1225 error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
1226
1227 // see handleDevMode() - error reporting might be overwritten again
1228 // but we need the client ini first
1229 }
1230
1234 protected static function initCore()
1235 {
1236 global $ilErr;
1237
1239
1240 // breaks CAS: must be included after CAS context isset in AuthUtils
1241 //self::includePhp5Compliance();
1242
1244
1245
1246 // error handler
1248 "ilErr",
1249 "ilErrorHandling",
1250 "./Services/Init/classes/class.ilErrorHandling.php"
1251 );
1252 $ilErr->setErrorHandling(PEAR_ERROR_CALLBACK, array($ilErr, 'errorHandler'));
1253
1255
1257
1258 define('IL_INITIAL_WD', getcwd());
1259
1260 // deprecated
1261 self::initGlobal("ilias", "ILIAS", "./Services/Init/classes/class.ilias.php");
1262 }
1263
1267 protected static function initClient()
1268 {
1269 global $https, $ilias, $DIC;
1270
1272
1274
1275 self::bootstrapFilesystems();
1276
1278
1280
1281
1282 // --- needs client ini
1283
1284 $ilias->client_id = CLIENT_ID;
1285
1286 if (DEVMODE) {
1288 }
1289
1290
1292
1294
1295 // init dafault language
1296 self::initLanguage(false);
1297
1298 // moved after databases
1299 self::initLog();
1300
1302 "ilAppEventHandler",
1303 "ilAppEventHandler",
1304 "./Services/EventHandling/classes/class.ilAppEventHandler.php"
1305 );
1306
1307 // there are rare cases where initILIAS is called twice for a request
1308 // example goto.php is called and includes ilias.php later
1309 // we must prevent that ilPluginAdmin is initialized twice in
1310 // this case, since this won't get the values out of plugin.php the
1311 // second time properly
1312 if (!isset($DIC["ilPluginAdmin"]) || !$DIC["ilPluginAdmin"] instanceof ilPluginAdmin) {
1314 "ilPluginAdmin",
1315 "ilPluginAdmin",
1316 "./Services/Component/classes/class.ilPluginAdmin.php"
1317 );
1318 }
1319
1322 self::initMail($GLOBALS['DIC']);
1323 self::initAvatar($GLOBALS['DIC']);
1327
1328
1329 // --- needs settings
1330
1332
1333 if (ilContext::usesHTTP()) {
1334 // $https
1335 self::initGlobal("https", "ilHTTPS", "./Services/Http/classes/class.ilHTTPS.php");
1336 $https->enableSecureCookies();
1337 $https->checkPort();
1338 }
1339
1340
1341 // --- object handling
1342
1344 "ilObjDataCache",
1345 "ilObjectDataCache",
1346 "./Services/Object/classes/class.ilObjectDataCache.php"
1347 );
1348
1349 // needed in ilObjectDefinition
1350 require_once "./Services/Xml/classes/class.ilSaxParser.php";
1351
1353 "objDefinition",
1354 "ilObjectDefinition",
1355 "./Services/Object/classes/class.ilObjectDefinition.php"
1356 );
1357
1358 // $tree
1359 require_once "./Services/Tree/classes/class.ilTree.php";
1360 $tree = new ilTree(ROOT_FOLDER_ID);
1361 self::initGlobal("tree", $tree);
1362 unset($tree);
1363
1365 "ilCtrl",
1366 "ilCtrl",
1367 "./Services/UICore/classes/class.ilCtrl.php"
1368 );
1369
1372
1373 // Init GlobalScreen
1375 }
1376
1380 protected static function initUser()
1381 {
1382 global $ilias, $ilUser;
1383
1384 // $ilUser
1386 "ilUser",
1387 "ilObjUser",
1388 "./Services/User/classes/class.ilObjUser.php"
1389 );
1390 $ilias->account = $ilUser;
1391
1393 }
1394
1398 public static function resumeUserSession()
1399 {
1400 global $DIC;
1403 }
1404
1405 if (
1406 !$GLOBALS['DIC']['ilAuthSession']->isAuthenticated() or
1407 $GLOBALS['DIC']['ilAuthSession']->isExpired()
1408 ) {
1409 if ($GLOBALS['DIC']['ilAuthSession']->isExpired()) {
1411 }
1412
1413 ilLoggerFactory::getLogger('init')->debug('Current session is invalid: ' . $GLOBALS['DIC']['ilAuthSession']->getId());
1414 $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
1415 if (self::blockedAuthentication($current_script)) {
1416 ilLoggerFactory::getLogger('init')->debug('Authentication is started in current script.');
1417 // nothing todo: authentication is done in current script
1418 return;
1419 }
1420
1421 return self::handleAuthenticationFail();
1422 }
1423 // valid session
1424
1425 return self::initUserAccount();
1426 }
1427
1431 protected static function handleAuthenticationSuccess()
1432 {
1436 global $ilUser;
1437
1438 require_once 'Services/Tracking/classes/class.ilOnlineTracking.php';
1439 ilOnlineTracking::updateAccess($ilUser);
1440 }
1441
1445 protected static function handleAuthenticationFail()
1446 {
1451 global $ilAuth, $ilSetting;
1452
1453 ilLoggerFactory::getLogger('init')->debug('Handling of failed authentication.');
1454
1455 // #10608
1456 if (
1459 throw new Exception("Authentication failed.");
1460 }
1461 if (
1462 $GLOBALS['DIC']['ilAuthSession']->isExpired() &&
1463 !\ilObjUser::_isAnonymous($GLOBALS['DIC']['ilAuthSession']->getUserId())
1464 ) {
1465 ilLoggerFactory::getLogger('init')->debug('Expired session found -> redirect to login page');
1466 return self::goToLogin();
1467 }
1468 if (ilPublicSectionSettings::getInstance()->isEnabledForDomain($_SERVER['SERVER_NAME'])) {
1469 ilLoggerFactory::getLogger('init')->debug('Redirect to public section.');
1470 return self::goToPublicSection();
1471 }
1472 ilLoggerFactory::getLogger('init')->debug('Redirect to login page.');
1473 return self::goToLogin();
1474 }
1475
1476
1480 protected static function initHTTPServices(\ILIAS\DI\Container $container)
1481 {
1482 $container['http.request_factory'] = function ($c) {
1483 return new \ILIAS\HTTP\Request\RequestFactoryImpl();
1484 };
1485
1486 $container['http.response_factory'] = function ($c) {
1487 return new \ILIAS\HTTP\Response\ResponseFactoryImpl();
1488 };
1489
1490 $container['http.cookie_jar_factory'] = function ($c) {
1491 return new \ILIAS\HTTP\Cookies\CookieJarFactoryImpl();
1492 };
1493
1494 $container['http.response_sender_strategy'] = function ($c) {
1495 return new \ILIAS\HTTP\Response\Sender\DefaultResponseSenderStrategy();
1496 };
1497
1498 $container['http'] = function ($c) {
1499 return new \ILIAS\DI\HTTPServices(
1500 $c['http.response_sender_strategy'],
1501 $c['http.cookie_jar_factory'],
1502 $c['http.request_factory'],
1503 $c['http.response_factory']
1504 );
1505 };
1506 }
1507
1508
1512 private static function initGlobalScreen(\ILIAS\DI\Container $c)
1513 {
1514 $c['global_screen'] = function () use ($c) {
1515 return new Services(new ilGSProviderFactory($c), htmlentities(str_replace([" ", ".", "-"], "_", ILIAS_VERSION_NUMERIC)));
1516 };
1517 $c->globalScreen()->tool()->context()->stack()->clear();
1518 $c->globalScreen()->tool()->context()->claim()->main();
1519// $c->globalScreen()->tool()->context()->current()->addAdditionalData('DEVMODE', (bool) DEVMODE);
1520 }
1521
1525 public static function initUIFramework(\ILIAS\DI\Container $c)
1526 {
1527 $c["ui.factory"] = function ($c) {
1528 $c["lng"]->loadLanguageModule("ui");
1530 $c["ui.factory.counter"],
1531 $c["ui.factory.button"],
1532 $c["ui.factory.listing"],
1533 $c["ui.factory.image"],
1534 $c["ui.factory.panel"],
1535 $c["ui.factory.modal"],
1536 $c["ui.factory.dropzone"],
1537 $c["ui.factory.popover"],
1538 $c["ui.factory.divider"],
1539 $c["ui.factory.link"],
1540 $c["ui.factory.dropdown"],
1541 $c["ui.factory.item"],
1542 $c["ui.factory.viewcontrol"],
1543 $c["ui.factory.chart"],
1544 $c["ui.factory.input"],
1545 $c["ui.factory.table"],
1546 $c["ui.factory.messagebox"],
1547 $c["ui.factory.card"],
1548 $c["ui.factory.layout"],
1549 $c["ui.factory.maincontrols"],
1550 $c["ui.factory.tree"],
1551 $c["ui.factory.menu"],
1552 $c["ui.factory.symbol"],
1553 $c["ui.factory.legacy"]
1554 );
1555 };
1556 $c["ui.signal_generator"] = function ($c) {
1558 };
1559 $c["ui.factory.counter"] = function ($c) {
1561 };
1562 $c["ui.factory.button"] = function ($c) {
1564 };
1565 $c["ui.factory.listing"] = function ($c) {
1567 };
1568 $c["ui.factory.image"] = function ($c) {
1570 };
1571 $c["ui.factory.panel"] = function ($c) {
1572 return new ILIAS\UI\Implementation\Component\Panel\Factory($c["ui.factory.panel.listing"]);
1573 };
1574 $c["ui.factory.modal"] = function ($c) {
1575 return new ILIAS\UI\Implementation\Component\Modal\Factory($c["ui.signal_generator"]);
1576 };
1577 $c["ui.factory.dropzone"] = function ($c) {
1578 return new ILIAS\UI\Implementation\Component\Dropzone\Factory($c["ui.factory.dropzone.file"]);
1579 };
1580 $c["ui.factory.popover"] = function ($c) {
1581 return new ILIAS\UI\Implementation\Component\Popover\Factory($c["ui.signal_generator"]);
1582 };
1583 $c["ui.factory.divider"] = function ($c) {
1585 };
1586 $c["ui.factory.link"] = function ($c) {
1588 };
1589 $c["ui.factory.dropdown"] = function ($c) {
1591 };
1592 $c["ui.factory.item"] = function ($c) {
1594 };
1595 $c["ui.factory.viewcontrol"] = function ($c) {
1597 $c["ui.signal_generator"],
1598 $c["ui.factory.input"]
1599 );
1600 };
1601 $c["ui.factory.chart"] = function ($c) {
1602 return new ILIAS\UI\Implementation\Component\Chart\Factory($c["ui.factory.progressmeter"]);
1603 };
1604 $c["ui.factory.input"] = function ($c) {
1606 $c["ui.signal_generator"],
1607 $c["ui.factory.input.field"],
1608 $c["ui.factory.input.container"],
1609 $c["ui.factory.input.viewcontrol"]
1610 );
1611 };
1612 $c["ui.factory.table"] = function ($c) {
1613 return new ILIAS\UI\Implementation\Component\Table\Factory($c["ui.signal_generator"]);
1614 };
1615 $c["ui.factory.messagebox"] = function ($c) {
1617 };
1618 $c["ui.factory.card"] = function ($c) {
1620 };
1621 $c["ui.factory.layout"] = function ($c) {
1623 };
1624 $c["ui.factory.maincontrols.slate"] = function ($c) {
1626 $c['ui.signal_generator'],
1627 $c['ui.factory.counter'],
1628 $c["ui.factory.symbol"]
1629 );
1630 };
1631 $c["ui.factory.maincontrols"] = function ($c) {
1633 $c['ui.signal_generator'],
1634 $c['ui.factory.maincontrols.slate']
1635 );
1636 };
1637 $c["ui.factory.menu"] = function ($c) {
1639 };
1640 $c["ui.factory.symbol.glyph"] = function ($c) {
1642 };
1643 $c["ui.factory.symbol.icon"] = function ($c) {
1645 };
1646 $c["ui.factory.symbol.avatar"] = function ($c) {
1648 };
1649 $c["ui.factory.symbol"] = function ($c) {
1651 $c["ui.factory.symbol.icon"],
1652 $c["ui.factory.symbol.glyph"],
1653 $c["ui.factory.symbol.avatar"]
1654 );
1655 };
1656 $c["ui.factory.progressmeter"] = function ($c) {
1658 };
1659 $c["ui.factory.dropzone.file"] = function ($c) {
1661 };
1662 $c["ui.factory.input.field"] = function ($c) {
1663 $data_factory = new ILIAS\Data\Factory();
1664 $refinery = new ILIAS\Refinery\Factory($data_factory, $c["lng"]);
1665
1667 $c["ui.signal_generator"],
1668 $data_factory,
1669 $refinery,
1670 $c["lng"]
1671 );
1672 };
1673 $c["ui.factory.input.container"] = function ($c) {
1675 $c["ui.factory.input.container.form"],
1676 $c["ui.factory.input.container.filter"],
1677 $c["ui.factory.input.container.viewcontrol"]
1678 );
1679 };
1680 $c["ui.factory.input.container.form"] = function ($c) {
1682 $c["ui.factory.input.field"]
1683 );
1684 };
1685 $c["ui.factory.input.container.filter"] = function ($c) {
1687 $c["ui.signal_generator"],
1688 $c["ui.factory.input.field"]
1689 );
1690 };
1691 $c["ui.factory.input.container.viewcontrol"] = function ($c) {
1693 };
1694 $c["ui.factory.input.viewcontrol"] = function ($c) {
1696 };
1697 $c["ui.factory.panel.listing"] = function ($c) {
1699 };
1700 $c["ui.renderer"] = function ($c) {
1702 $c["ui.component_renderer_loader"]
1703 );
1704 };
1705 $c["ui.component_renderer_loader"] = function ($c) {
1707 new ILIAS\UI\Implementation\Render\LoaderResourceRegistryWrapper(
1708 $c["ui.resource_registry"],
1709 new ILIAS\UI\Implementation\Render\FSLoader(
1710 new ILIAS\UI\Implementation\Render\DefaultRendererFactory(
1711 $c["ui.factory"],
1712 $c["ui.template_factory"],
1713 $c["lng"],
1714 $c["ui.javascript_binding"],
1715 $c["refinery"],
1716 $c["ui.pathresolver"]
1717 ),
1718 new ILIAS\UI\Implementation\Component\Symbol\Glyph\GlyphRendererFactory(
1719 $c["ui.factory"],
1720 $c["ui.template_factory"],
1721 $c["lng"],
1722 $c["ui.javascript_binding"],
1723 $c["refinery"],
1724 $c["ui.pathresolver"]
1725 ),
1726 new ILIAS\UI\Implementation\Component\Input\Field\FieldRendererFactory(
1727 $c["ui.factory"],
1728 $c["ui.template_factory"],
1729 $c["lng"],
1730 $c["ui.javascript_binding"],
1731 $c["refinery"],
1732 $c["ui.pathresolver"]
1733 )
1734 )
1735 )
1736 );
1737 };
1738 $c["ui.template_factory"] = function ($c) {
1740 };
1741 $c["ui.resource_registry"] = function ($c) {
1743 };
1744 $c["ui.javascript_binding"] = function ($c) {
1746 };
1747
1748 $c["ui.factory.tree"] = function ($c) {
1749 return new ILIAS\UI\Implementation\Component\Tree\Factory($c["ui.signal_generator"]);
1750 };
1751
1752 $c["ui.factory.legacy"] = function ($c) {
1753 return new ILIAS\UI\Implementation\Component\Legacy\Factory($c["ui.signal_generator"]);
1754 };
1755
1757 foreach ($plugins as $plugin_data) {
1758 $plugin = ilPluginAdmin::getPluginObject($plugin_data["component_type"], $plugin_data["component_name"], $plugin_data["slot_id"], $plugin_data["name"]);
1759
1760 $c['ui.renderer'] = $plugin->exchangeUIRendererAfterInitialization($c);
1761
1762 foreach ($c->keys() as $key) {
1763 if (strpos($key, "ui.factory") === 0) {
1764 $c[$key] = $plugin->exchangeUIFactoryAfterInitialization($key, $c);
1765 }
1766 }
1767 }
1768
1769 $c["ui.pathresolver"] = function ($c) : ILIAS\UI\Implementation\Render\ImagePathResolver {
1770 return new ilImagePathResolver();
1771 };
1772 }
1773
1777 protected static function initRefinery(\ILIAS\DI\Container $container)
1778 {
1779 $container['refinery'] = function ($container) {
1780 $dataFactory = new \ILIAS\Data\Factory();
1781 $language = $container['lng'];
1782
1783 return new \ILIAS\Refinery\Factory($dataFactory, $language);
1784 };
1785 }
1786
1790 protected static function initHTML()
1791 {
1792 global $ilUser, $DIC;
1793
1794 if (ilContext::hasUser()) {
1795 // load style definitions
1796 // use the init function with plugin hook here, too
1798 }
1799
1801 $tpl = new ilGlobalPageTemplate($DIC->globalScreen(), $DIC->ui(), $DIC->http());
1802 self::initGlobal("tpl", $tpl);
1803
1804 if (ilContext::hasUser()) {
1805 $dispatcher = new \ILIAS\Init\StartupSequence\StartUpSequenceDispatcher($DIC);
1806 $dispatcher->dispatch();
1807 }
1808
1809 require_once "./Services/UICore/classes/class.ilFrameTargetInfo.php";
1810
1812 "ilNavigationHistory",
1813 "ilNavigationHistory",
1814 "Services/Navigation/classes/class.ilNavigationHistory.php"
1815 );
1816
1818 "ilBrowser",
1819 "ilBrowser",
1820 "./Services/Utilities/classes/class.ilBrowser.php"
1821 );
1822
1824 "ilHelp",
1825 "ilHelpGUI",
1826 "Services/Help/classes/class.ilHelpGUI.php"
1827 );
1828
1830 "ilToolbar",
1831 "ilToolbarGUI",
1832 "./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php"
1833 );
1834
1836 "ilLocator",
1837 "ilLocatorGUI",
1838 "./Services/Locator/classes/class.ilLocatorGUI.php"
1839 );
1840
1842 "ilTabs",
1843 "ilTabsGUI",
1844 "./Services/UIComponent/Tabs/classes/class.ilTabsGUI.php"
1845 );
1846
1847 if (ilContext::hasUser()) {
1848 include_once './Services/MainMenu/classes/class.ilMainMenuGUI.php';
1849 $ilMainMenu = new ilMainMenuGUI("_top");
1850
1851 self::initGlobal("ilMainMenu", $ilMainMenu);
1852 unset($ilMainMenu);
1853
1854 // :TODO: tableGUI related
1855
1856 // set hits per page for all lists using table module
1857 $_GET['limit'] = (int) $ilUser->getPref('hits_per_page');
1858 ilSession::set('tbl_limit', $_GET['limit']);
1859
1860 // the next line makes it impossible to save the offset somehow in a session for
1861 // a specific table (I tried it for the user administration).
1862 // its not posssible to distinguish whether it has been set to page 1 (=offset = 0)
1863 // or not set at all (then we want the last offset, e.g. being used from a session var).
1864 // So I added the wrapping if statement. Seems to work (hopefully).
1865 // Alex April 14th 2006
1866 if (isset($_GET['offset']) && $_GET['offset'] != "") { // added April 14th 2006
1867 $_GET['offset'] = (int) $_GET['offset']; // old code
1868 }
1869
1870 self::initGlobal("lti", "ilLTIViewGUI", "./Services/LTI/classes/class.ilLTIViewGUI.php");
1871 $GLOBALS["DIC"]["lti"]->init();
1873 } else {
1874 // several code parts rely on ilObjUser being always included
1875 include_once "Services/User/classes/class.ilObjUser.php";
1876 }
1877 }
1878
1879 protected static function getCurrentCmd() : string
1880 {
1881 $cmd = $_POST['cmd'] ?? ($_GET['cmd'] ?? '');
1882
1883 if (is_array($cmd)) {
1884 $cmd_keys = array_keys($cmd);
1885 $cmd = array_shift($cmd_keys) ?? '';
1886 }
1887
1888 return $cmd;
1889 }
1890
1896 protected static function blockedAuthentication($a_current_script)
1897 {
1899 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for WAC request.');
1900 return true;
1901 }
1903 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for sso request.');
1904 return true;
1905 }
1907 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for webdav request');
1908 return true;
1909 }
1911 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for shibboleth request.');
1912 return true;
1913 }
1915 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for lti provider requests.');
1916 return true;
1917 }
1919 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for SAML request.');
1920 return true;
1921 }
1922 if (
1923 $a_current_script == "register.php" ||
1924 $a_current_script == "pwassist.php" ||
1925 $a_current_script == "confirmReg.php" ||
1926 $a_current_script == "il_securimage_play.php" ||
1927 $a_current_script == "il_securimage_show.php" ||
1928 $a_current_script == 'login.php'
1929 ) {
1930 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for script: ' . $a_current_script);
1931 return true;
1932 }
1933
1934 $requestBaseClass = strtolower((string) ($_GET['baseClass'] ?? ''));
1935 if ($requestBaseClass == strtolower(ilStartUpGUI::class)) {
1936 $requestCmdClass = strtolower((string) ($_GET['cmdClass'] ?? ''));
1937 if (
1938 $requestCmdClass == strtolower(ilAccountRegistrationGUI::class) ||
1939 $requestCmdClass == strtolower(ilPasswordAssistanceGUI::class)
1940 ) {
1941 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for cmdClass: ' . $requestCmdClass);
1942 return true;
1943 }
1944 $cmd = self::getCurrentCmd();
1945 if (
1946 $cmd == "showTermsOfService" ||
1947 $cmd == 'showAccountMigration' || $cmd == 'migrateAccount' ||
1948 $cmd == 'processCode' || $cmd == 'showLoginPage' || $cmd == 'showLogout' ||
1949 $cmd == 'doStandardAuthentication' || $cmd == 'doCasAuthentication'
1950 ) {
1951 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for cmd: ' . $cmd);
1952 return true;
1953 }
1954 }
1955
1956 // #12884
1957 if (($a_current_script == "goto.php" && $_GET["target"] == "impr_0") ||
1958 strtolower((string) $_GET["baseClass"]) == strtolower(ilImprintGUI::class)) {
1959 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for baseClass: ' . $_GET['baseClass']);
1960 return true;
1961 }
1962
1963 if ($a_current_script == 'goto.php' && in_array($_GET['target'], array(
1964 'usr_registration', 'usr_nameassist', 'usr_pwassist', 'usr_agreement'
1965 ))) {
1966 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for goto target: ' . $_GET['target']);
1967 return true;
1968 }
1969 ilLoggerFactory::getLogger('auth')->debug('Authentication required');
1970 return false;
1971 }
1972
1980 protected static function translateMessage($a_message_id, array $a_message_static = null)
1981 {
1982 global $ilDB, $lng, $ilSetting, $ilClientIniFile, $ilUser;
1983
1984 // current language
1985 if (!$lng) {
1986 $lang = "en";
1987 if ($ilUser) {
1988 $lang = $ilUser->getLanguage();
1989 } elseif ($_REQUEST["lang"]) {
1990 $lang = (string) $_REQUEST["lang"];
1991 } elseif ($ilSetting) {
1992 $lang = $ilSetting->get("language");
1993 } elseif ($ilClientIniFile) {
1994 $lang = $ilClientIniFile->readVariable("language", "default");
1995 }
1996 } else {
1997 $lang = $lng->getLangKey();
1998 }
1999
2000 $message = "";
2001 if ($ilDB && $a_message_id) {
2002 if (!$lng) {
2003 require_once "./Services/Language/classes/class.ilLanguage.php";
2004 $lng = new ilLanguage($lang);
2005 }
2006
2007 $lng->loadLanguageModule("init");
2008 $message = $lng->txt($a_message_id);
2009 } elseif (is_array($a_message_static)) {
2010 if (!isset($a_message_static[$lang])) {
2011 $lang = "en";
2012 }
2013 $message = $a_message_static[$lang];
2014 }
2015 return $message;
2016 }
2017
2025 protected static function redirect($a_target, $a_message_id = '', array $a_message_static = null)
2026 {
2027 // #12739
2028 if (defined("ILIAS_HTTP_PATH") &&
2029 !stristr($a_target, ILIAS_HTTP_PATH)) {
2030 $a_target = ILIAS_HTTP_PATH . "/" . $a_target;
2031 }
2032
2033 foreach (['ext_uid', 'soap_pw'] as $param) {
2034 if (false === strpos($a_target, $param . '=') && isset($GLOBALS['DIC']->http()->request()->getQueryParams()[$param])) {
2035 $a_target = \ilUtil::appendUrlParameterString($a_target, $param . '=' . \ilUtil::stripSlashes(
2036 $GLOBALS['DIC']->http()->request()->getQueryParams()[$param]
2037 ));
2038 }
2039 }
2040
2042 ilUtil::redirect($a_target);
2043 } else {
2044 $message = self::translateMessage($a_message_id, $a_message_static);
2045
2046 // user-directed linked message
2048 $link = self::translateMessage(
2049 "init_error_redirect_click",
2050 array("en" => 'Please click to continue.',
2051 "de" => 'Bitte klicken um fortzufahren.')
2052 );
2053 $mess = $message .
2054 '<br /><a href="' . $a_target . '">' . $link . '</a>';
2055 }
2056 // plain text
2057 else {
2058 // not much we can do here
2059 $mess = $message;
2060
2061 if (!trim($mess)) {
2062 $mess = self::translateMessage(
2063 "init_error_redirect_info",
2064 array("en" => 'Redirect not supported by context.',
2065 "de" => 'Weiterleitungen werden durch Kontext nicht unterstützt.')
2066 ) .
2067 ' (' . $a_target . ')';
2068 }
2069 }
2070
2071 self::abortAndDie($mess);
2072 }
2073 }
2074
2078 public static function redirectToStartingPage()
2079 {
2083 global $ilUser;
2084
2085 // fallback, should never happen
2086 if ($ilUser->getId() == ANONYMOUS_USER_ID) {
2088 return true;
2089 }
2090
2091 // for password change and incomplete profile
2092 // see ilDashboardGUI
2093 if (!$_GET["target"]) {
2094 ilLoggerFactory::getLogger('init')->debug('Redirect to default starting page');
2095 // Redirect here to switch back to http if desired
2096 include_once './Services/User/classes/class.ilUserUtil.php';
2097 ilUtil::redirect(ilUserUtil::getStartingPointAsUrl());
2098 } else {
2099 ilLoggerFactory::getLogger('init')->debug('Redirect to target: ' . $_GET['target']);
2100 ilUtil::redirect("goto.php?target=" . $_GET["target"]);
2101 }
2102 }
2103
2104
2105 private static function initBackgroundTasks(\ILIAS\DI\Container $c)
2106 {
2107 global $ilIliasIniFile;
2108
2109 $n_of_tasks = $ilIliasIniFile->readVariable("background_tasks", "number_of_concurrent_tasks");
2110 $sync = $ilIliasIniFile->readVariable("background_tasks", "concurrency");
2111
2112 $n_of_tasks = $n_of_tasks ? $n_of_tasks : 5;
2113 $sync = $sync ? $sync : 'sync'; // The default value is sync.
2114
2115 $c["bt.task_factory"] = function ($c) {
2116 return new \ILIAS\BackgroundTasks\Implementation\Tasks\BasicTaskFactory($c["di.injector"]);
2117 };
2118
2119 $c["bt.persistence"] = function ($c) {
2120 return \ILIAS\BackgroundTasks\Implementation\Persistence\BasicPersistence::instance($c->database());
2121 };
2122
2123 $c["bt.injector"] = function ($c) {
2124 return new \ILIAS\BackgroundTasks\Dependencies\Injector($c, new BaseDependencyMap());
2125 };
2126
2127 $c["bt.task_manager"] = function ($c) use ($sync) {
2128 if ($sync == 'sync') {
2129 return new \ILIAS\BackgroundTasks\Implementation\TaskManager\SyncTaskManager($c["bt.persistence"]);
2130 } elseif ($sync == 'async') {
2131 return new \ILIAS\BackgroundTasks\Implementation\TaskManager\AsyncTaskManager($c["bt.persistence"]);
2132 } else {
2133 throw new ilException("The supported Background Task Managers are sync and async. $sync given.");
2134 }
2135 };
2136 }
2137
2138
2139 private static function initInjector(\ILIAS\DI\Container $c)
2140 {
2141 $c["di.dependency_map"] = function ($c) {
2142 return new \ILIAS\BackgroundTasks\Dependencies\DependencyMap\BaseDependencyMap();
2143 };
2144
2145 $c["di.injector"] = function ($c) {
2146 return new \ILIAS\BackgroundTasks\Dependencies\Injector($c, $c["di.dependency_map"]);
2147 };
2148 }
2149
2150 private static function initKioskMode(\ILIAS\DI\Container $c)
2151 {
2152 $c["service.kiosk_mode"] = function ($c) {
2153 return new ilKioskModeService(
2154 $c['ilCtrl'],
2155 $c['lng'],
2156 $c['ilAccess'],
2157 $c['objDefinition']
2158 );
2159 };
2160 }
2161}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
const PEAR_ERROR_CALLBACK
Definition: PEAR.php:35
$_GET["client_id"]
$_POST["username"]
static orderBy($orderBy, $orderDirection='ASC')
An exception for terminatinating execution or to throw for unit testing.
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:19
Builds a Color from either hex- or rgb values.
Definition: Factory.php:14
Builds data types.
Definition: Factory.php:20
Class BlacklistExtensionPreProcessor PreProcessor which denies all blacklisted file extensions.
Implementation of factory for cards.
Definition: Factory.php:13
Implementation of factory for tables.
Definition: Factory.php:14
Renderer that dispatches rendering of UI components to a Renderer found in the same namespace as the ...
Caches renderers loaded by another loader.
Wraps global ilTemplate to provide JavaScriptBinding.
const IL_COMP_SERVICE
if(!isset($GLOBALS['ilGlobalStartTime'])||! $GLOBALS['ilGlobalStartTime']) global $DIC
Interface ilAccessibilitySequentialDocumentEvaluation.
static getInstance(\ilLogger $logger)
Get instance.
static isAuthenticationForced()
Check if authentication is should be forced.
static handleForcedAuthentication()
static usesTemplate()
Uses template engine.
const CONTEXT_WEBDAV
static modifyHttpPath(string $httpPath)
const CONTEXT_SHIBBOLETH
const CONTEXT_APACHE_SSO
static supportsRedirects()
Are redirects supported?
static hasUser()
Based on user authentication?
const CONTEXT_SAML
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.
const CONTEXT_SOAP
const CONTEXT_WAC
static getCountryCodes()
Get country codes (DIN EN 3166-1)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getExplicitlyBlockedFiles()
Class ilGSProviderFactory.
Class ilGlobalCacheSettings.
static setup(ilGlobalCacheSettings $ilGlobalCacheSettings)
Class ilGlobalPageTemplate.
HTTPS.
static getInstance()
Get https instance.
INIFile Parser.
ILIAS Initialisation Utility Class perform basic setup: init database handler, load configuration fil...
static blockedAuthentication($a_current_script)
Block authentication based on current request.
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 determineClient()
This method determines the current client and sets the constant CLIENT_ID.
static translateMessage($a_message_id, array $a_message_static=null)
Translate message if possible.
static redirect($a_target, $a_message_id='', array $a_message_static=null)
Redirects to target url if context supports it.
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
static handleDevMode()
Prepare developer tools.
static initUser()
Init user / authentification (level 2)
static initKioskMode(\ILIAS\DI\Container $c)
static initGlobal($a_name, $a_class, $a_source_file=null)
Initialize global instance.
static initBackgroundTasks(\ILIAS\DI\Container $c)
static abortAndDie($a_message)
Exit.
static initInjector(\ILIAS\DI\Container $c)
static setSessionCookieParams()
set session cookie params
static initSettings()
initialise $ilSettings object and define constants
static initGlobalScreen(\ILIAS\DI\Container $c)
static initMail(\ILIAS\DI\Container $c)
static initTermsOfService(\ILIAS\DI\Container $c)
static initRefinery(\ILIAS\DI\Container $container)
static initAccessibilityControlConcept(\ILIAS\DI\Container $c)
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 initIliasIniFile()
This method provides a global instance of class ilIniFile for the ilias.ini.php file in variable $ilI...
static initStyle()
provide $styleDefinition object
Central entry point for users of the service.
language handling
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($a_component_id)
Get component logger.
Class ilMailTemplateRepository.
Handles display of the main menu.
Class ilObjTermsOfService.
static _isAnonymous($usr_id)
Class ilObjectCustomIconFactory.
Administration class for plugins.
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
static getActivePlugins()
Get info for all active plugins.
Database Session Handling.
static _exists($a_session_id)
Check whether session exists.
static set($a_var, $a_val)
Set a value.
static setClosingContext($a_context)
set closing context (for statistics)
const SESSION_CLOSE_LOGIN
static _destroy($a_session_id, $a_closing_context=null, $a_expired_at=null)
Destroy session.
const SESSION_CLOSE_PUBLIC
const SESSION_CLOSE_EXPIRE
Class ilTermsOfServiceHelper.
Interface ilTermsOfServiceSequentialDocumentEvaluation.
static initDefaultTimeZone(ilIniFile $ini)
Initialize default timezone from system settings.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
static setCookie($a_cookie_name, $a_cookie_value='', $a_also_set_super_global=true, $a_set_cookie_invalid=false)
static redirect($a_script)
static getClientIdByString(string $clientId)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static removeTrailingPathSeparators($path)
$c
Definition: cli.php:37
const CLIENT_ID
Definition: constants.php:39
const ILIAS_DATA_DIR
Definition: constants.php:42
const ILIAS_WEB_DIR
Definition: constants.php:43
const ANONYMOUS_USER_ID
Definition: constants.php:25
const ROOT_FOLDER_ID
Definition: constants.php:30
$ilIliasIniFile
Definition: imgupload.php:16
$https
Definition: imgupload.php:19
$ilUser
Definition: imgupload.php:18
const ILIAS_VERSION_NUMERIC
Interface Location.
Definition: Location.php:17
Interface FilesystemFactory The filesystem factory produces different filesystem types.
This is what a factory for input fields looks like.
Definition: Factory.php:11
This is what a factory for layouts looks like.
Definition: Factory.php:9
This is how the factory for UI elements looks.
Definition: Factory.php:18
Interface ilTermsOfServiceDocumentEvaluation.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
$cookie_path
Definition: metadata.php:22
const IL_COOKIE_PATH(isset($_GET["client_id"]))
Definition: metadata.php:47
Class HTTPServicesTest.
static http()
Fetches the global http state from ILIAS.
Class ChatMainBarProvider \MainMenu\Provider.
Class ilAsqQuestionAuthoringFactory.
Class Factory.
global $ilSetting
Definition: privfeed.php:17
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
$ilErr
Definition: raiseError.php:18
$log
Definition: result.php:15
$dic
Definition: result.php:13
$lng
global $ilDB
$container
Definition: wac.php:13
const ILIAS_MODULE
Definition: server.php:14
$lang
Definition: xapiexit.php:8
$message
Definition: xapiexit.php:14
$_COOKIE[session_name()]
Definition: xapitoken.php:37
$param
Definition: xapitoken.php:29