ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ilInitialisation Class Reference

ILIAS Initialisation Utility Class perform basic setup: init database handler, load configuration file, init user authentification & error handler, load object type definitions. More...

+ Inheritance diagram for ilInitialisation:
+ Collaboration diagram for ilInitialisation:

Static Public Member Functions

static initFileUploadService (\ILIAS\DI\Container $dic)
 Initializes the file upload service. More...
 
static setSessionHandler ()
 set session handler to db Used in Soap More...
 
static initUserAccount ()
 Init user with current account id. More...
 
static goToPublicSection ()
 go to public section More...
 
static reinitILIAS ()
 
static reInitUser ()
 
static initILIAS ()
 ilias initialisation More...
 
static handleErrorReporting ()
 Set error reporting level. More...
 
static resumeUserSession ()
 Resume an existing user session. More...
 
static applyPluginManipulationsToUiFramework (\ILIAS\DI\Container $c)
 
static redirectToStartingPage (string $target='')
 

Static Protected Member Functions

static removeUnsafeCharacters ()
 Remove unsafe characters from GET. More...
 
static recursivelyRemoveUnsafeCharacters ($var)
 
static requireCommonIncludes ()
 get common include code files More...
 
static initIliasIniFile ()
 This method provides a global instance of class ilIniFile for the ilias.ini.php file in variable $ilIliasIniFile. More...
 
static initResourceStorage ()
 
static initUploadPolicies (\ILIAS\DI\Container $dic)
 
static buildHTTPPath ()
 
static determineClient ()
 This method determines the current client and sets the constant CLIENT_ID. More...
 
static initClientIniFile ()
 This method provides a global instance of class ilIniFile for the client.ini.php file in variable $ilClientIniFile. More...
 
static handleMaintenanceMode ()
 handle maintenance mode More...
 
static initDatabase ()
 initialise database object $ilDB More...
 
static initGlobalCache ()
 
static setCookieConstants ()
 
static setSessionCookieParams ()
 set session cookie params More...
 
static initCron (\ILIAS\DI\Container $c)
 
static initCustomObjectIcons (\ILIAS\DI\Container $c)
 
static initAvatar (\ILIAS\DI\Container $c)
 
static initLegalDocuments (Container $c)
 
static initMail (Container $c)
 
static initAccessibilityControlConcept (\ILIAS\DI\Container $c)
 
static initSettings ()
 initialise $ilSettings object and define constants Used in Soap More...
 
static initStyle ()
 provide $styleDefinition object More...
 
static initLocale ()
 Init Locale. More...
 
static goToLogin ()
 go to login More...
 
static initAccessHandling ()
 $ilAccess and $rbac... initialisation More...
 
static initLog ()
 Init log instance. More...
 
static initGlobal (string $a_name, $a_class, ?string $a_source_file=null, ?bool $destroy_existing=false)
 
static abortAndDie (string $a_message)
 
static handleDevMode ()
 Prepare developer tools. More...
 
static initSession ()
 Init auth session. More...
 
static initCore ()
 Init core objects (level 0) More...
 
static initClient ()
 Init client-based objects (level 1) More...
 
static initUser ()
 Init user / authentification (level 2) More...
 
static handleAuthenticationFail ()
 
static initHTTPServices (\ILIAS\DI\Container $container)
 
static initComponentService (\ILIAS\DI\Container $container)
 
static initHTML ()
 init HTML output (level 3) More...
 
static blockedAuthentication (string $a_current_script)
 Block authentication based on current request. More...
 
static translateMessage (string $a_message_id, ?array $a_message_static=null)
 Translate message if possible. More...
 
static redirect (string $a_target, string $a_message_id='', ?array $a_message_static=null)
 Redirects to target url if context supports it. More...
 

Static Protected Attributes

static bool $already_initialized = false
 

Static Private Member Functions

static getClientIdTransformation ()
 Refinery is not initialized early enough to provide a transformation to be used with the \ILIAS\HTTP implementation to retrieve the parameters. More...
 
static setClientIdCookie ()
 
static initGlobalScreen (\ILIAS\DI\Container $c)
 
static initBackgroundTasks (\ILIAS\DI\Container $c)
 
static initInjector (\ILIAS\DI\Container $c)
 
static initKioskMode (\ILIAS\DI\Container $c)
 
static initLearningObjectMetadata (\ILIAS\DI\Container $c)
 

Detailed Description

ILIAS Initialisation Utility Class perform basic setup: init database handler, load configuration file, init user authentification & error handler, load object type definitions.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Sascha Hofmann shofm.nosp@m.ann@.nosp@m.datab.nosp@m.ay.d.nosp@m.e
Version
$Id$

Definition at line 54 of file class.ilInitialisation.php.

Member Function Documentation

◆ abortAndDie()

static ilInitialisation::abortAndDie ( string  $a_message)
staticprotected

Definition at line 1111 of file class.ilInitialisation.php.

1111 : void
1112 {
1113 if (isset($GLOBALS['ilLog'])) {
1114 $GLOBALS['ilLog']->write("Fatal Error: ilInitialisation - " . $a_message);
1115 $GLOBALS['ilLog']->logStack();
1116 }
1117 die($a_message);
1118 }
$GLOBALS["DIC"]
Definition: wac.php:54

References $GLOBALS.

Referenced by determineClient(), goToPublicSection(), handleMaintenanceMode(), initClientIniFile(), initSettings(), initUserAccount(), and setSessionHandler().

+ Here is the caller graph for this function:

◆ applyPluginManipulationsToUiFramework()

static ilInitialisation::applyPluginManipulationsToUiFramework ( \ILIAS\DI\Container  $c)
static
Deprecated:
this mechanism will be removed as part of the component revision and the refactoring to the new bootstrap mechanism.

Definition at line 1512 of file class.ilInitialisation.php.

1512 : void
1513 {
1514 $component_repository = $c["component.repository"];
1515 $component_factory = $c["component.factory"];
1516 foreach ($component_repository->getPlugins() as $pl) {
1517 if (!$pl->isActive()) {
1518 continue;
1519 }
1520 $plugin = $component_factory->getPlugin($pl->getId());
1521 $closure = $plugin->exchangeUIRendererAfterInitialization($c);
1522 $c->offsetUnset('ui.renderer');
1523 $c['ui.renderer'] = $closure;
1524
1525 foreach ($c->keys() as $key) {
1526 if (strpos($key, "ui.factory") === 0) {
1527 $c[$key] = $plugin->exchangeUIFactoryAfterInitialization($key, $c);
1528 }
1529 }
1530 }
1531 }
$c
Definition: deliver.php:25

References $c, and XapiProxy\$plugin.

◆ blockedAuthentication()

static ilInitialisation::blockedAuthentication ( string  $a_current_script)
staticprotected

Block authentication based on current request.

Definition at line 1643 of file class.ilInitialisation.php.

1643 : bool
1644 {
1645 global $DIC;
1646
1648 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for WAC request.');
1649 return true;
1650 }
1652 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for sso request.');
1653 return true;
1654 }
1656 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for webdav request');
1657 return true;
1658 }
1660 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for shibboleth request.');
1661 return true;
1662 }
1664 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for lti provider requests.');
1665 return true;
1666 }
1668 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for SAML request.');
1669 return true;
1670 }
1671 if (
1672 $a_current_script == "register.php" ||
1673 $a_current_script == "pwassist.php" ||
1674 $a_current_script == "confirmReg.php" ||
1675 $a_current_script == "il_securimage_play.php" ||
1676 $a_current_script == "il_securimage_show.php" ||
1677 $a_current_script == 'login.php'
1678 ) {
1679 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for script: ' . $a_current_script);
1680 return true;
1681 }
1682
1683 // @todo refinery undefined
1684 $requestBaseClass = strtolower((string) ($_GET['baseClass'] ?? ''));
1685 if ($requestBaseClass == strtolower(ilStartUpGUI::class)) {
1686 $requestCmdClass = strtolower((string) ($_GET['cmdClass'] ?? ''));
1687 if (
1688 $requestCmdClass == strtolower(ilAccountRegistrationGUI::class) ||
1689 $requestCmdClass == strtolower(ilPasswordAssistanceGUI::class)
1690 ) {
1691 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for cmdClass: ' . $requestCmdClass);
1692 return true;
1693 }
1694 $cmd = $DIC->ctrl()->getCmd();
1695
1696 if (in_array($cmd, [
1697 'showLegalDocuments',
1698 'showAccountMigration',
1699 'migrateAccount',
1700 'processCode',
1701 'showLoginPage',
1702 'showLogout',
1703 'doStandardAuthentication',
1704 'doCasAuthentication',
1705 ], true)) {
1706 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for cmd: ' . $cmd);
1707 return true;
1708 }
1709 }
1710
1711 $target = '';
1712 if ($DIC->http()->wrapper()->query()->has('target')) {
1713 // @todo refinery undefined
1714 $target = $_GET['target'];
1715 }
1716
1717 // #12884
1718 if (
1719 ($a_current_script == "goto.php" && $target == "impr_0") ||
1720 $requestBaseClass == strtolower(ilImprintGUI::class)
1721 ) {
1722 // @todo refinery undefind
1723 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for baseClass: ' . ($_GET['baseClass'] ?? ""));
1724 return true;
1725 }
1726
1727 if (
1728 (strtolower($requestCmdClass ?? "") === strtolower(ilAccessibilityControlConceptGUI::class))
1729 ) {
1730 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for cmdClass: ' . $requestCmdClass);
1731 return true;
1732 }
1733
1734 if ($a_current_script == 'goto.php' && in_array($target, array(
1735 'usr_registration',
1736 'usr_nameassist',
1737 'usr_pwassist',
1738 'usr_agreement'
1739 ))) {
1740 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for goto target: ' . $target);
1741 return true;
1742 }
1743
1744
1745 $current_ref_id = $DIC->http()->wrapper()->query()->has('ref_id')
1746 ? $DIC->http()->wrapper()->query()->retrieve('ref_id', $DIC->refinery()->kindlyTo()->int())
1747 : null;
1748
1749 if (null !== $current_ref_id
1750 && $DIC->user()->getId() === 0
1751 && $DIC->access()->checkAccessOfUser(
1753 'visible',
1754 '',
1755 $current_ref_id
1756 )) {
1757 return true;
1758 }
1759
1760
1761 ilLoggerFactory::getLogger('auth')->debug('Authentication required');
1762 return false;
1763 }
const CONTEXT_WEBDAV
Definition: ilContext.php:36
const CONTEXT_SHIBBOLETH
Definition: ilContext.php:45
const CONTEXT_APACHE_SSO
Definition: ilContext.php:44
const CONTEXT_SAML
Definition: ilContext.php:47
static getType()
Get context type.
Definition: ilContext.php:165
const CONTEXT_LTI_PROVIDER
Definition: ilContext.php:46
const CONTEXT_WAC
Definition: ilContext.php:43
static getLogger(string $a_component_id)
Get component logger.
const ANONYMOUS_USER_ID
Definition: constants.php:27
$_GET['cmd']
Definition: lti.php:26
global $DIC
Definition: shib_login.php:26

References $_GET, $DIC, ANONYMOUS_USER_ID, ilContext\CONTEXT_APACHE_SSO, ilContext\CONTEXT_LTI_PROVIDER, ilContext\CONTEXT_SAML, ilContext\CONTEXT_SHIBBOLETH, ilContext\CONTEXT_WAC, ilContext\CONTEXT_WEBDAV, ilLoggerFactory\getLogger(), and ilContext\getType().

+ Here is the call graph for this function:

◆ buildHTTPPath()

static ilInitialisation::buildHTTPPath ( )
staticprotected

Definition at line 362 of file class.ilInitialisation.php.

362 : bool
363 {
364 global $DIC;
365
366 return define(
367 'ILIAS_HTTP_PATH',
368 (new \ILIAS\Init\Environment\HttpPathBuilder(
369 $DIC[\ILIAS\Data\Factory::class],
370 $DIC->settings(),
371 $DIC['https'],
372 $DIC['ilIliasIniFile'],
374 ))->build()->getBaseURI()
375 );
376 }
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
$_SERVER['HTTP_HOST']
Definition: raiseError.php:26

References $_SERVER, and $DIC.

Referenced by initSettings().

+ Here is the caller graph for this function:

◆ determineClient()

static ilInitialisation::determineClient ( )
staticprotected

This method determines the current client and sets the constant CLIENT_ID.

Definition at line 382 of file class.ilInitialisation.php.

382 : void
383 {
384 if (defined('CLIENT_ID')) {
385 return;
386 }
387 global $DIC;
388 $df = $DIC[\ILIAS\Data\Factory::class];
389
390 // check whether ini file object exists
391 if (!$DIC->isDependencyAvailable('iliasIni')) {
392 self::abortAndDie('Fatal Error: ilInitialisation::determineClient called without initialisation of ILIAS ini file object.');
393 }
394
395 $in_unit_tests = defined('IL_PHPUNIT_TEST');
396 $context_supports_persitent_session = ilContext::supportsPersistentSessions();
397 $can_set_cookie = !$in_unit_tests && $context_supports_persitent_session;
398 $has_request_client_id = $DIC->http()->wrapper()->query()->has('client_id');
399 $has_cookie_client_id = $DIC->http()->cookieJar()->has('ilClientId');
400
401 // determine the available clientIds (default, request, cookie)
402 $default_client_id = $DIC->iliasIni()->readVariable('clients', 'default');
403
404 if ($DIC->http()->wrapper()->query()->has('client_id')) {
405 $client_id_from_get = $DIC->http()->wrapper()->query()->retrieve(
406 'client_id',
407 self::getClientIdTransformation()
408 );
409 }
410 if ($DIC->http()->wrapper()->cookie()->has('ilClientId')) {
411 $client_id_from_cookie = $DIC->http()->wrapper()->cookie()->retrieve(
412 'ilClientId',
413 self::getClientIdTransformation()
414 );
415 }
416
417 // set the clientId by availability: 1. request, 2. cookie, fallback to defined default
418 $client_id_to_use = '';
419 if (isset($client_id_from_get) && $client_id_from_get !== '') {
420 $client_id_to_use = $client_id_from_get;
421 }
422 // we found a client_id in $GET
423 if (isset($client_id_from_get) && strlen($client_id_from_get) > 0) {
424 // @todo refinery undefined
425 $client_id_to_use = $_GET['client_id'] = $df->clientId($client_id_from_get)->toString();
426 if ($can_set_cookie) {
427 ilUtil::setCookie('ilClientId', $client_id_to_use);
428 }
429 } else {
430 $client_id_to_use = $default_client_id;
431 if (!isset($_COOKIE['ilClientId'])) {
432 ilUtil::setCookie('ilClientId', $client_id_to_use);
433 }
434 }
435
436 $client_id_to_use = $client_id_to_use ?: $default_client_id;
437
438 define('CLIENT_ID', $df->clientId($client_id_to_use)->toString());
439 }
static supportsPersistentSessions()
Check if context supports persistent session handling.
Definition: ilContext.php:175
static abortAndDie(string $a_message)
static setCookie(string $a_cookie_name, string $a_cookie_value='', bool $a_also_set_super_global=true, bool $a_set_cookie_invalid=false)
$_COOKIE[session_name()]
Definition: xapitoken.php:52

References $_COOKIE, $_GET, $DIC, abortAndDie(), ilUtil\setCookie(), and ilContext\supportsPersistentSessions().

+ Here is the call graph for this function:

◆ getClientIdTransformation()

static ilInitialisation::getClientIdTransformation ( )
staticprivate

Refinery is not initialized early enough to provide a transformation to be used with the \ILIAS\HTTP implementation to retrieve the parameters.

Instead, this implementation here will be used.

Returns
Transformation implementation of a transformation to get the clientId.

@inheritDoc

@inheritDoc

@inheritDoc

Definition at line 448 of file class.ilInitialisation.php.

449 {
450 return new class () implements Transformation {
454 public function transform($from): string
455 {
456 if (!is_string($from)) {
457 throw new InvalidArgumentException(__METHOD__ . " the argument is not a string.");
458 }
459 return strip_tags($from);
460 }
461
465 public function applyTo(Result $result): Result
466 {
467 return $result->then(function ($value): Result {
468 try {
469 return new Ok($this->transform($value));
470 } catch (Exception $exception) {
471 return new Error($exception);
472 }
473 });
474 }
475
479 public function __invoke($from): string
480 {
481 return $this->transform($from);
482 }
483 };
484 }
A result encapsulates a value or an error and simplifies the handling of those.
Definition: Ok.php:31
A result encapsulates a value or an error and simplifies the handling of those.
Definition: Result.php:29
then(callable $f)
Get a new result from the callable or do nothing if this is an error.
A transformation is a function from one datatype to another.
applyTo(Result $result)
@inheritDoc
__invoke($from)
@inheritDoc

References ILIAS\Refinery\__invoke(), ILIAS\Refinery\applyTo(), ILIAS\Data\Result\then(), and ILIAS\Refinery\transform().

+ Here is the call graph for this function:

◆ goToLogin()

static ilInitialisation::goToLogin ( )
staticprotected

go to login

Definition at line 970 of file class.ilInitialisation.php.

970 : void
971 {
972 global $DIC;
973
974 $session_expired = false;
975 ilLoggerFactory::getLogger('init')->debug('Redirecting to login page.');
976
977 if ($DIC['ilAuthSession']->isExpired()) {
979 $session_expired = true;
980 }
981 if (!$DIC['ilAuthSession']->isAuthenticated()) {
983 }
984
985 $target = $DIC->http()->wrapper()->query()->has('target')
986 ? $DIC->http()->wrapper()->query()->retrieve(
987 'target',
988 $DIC->refinery()->kindlyTo()->string()
989 )
990 : '';
991
992 if (strlen($target)) {
993 $target = "target=" . $target . "&";
994 }
995
996 $client_id = $DIC->http()->wrapper()->cookie()->retrieve(
997 'ilClientId',
998 $DIC->refinery()->byTrying([
999 $DIC->refinery()->kindlyTo()->string(),
1000 $DIC->refinery()->always('')
1001 ])
1002 );
1003
1004 $script = "login.php?" . $target . "client_id=" . $client_id;
1005 $script .= $session_expired ? "&session_expired=1" : "";
1006
1008 $script,
1009 "init_error_authentication_fail",
1010 array(
1011 "en" => "Authentication failed.",
1012 "de" => "Authentifizierung fehlgeschlagen."
1013 )
1014 );
1015 }
static redirect(string $a_target, string $a_message_id='', ?array $a_message_static=null)
Redirects to target url if context supports it.
const int SESSION_CLOSE_LOGIN
static setClosingContext(int $a_context)
set closing context (for statistics)
const int SESSION_CLOSE_EXPIRE
$client_id
Definition: ltiauth.php:67

References $client_id, $DIC, ilLoggerFactory\getLogger(), redirect(), ilSession\SESSION_CLOSE_EXPIRE, ilSession\SESSION_CLOSE_LOGIN, and ilSession\setClosingContext().

+ Here is the call graph for this function:

◆ goToPublicSection()

static ilInitialisation::goToPublicSection ( )
static

go to public section

Definition at line 916 of file class.ilInitialisation.php.

916 : void
917 {
918 global $DIC;
919
920 if (ANONYMOUS_USER_ID == "") {
921 self::abortAndDie("Public Section enabled, but no Anonymous user found.");
922 }
923
924 $session_destroyed = false;
925 if ($DIC['ilAuthSession']->isExpired()) {
926 $session_destroyed = true;
928 }
929 if (!$DIC['ilAuthSession']->isAuthenticated()) {
930 $session_destroyed = true;
932 }
933
934 if ($session_destroyed) {
935 $GLOBALS['DIC']['ilAuthSession']->setAuthenticated(true, ANONYMOUS_USER_ID);
936 }
937
939
940 $target = '';
941 if ($DIC->http()->wrapper()->query()->has('target')) {
942 $target = $DIC->http()->wrapper()->query()->retrieve(
943 'target',
944 $DIC->refinery()->kindlyTo()->string()
945 );
946 }
947
948 // if target given, try to go there
949 if (strlen($target)) {
950 // when we are already "inside" goto.php no redirect is needed
951 $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
952 if ($current_script == "goto.php") {
953 return;
954 }
955 // goto will check if target is accessible or redirect to login
956 self::redirect("goto.php?target=" . $target);
957 }
958
959 // we do not know if ref_id of request is accesible, so redirecting to root
961 "ilias.php?baseClass=ilrepositorygui&reloadpublic=1&cmd=&ref_id=" . (defined(
962 'ROOT_FOLDER_ID'
963 ) ? (string) ROOT_FOLDER_ID : '0')
964 );
965 }
static initUserAccount()
Init user with current account id.
const int SESSION_CLOSE_PUBLIC
const ROOT_FOLDER_ID
Definition: constants.php:32

References $_SERVER, $DIC, $GLOBALS, abortAndDie(), ANONYMOUS_USER_ID, initUserAccount(), redirect(), ROOT_FOLDER_ID, ilSession\SESSION_CLOSE_EXPIRE, ilSession\SESSION_CLOSE_PUBLIC, and ilSession\setClosingContext().

Referenced by ilAuthUtils\handleForcedAuthentication(), and ilStartUpGUI\processIndexPHP().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleAuthenticationFail()

static ilInitialisation::handleAuthenticationFail ( )
staticprotected

Definition at line 1440 of file class.ilInitialisation.php.

1440 : void
1441 {
1442 global $DIC;
1443
1444 ilLoggerFactory::getLogger('init')->debug('Handling of failed authentication.');
1445
1446 // #10608
1447 if (
1450 throw new Exception("Authentication failed.");
1451 }
1452
1453 if (($DIC->http()->request()->getQueryParams()['cmdMode'] ?? 0) === 'asynch') {
1454 $DIC->language()->loadLanguageModule('init');
1455 $DIC->http()->saveResponse(
1456 $DIC->http()->response()
1457 ->withStatus(403)
1458 ->withBody(Streams::ofString($DIC->language()->txt('init_error_authentication_fail')))
1459 );
1460 $DIC->http()->sendResponse();
1461 $DIC->http()->close();
1462 }
1463 if (
1464 $DIC['ilAuthSession']->isExpired() &&
1465 !\ilObjUser::_isAnonymous($DIC['ilAuthSession']->getUserId())
1466 ) {
1467 ilLoggerFactory::getLogger('init')->debug('Expired session found -> redirect to login page');
1469 return;
1470 }
1471 if (ilPublicSectionSettings::getInstance()->isEnabledForDomain($_SERVER['SERVER_NAME']) &&
1472 $DIC->access()->checkAccessOfUser(ANONYMOUS_USER_ID, 'read', '', ROOT_FOLDER_ID)) {
1473 ilLoggerFactory::getLogger('init')->debug('Redirect to public section.');
1475 return;
1476 }
1477 ilLoggerFactory::getLogger('init')->debug('Redirect to login page.');
1479 }
const CONTEXT_SOAP
Definition: ilContext.php:34
static goToLogin()
go to login
static goToPublicSection()
go to public section
static _isAnonymous(int $usr_id)

References $_SERVER, $DIC, ilObjUser\_isAnonymous(), ANONYMOUS_USER_ID, ilContext\CONTEXT_SOAP, ilContext\CONTEXT_WAC, ilPublicSectionSettings\getInstance(), ilLoggerFactory\getLogger(), ilContext\getType(), and ROOT_FOLDER_ID.

+ Here is the call graph for this function:

◆ handleDevMode()

static ilInitialisation::handleDevMode ( )
staticprotected

Prepare developer tools.

Definition at line 1123 of file class.ilInitialisation.php.

1123 : void
1124 {
1125 error_reporting(-1);
1126 }

◆ handleErrorReporting()

static ilInitialisation::handleErrorReporting ( )
static

Set error reporting level.

Definition at line 1219 of file class.ilInitialisation.php.

1219 : void
1220 {
1221 // push the error level as high as possible / sane
1222 error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
1223
1224 // see handleDevMode() - error reporting might be overwritten again
1225 // but we need the client ini first
1226 }

Referenced by ilWebAccessCheckerDelivery\handleRequest().

+ Here is the caller graph for this function:

◆ handleMaintenanceMode()

static ilInitialisation::handleMaintenanceMode ( )
staticprotected

handle maintenance mode

Definition at line 576 of file class.ilInitialisation.php.

576 : void
577 {
578 global $ilClientIniFile;
579
580 if (!$ilClientIniFile->readVariable("client", "access")) {
581 $mess = array(
582 "en" => "The server is not available due to maintenance." .
583 " We apologise for any inconvenience.",
584 "de" => "Der Server ist aufgrund von Wartungsarbeiten aktuell nicht verfügbar." .
585 " Wir bitten um Verständnis. Versuchen Sie es später noch einmal."
586 );
587 $mess_id = "init_error_maintenance";
588
589 if (ilContext::hasHTML() && is_file("./maintenance.html")) {
590 self::redirect("./maintenance.html", $mess_id, $mess);
591 } else {
592 $mess = self::translateMessage($mess_id, $mess);
593 self::abortAndDie($mess);
594 }
595 }
596 }
static hasHTML()
Has HTML output.
Definition: ilContext.php:125
static translateMessage(string $a_message_id, ?array $a_message_static=null)
Translate message if possible.

References abortAndDie(), ilContext\hasHTML(), redirect(), and translateMessage().

+ Here is the call graph for this function:

◆ initAccessHandling()

static ilInitialisation::initAccessHandling ( )
staticprotected

$ilAccess and $rbac... initialisation

Definition at line 1045 of file class.ilInitialisation.php.

1045 : void
1046 {
1048 "rbacreview",
1049 "ilRbacReview",
1050 "./components/ILIAS/AccessControl/classes/class.ilRbacReview.php",
1051 true
1052 );
1053
1054 $rbacsystem = ilRbacSystem::getInstance();
1055 self::initGlobal('rbacsystem', $rbacsystem, null, true);
1056
1058 "rbacadmin",
1059 "ilRbacAdmin",
1060 "./components/ILIAS/AccessControl/classes/class.ilRbacAdmin.php",
1061 true
1062 );
1063
1065 "ilAccess",
1066 "ilAccess",
1067 "./components/ILIAS/AccessControl/classes/class.ilAccess.php",
1068 true
1069 );
1070 }
static initGlobal(string $a_name, $a_class, ?string $a_source_file=null, ?bool $destroy_existing=false)

References ilRbacSystem\getInstance(), and initGlobal().

+ Here is the call graph for this function:

◆ initAccessibilityControlConcept()

static ilInitialisation::initAccessibilityControlConcept ( \ILIAS\DI\Container  $c)
staticprotected

Definition at line 773 of file class.ilInitialisation.php.

773 : void
774 {
775 $c['acc.criteria.type.factory'] = function (\ILIAS\DI\Container $c) {
776 return new ilAccessibilityCriterionTypeFactory($c->rbac()->review(), $c['ilObjDataCache']);
777 };
778
779 $c['acc.document.evaluator'] = function (\ILIAS\DI\Container $c) {
782 $c['acc.criteria.type.factory'],
783 $c->user(),
784 $c->logger()->acc()
785 ),
786 $c->user(),
787 $c->logger()->acc(),
788 \ilAccessibilityDocument::orderBy('sorting')->get()
789 );
790 };
791 }
static orderBy(string $orderBy, string $orderDirection='ASC')
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
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...

References $c, and ActiveRecord\orderBy().

+ Here is the call graph for this function:

◆ initAvatar()

static ilInitialisation::initAvatar ( \ILIAS\DI\Container  $c)
staticprotected

Definition at line 756 of file class.ilInitialisation.php.

756 : void
757 {
758 $c["user.avatar.factory"] = function ($c) {
759 return new \ilUserAvatarFactory($c);
760 };
761 }

References $c.

◆ initBackgroundTasks()

static ilInitialisation::initBackgroundTasks ( \ILIAS\DI\Container  $c)
staticprivate

Definition at line 1896 of file class.ilInitialisation.php.

1896 : void
1897 {
1898 global $ilIliasIniFile;
1899
1900 $n_of_tasks = $ilIliasIniFile->readVariable("background_tasks", "number_of_concurrent_tasks");
1901 $sync = $ilIliasIniFile->readVariable("background_tasks", "concurrency");
1902
1903 $n_of_tasks = $n_of_tasks ?: 5;
1904 $sync = $sync ?: 'sync'; // The default value is sync.
1905
1906 $c["bt.task_factory"] = function ($c) {
1907 return new \ILIAS\BackgroundTasks\Implementation\Tasks\BasicTaskFactory($c["di.injector"]);
1908 };
1909
1910 $c["bt.persistence"] = function ($c) {
1911 return \ILIAS\BackgroundTasks\Implementation\Persistence\BasicPersistence::instance($c->database());
1912 };
1913
1914 $c["bt.injector"] = function ($c) {
1915 return new \ILIAS\BackgroundTasks\Dependencies\Injector($c, new BaseDependencyMap());
1916 };
1917
1918 $c["bt.task_manager"] = function ($c) use ($sync) {
1919 if ($sync == 'sync') {
1920 return new \ILIAS\BackgroundTasks\Implementation\TaskManager\SyncTaskManager($c["bt.persistence"]);
1921 } elseif ($sync == 'async') {
1922 return new \ILIAS\BackgroundTasks\Implementation\TaskManager\AsyncTaskManager($c["bt.persistence"]);
1923 } else {
1924 throw new ilException("The supported Background Task Managers are sync and async. $sync given.");
1925 }
1926 };
1927 }
Base class for ILIAS Exception handling.
$ilIliasIniFile
Definition: server.php:39

References $c, and $ilIliasIniFile.

◆ initClient()

static ilInitialisation::initClient ( )
staticprotected

Init client-based objects (level 1)

Definition at line 1260 of file class.ilInitialisation.php.

1260 : void
1261 {
1262 global $https, $ilias, $DIC;
1263
1265
1267
1268 self::bootstrapFilesystems();
1269
1271
1273
1274 // --- needs client ini
1275
1276 $ilias->client_id = (string) CLIENT_ID;
1277
1278 if (DEVMODE) {
1280 }
1281
1283
1285
1287
1289
1290 // init dafault language
1291 self::initLanguage(false);
1292
1293 // moved after databases
1294 self::initLog();
1295
1297 "ilAppEventHandler",
1298 "ilAppEventHandler",
1299 "./components/ILIAS/EventHandling/classes/class.ilAppEventHandler.php"
1300 );
1301
1302 // there are rare cases where initILIAS is called twice for a request
1303 // example goto.php is called and includes ilias.php later
1304 // we must prevent that ilPluginAdmin is initialized twice in
1305 // this case, since this won't get the values out of plugin.php the
1306 // second time properly
1307 if (!isset($DIC["ilPluginAdmin"]) || !$DIC["ilPluginAdmin"] instanceof ilPluginAdmin) {
1309 "ilPluginAdmin",
1310 new ilPluginAdmin($DIC["component.repository"]),
1311 "./components/ILIAS/Component/classes/class.ilPluginAdmin.php"
1312 );
1313 }
1314 self::initGlobal("https", "ilHTTPS", "./components/ILIAS/Http/classes/class.ilHTTPS.php");
1317 self::initCron($GLOBALS['DIC']);
1318 self::initAvatar($GLOBALS['DIC']);
1321 self::initMail($GLOBALS['DIC']);
1324
1325 // --- needs settings
1326
1328
1329 if (ilContext::usesHTTP()) {
1330 $https->enableSecureCookies();
1331 $https->checkProtocolAndRedirectIfNeeded();
1332 }
1333
1334 // --- object handling
1335
1337 "ilObjDataCache",
1338 "ilObjectDataCache",
1339 "./components/ILIAS/Object/classes/class.ilObjectDataCache.php"
1340 );
1341
1343 "objDefinition",
1344 "ilObjectDefinition",
1345 "./components/ILIAS/Object/classes/class.ilObjectDefinition.php"
1346 );
1347
1348 // $tree
1349 $tree = new ilTree(ROOT_FOLDER_ID);
1350 self::initGlobal("tree", $tree);
1351 unset($tree);
1352
1355
1356 (new InitCtrlService())->init($DIC);
1357
1358 // Init GlobalScreen
1360 }
Class InitCtrlService wraps the initialization of ilCtrl.
static usesHTTP()
Uses HTTP aka browser.
Definition: ilContext.php:117
static initDatabase()
initialise database object $ilDB
static initLocale()
Init Locale.
static initMail(Container $c)
static initClientIniFile()
This method provides a global instance of class ilIniFile for the client.ini.php file in variable $il...
static initLegalDocuments(Container $c)
static initComponentService(\ILIAS\DI\Container $container)
static initLearningObjectMetadata(\ILIAS\DI\Container $c)
static determineClient()
This method determines the current client and sets the constant CLIENT_ID.
static initLog()
Init log instance.
static initAvatar(\ILIAS\DI\Container $c)
static setSessionHandler()
set session handler to db Used in Soap
static handleDevMode()
Prepare developer tools.
static setSessionCookieParams()
set session cookie params
static initSettings()
initialise $ilSettings object and define constants Used in Soap
static initGlobalScreen(\ILIAS\DI\Container $c)
static initAccessibilityControlConcept(\ILIAS\DI\Container $c)
static handleMaintenanceMode()
handle maintenance mode
static initCustomObjectIcons(\ILIAS\DI\Container $c)
static initCron(\ILIAS\DI\Container $c)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
const CLIENT_ID
Definition: constants.php:41

References $DIC, $GLOBALS, CLIENT_ID, init(), ROOT_FOLDER_ID, and ilContext\usesHTTP().

+ Here is the call graph for this function:

◆ initClientIniFile()

static ilInitialisation::initClientIniFile ( )
staticprotected

This method provides a global instance of class ilIniFile for the client.ini.php file in variable $ilClientIniFile.

It initializes a lot of constants accordingly to the settings in the client.ini.php file. Preconditions: ILIAS_WEB_DIR and CLIENT_ID must be set.

Returns
void true, if no error occured with client init file otherwise false

Reimplemented in XapiProxy\ilInitialisation.

Definition at line 495 of file class.ilInitialisation.php.

495 : void
496 {
497 global $ilIliasIniFile;
498
499 // check whether ILIAS_WEB_DIR is set.
500 if (!defined('ILIAS_WEB_DIR') || empty(ILIAS_WEB_DIR)) {
501 self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile called without ILIAS_WEB_DIR.");
502 }
503
504 // check whether CLIENT_ID is set.
505 if (CLIENT_ID == "") {
506 self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile called without CLIENT_ID.");
507 }
508
509 $ini_file = "/client.ini.php";
510 if (defined('CLIENT_WEB_DIR')) {
511 $ini_file = CLIENT_WEB_DIR . $ini_file;
512 } else {
513 $ini_file = __DIR__ . '/../../../../public/' . ILIAS_WEB_DIR . '/' . CLIENT_ID . '/client.ini.php';
514 }
515
516 $ilClientIniFile = new ilIniFile($ini_file);
517 $ilClientIniFile->read();
518
519 // invalid client id / client ini
520 if ($ilClientIniFile->ERROR != "") {
521 $default_client = $ilIliasIniFile->readVariable("clients", "default");
522 if (CLIENT_ID !== "") {
523 $mess = array("en" => "Client does not exist.",
524 "de" => "Mandant ist ungültig."
525 );
526 self::redirect("index.php?client_id=" . $default_client, '', $mess);
527 } else {
528 self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile initializing client ini file abborted with: " . $ilClientIniFile->ERROR);
529 }
530 }
531
532 self::initGlobal("ilClientIniFile", $ilClientIniFile);
533 // set constants
534 define("DEVMODE", (int) $ilClientIniFile->readVariable("system", "DEVMODE"));
535 define("SHOWNOTICES", (int) $ilClientIniFile->readVariable("system", "SHOWNOTICES"));
536 if (!defined("ROOT_FOLDER_ID")) {
537 define("ROOT_FOLDER_ID", (int) $ilClientIniFile->readVariable('system', 'ROOT_FOLDER_ID'));
538 }
539 if (!defined("SYSTEM_FOLDER_ID")) {
540 define("SYSTEM_FOLDER_ID", (int) $ilClientIniFile->readVariable('system', 'SYSTEM_FOLDER_ID'));
541 }
542 if (!defined("ROLE_FOLDER_ID")) {
543 define("ROLE_FOLDER_ID", (int) $ilClientIniFile->readVariable('system', 'ROLE_FOLDER_ID'));
544 }
545 define("MAIL_SETTINGS_ID", (int) $ilClientIniFile->readVariable('system', 'MAIL_SETTINGS_ID'));
546 $error_handler = $ilClientIniFile->readVariable('system', 'ERROR_HANDLER');
547 define("ERROR_HANDLER", $error_handler ?: "PRETTY_PAGE");
548
549 // this is for the online help installation, which sets OH_REF_ID to the
550 // ref id of the online module
551 define("OH_REF_ID", (int) $ilClientIniFile->readVariable("system", "OH_REF_ID"));
552
553 // see ilObject::TITLE_LENGTH, ilObject::DESC_LENGTH
554 // define ("MAXLENGTH_OBJ_TITLE",125);#$ilClientIniFile->readVariable('system','MAXLENGTH_OBJ_TITLE'));
555 // define ("MAXLENGTH_OBJ_DESC",$ilClientIniFile->readVariable('system','MAXLENGTH_OBJ_DESC'));
556
557 if (!defined("CLIENT_DATA_DIR")) {
558 define("CLIENT_DATA_DIR", ILIAS_DATA_DIR . "/" . CLIENT_ID);
559 }
560 if (!defined("CLIENT_WEB_DIR")) {
561 define("CLIENT_WEB_DIR", ILIAS_ABSOLUTE_PATH . "/public/" . ILIAS_WEB_DIR . "/" . CLIENT_ID);
562 }
563 define("CLIENT_NAME", $ilClientIniFile->readVariable('client', 'name')); // Change SS
564
565 $db_type = $ilClientIniFile->readVariable("db", "type");
566 if ($db_type === "") {
567 define("IL_DB_TYPE", ilDBConstants::TYPE_INNODB);
568 } else {
569 define("IL_DB_TYPE", $db_type);
570 }
571 }
INIFile Parser Early access in init proceess! Avoid further dependencies like logging or other servic...
const ILIAS_DATA_DIR
Definition: constants.php:44
const ILIAS_WEB_DIR
Definition: constants.php:45
const CLIENT_WEB_DIR
Definition: constants.php:47

References $ilIliasIniFile, abortAndDie(), CLIENT_ID, CLIENT_WEB_DIR, ILIAS_DATA_DIR, ILIAS_WEB_DIR, initGlobal(), redirect(), and ilDBConstants\TYPE_INNODB.

+ Here is the call graph for this function:

◆ initComponentService()

static ilInitialisation::initComponentService ( \ILIAS\DI\Container  $container)
staticprotected

Definition at line 1556 of file class.ilInitialisation.php.

1556 : void
1557 {
1558 $init = new InitComponentService();
1559 $init->init($container);
1560 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$container
@noRector
Definition: wac.php:37

References $container.

◆ initCore()

static ilInitialisation::initCore ( )
staticprotected

Init core objects (level 0)

Definition at line 1231 of file class.ilInitialisation.php.

1231 : void
1232 {
1233 global $ilErr;
1234
1236
1238 $GLOBALS["DIC"]["ilias.version"] = $GLOBALS["DIC"][\ILIAS\Data\Factory::class]->version(ILIAS_VERSION_NUMERIC);
1239
1240 // error handler
1242 "ilErr",
1243 "ilErrorHandling",
1244 "./components/ILIAS/Init/classes/class.ilErrorHandling.php"
1245 );
1246
1248
1250
1251 define('IL_INITIAL_WD', getcwd());
1252
1253 // deprecated
1254 self::initGlobal("ilias", "ILIAS", "./components/ILIAS/Init/classes/class.ilias.php");
1255 }
static removeUnsafeCharacters()
Remove unsafe characters from GET.
static requireCommonIncludes()
get common include code files
static handleErrorReporting()
Set error reporting level.
static initIliasIniFile()
This method provides a global instance of class ilIniFile for the ilias.ini.php file in variable $ilI...
const ILIAS_VERSION_NUMERIC
$ilErr
Definition: raiseError.php:33

References $GLOBALS, $ilErr, and ILIAS_VERSION_NUMERIC.

◆ initCron()

static ilInitialisation::initCron ( \ILIAS\DI\Container  $c)
staticprotected

Definition at line 719 of file class.ilInitialisation.php.

719 : void
720 {
721 $c['cron.repository'] = static function (\ILIAS\DI\Container $c): ILIAS\Cron\Job\JobRepository {
723 $c->database(),
724 $c->settings(),
725 $c->logger()->cron(),
726 $c['component.repository'],
727 $c['component.factory']
728 );
729 };
730
731 $c['cron.manager'] = static function (\ILIAS\DI\Container $c): ILIAS\Cron\Job\JobManager {
733 $c['cron.repository'],
734 $c->database(),
735 $c->settings(),
736 $c->logger()->cron(),
737 $c[\ILIAS\Data\Factory::class]->clock(),
738 );
739 };
740 }

References $c.

◆ initCustomObjectIcons()

static ilInitialisation::initCustomObjectIcons ( \ILIAS\DI\Container  $c)
staticprotected
Parameters
\ILIAS\DI\Container$c

Definition at line 745 of file class.ilInitialisation.php.

745 : void
746 {
747 $c["object.customicons.factory"] = function ($c) {
748 return new CustomIconFactory(
749 $c->filesystem()->web(),
750 $c->upload(),
751 $c['ilObjDataCache']
752 );
753 };
754 }

References $c.

◆ initDatabase()

static ilInitialisation::initDatabase ( )
staticprotected

initialise database object $ilDB

Reimplemented in XapiProxy\ilInitialisation.

Definition at line 601 of file class.ilInitialisation.php.

601 : void
602 {
603 // build dsn of database connection and connect
605 $ilDB->initFromIniFile();
606 $ilDB->connect();
607
608 self::initGlobal("ilDB", $ilDB);
609 }
static getWrapper(string $a_type)

References $ilDB, ilDBWrapperFactory\getWrapper(), and initGlobal().

+ Here is the call graph for this function:

◆ initFileUploadService()

static ilInitialisation::initFileUploadService ( \ILIAS\DI\Container  $dic)
static

Initializes the file upload service.

This service requires the http and filesystem service.

Parameters
\ILIAS\DI\Container$dicThe dependency container which should be used to load the file upload service.
Returns
void

Definition at line 311 of file class.ilInitialisation.php.

311 : void
312 {
313 $dic['upload.processor-manager'] = function ($c) {
314 return new PreProcessorManagerImpl();
315 };
316
317 $dic['upload'] = function (\ILIAS\DI\Container $c) {
318 $fileUploadImpl = new \ILIAS\FileUpload\FileUploadImpl(
319 $c['upload.processor-manager'],
320 $c['filesystem'],
321 $c['http']
322 );
323 if ((defined('IL_VIRUS_SCANNER') && IL_VIRUS_SCANNER != "None") || (defined('IL_SCANNER_TYPE') && IL_SCANNER_TYPE == "1")) {
324 $fileUploadImpl->register(new ilVirusScannerPreProcessor(ilVirusScannerFactory::_getInstance()));
325 }
326
327 $fileUploadImpl->register(new FilenameSanitizerPreProcessor());
328 $fileUploadImpl->register(
330 $c->fileServiceSettings(),
331 $c->language()->txt("msg_info_blacklisted")
332 )
333 );
334 $fileUploadImpl->register(new InsecureFilenameSanitizerPreProcessor());
335 $fileUploadImpl->register(new SVGBlacklistPreProcessor(
336 $c->language()->txt("upload_svg_rejection_message"),
337 $c->language()->txt("upload_svg_rejection_message_script"),
338 $c->language()->txt("upload_svg_rejection_message_base64"),
339 $c->language()->txt("upload_svg_rejection_message_foreign_object"),
340 $c->language()->txt("upload_svg_rejection_message_elements")
341 ));
342
343 return $fileUploadImpl;
344 };
345 }
$dic
Definition: ltiresult.php:33

References $c, $dic, and ilVirusScannerFactory\_getInstance().

+ Here is the call graph for this function:

◆ initGlobal()

static ilInitialisation::initGlobal ( string  $a_name,
  $a_class,
?string  $a_source_file = null,
?bool  $destroy_existing = false 
)
staticprotected
Parameters
object | string$a_class

Reimplemented in XapiProxy\ilInitialisation.

Definition at line 1087 of file class.ilInitialisation.php.

1092 : void {
1093 global $DIC;
1094
1095 if ($destroy_existing) {
1096 if (isset($GLOBALS[$a_name])) {
1097 unset($GLOBALS[$a_name]);
1098 }
1099 if (isset($DIC[$a_name])) {
1100 unset($DIC[$a_name]);
1101 }
1102 }
1103
1104 $GLOBALS[$a_name] = is_object($a_class) ? $a_class : new $a_class();
1105
1106 $DIC[$a_name] = static function (Container $c) use ($a_name) {
1107 return $GLOBALS[$a_name];
1108 };
1109 }

References $DIC, and $GLOBALS.

Referenced by initAccessHandling(), initClientIniFile(), initDatabase(), initIliasIniFile(), initLog(), initSettings(), initStyle(), and requireCommonIncludes().

+ Here is the caller graph for this function:

◆ initGlobalCache()

static ilInitialisation::initGlobalCache ( )
staticprotected

Definition at line 611 of file class.ilInitialisation.php.

611 : void
612 {
613 global $DIC;
614 $legacy_settings = new ilGlobalCacheSettingsAdapter(
615 $DIC->clientIni(),
616 $DIC->database(),
617 );
618 $DIC['global_cache'] = new \ILIAS\Cache\Services(
619 $legacy_settings->getConfig()
620 );
621 }

References $DIC.

◆ initGlobalScreen()

static ilInitialisation::initGlobalScreen ( \ILIAS\DI\Container  $c)
staticprivate
Parameters
\ILIAS\DI\Container$c

Definition at line 1495 of file class.ilInitialisation.php.

1495 : void
1496 {
1497 $c['global_screen'] = function () use ($c) {
1498 return new Services(
1500 $c->ui(),
1501 htmlentities(str_replace([" ", ".", "-"], "_", ILIAS_VERSION_NUMERIC))
1502 );
1503 };
1504 $c->globalScreen()->tool()->context()->stack()->clear();
1505 $c->globalScreen()->tool()->context()->claim()->main();
1506 }

References $c, and ILIAS_VERSION_NUMERIC.

◆ initHTML()

static ilInitialisation::initHTML ( )
staticprotected

init HTML output (level 3)

Definition at line 1565 of file class.ilInitialisation.php.

1565 : void
1566 {
1567 global $ilUser, $DIC;
1568
1569 if (ilContext::hasUser()) {
1570 // load style definitions
1571 // use the init function with plugin hook here, too
1573
1575 }
1576
1578 $tpl = new ilGlobalPageTemplate($DIC->globalScreen(), $DIC->ui(), $DIC->http());
1579 self::initGlobal("tpl", $tpl);
1580
1581 if (ilContext::hasUser()) {
1582 $dispatcher = new \ILIAS\Init\StartupSequence\StartUpSequenceDispatcher($DIC);
1583 $dispatcher->dispatch();
1584 }
1585
1587 "ilNavigationHistory",
1588 "ilNavigationHistory",
1589 "components/ILIAS/Navigation/classes/class.ilNavigationHistory.php"
1590 );
1591
1593 "ilHelp",
1594 "ilHelpGUI",
1595 "components/ILIAS/Help/classes/class.ilHelpGUI.php"
1596 );
1597
1598 if (DEVMODE) {
1599 $DIC["help.text_retriever"] = new ILIAS\UI\Help\TextRetriever\Echoing();
1600 } else {
1601 $DIC["help.text_retriever"] = new ilHelpUITextRetriever();
1602 }
1603
1605 "ilToolbar",
1606 "ilToolbarGUI",
1607 "./components/ILIAS/UIComponent/Toolbar/classes/class.ilToolbarGUI.php"
1608 );
1609
1611 "ilLocator",
1612 "ilLocatorGUI",
1613 "./components/ILIAS/Locator/classes/class.ilLocatorGUI.php"
1614 );
1615
1617 "ilTabs",
1618 "ilTabsGUI",
1619 "./components/ILIAS/UIComponent/Tabs/classes/class.ilTabsGUI.php"
1620 );
1621
1622 if (ilContext::hasUser()) {
1623 // the next line makes it impossible to save the offset somehow in a session for
1624 // a specific table (I tried it for the user administration).
1625 // its not posssible to distinguish whether it has been set to page 1 (=offset = 0)
1626 // or not set at all (then we want the last offset, e.g. being used from a session var).
1627 // So I added the wrapping if statement. Seems to work (hopefully).
1628 // Alex April 14th 2006
1629 // @todo not replaced by refinery due to unknown sideeffects
1630 if (isset($_GET['offset']) && $_GET['offset'] != "") {
1631 $_GET['offset'] = (int) $_GET['offset']; // old code
1632 }
1633
1634 self::initGlobal("lti", "ilLTIViewGUI", "./components/ILIAS/LTIProvider/classes/class.ilLTIViewGUI.php");
1635 $GLOBALS["DIC"]["lti"]->init();
1637 }
1638 }
This HelpTextRetriever simply echo the purpose and the topics for debugging and development purpose.
Definition: Echoing.php:31
static hasUser()
Based on user authentication?
Definition: ilContext.php:109
This describes a facility that the UI framework can use to retrieve some help text.
static applyPluginManipulationsToUiFramework(\ILIAS\DI\Container $c)
static initKioskMode(\ILIAS\DI\Container $c)
static initUploadPolicies(\ILIAS\DI\Container $dic)
static initStyle()
provide $styleDefinition object

References $_GET, $DIC, $GLOBALS, ilContext\hasUser(), and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ initHTTPServices()

static ilInitialisation::initHTTPServices ( \ILIAS\DI\Container  $container)
staticprotected
Parameters
\ILIAS\DI\Container$container

Definition at line 1484 of file class.ilInitialisation.php.

1484 : void
1485 {
1486 $init_http = new InitHttpServices();
1487 $init_http->init($container);
1488
1490 }
static init(Container $c)
Definition: Init.php:36
Responsible for loading the HTTP Service into the dependency injection container of ILIAS.

References $container, and ILIAS\StaticURL\Init\init().

+ Here is the call graph for this function:

◆ initILIAS()

static ilInitialisation::initILIAS ( )
static

ilias initialisation

Definition at line 1151 of file class.ilInitialisation.php.

1151 : void
1152 {
1153 if (self::$already_initialized) {
1154 return;
1155 }
1156
1157 $GLOBALS["DIC"]["ilLoggerFactory"] = function ($c) {
1159 };
1160
1161 self::$already_initialized = true;
1162
1165 if (ilContext::initClient()) {
1167 Init::init($GLOBALS["DIC"]);
1170
1171 if (ilContext::hasUser()) {
1173
1176 }
1177 }
1178
1179 // language may depend on user setting
1180 self::initLanguage(true);
1181 $GLOBALS['DIC']['tree']->initLangCode();
1182
1186
1187 if (ilContext::hasHTML()) {
1189 }
1190 }
1191
1192 // this MUST happen after everything else is initialized,
1193 // because this leads to rather unexpected behaviour which
1194 // is super hard to track down to this.
1195 self::replaceSuperGlobals($GLOBALS['DIC']);
1196 }
static initClient()
Init client.
Definition: ilContext.php:141
static initHTTPServices(\ILIAS\DI\Container $container)
static initSession()
Init auth session.
static initClient()
Init client-based objects (level 1)
static initCore()
Init core objects (level 0)
static initFileUploadService(\ILIAS\DI\Container $dic)
Initializes the file upload service.
static initHTML()
init HTML output (level 3)
static resumeUserSession()
Resume an existing user session.
static initUser()
Init user / authentification (level 2)
static initBackgroundTasks(\ILIAS\DI\Container $c)
static initInjector(\ILIAS\DI\Container $c)

References $c, $GLOBALS, ilLoggerFactory\getInstance(), ilContext\hasHTML(), ilContext\hasUser(), init(), ilContext\initClient(), and ilContext\supportsPersistentSessions().

Referenced by ilSoapFunctions\__call(), ILIAS\GlobalScreen\Client\ModeToggle\__construct(), ILIAS\GlobalScreen\Client\ItemState\__construct(), ILIAS\Init\AllModernComponents\enter(), ilSoapAdministration\getClientInfoXML(), ilSoapAdministration\getInstallationInfoXML(), ilSoapSCORMAdministration\getSCORMCompletionStatus(), ilNusoapUserAdministrationAdapter\handleSoapPlugins(), ilCalendarRemoteAccessHandler\initIlias(), and XapiProxy\DataService\initIlias().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initIliasIniFile()

static ilInitialisation::initIliasIniFile ( )
staticprotected

This method provides a global instance of class ilIniFile for the ilias.ini.php file in variable $ilIliasIniFile.

It initializes a lot of constants accordingly to the settings in the ilias.ini.php file.

Reimplemented in XapiProxy\ilInitialisation.

Definition at line 107 of file class.ilInitialisation.php.

107 : void
108 {
109 $ilIliasIniFile = new ilIniFile(__DIR__ . "/../../../../ilias.ini.php");
110 $ilIliasIniFile->read();
111 self::initGlobal('ilIliasIniFile', $ilIliasIniFile);
112
113 // initialize constants
114 // aka internal data directory
115 if (!defined('ILIAS_DATA_DIR')) {
116 define("ILIAS_DATA_DIR", $ilIliasIniFile->readVariable("clients", "datadir"));
117 }
118 // aka Public Web Directory in Web, relative path to the webroot (public).
119 if (!defined('ILIAS_WEB_DIR')) {
120 $from_ilias_ini = $ilIliasIniFile->readVariable("clients", "path");
121 $from_ilias_ini = str_replace('public/', '', $from_ilias_ini);
122 define("ILIAS_WEB_DIR", $from_ilias_ini);
123 }
124 if (!defined("ILIAS_ABSOLUTE_PATH")) {
125 define("ILIAS_ABSOLUTE_PATH", $ilIliasIniFile->readVariable('server', 'absolute_path'));
126 }
127
128 // logging
129 define("ILIAS_LOG_DIR", $ilIliasIniFile->readVariable("log", "path"));
130 define("ILIAS_LOG_FILE", $ilIliasIniFile->readVariable("log", "file"));
131 if (!defined("ILIAS_LOG_ENABLED")) {
132 define("ILIAS_LOG_ENABLED", $ilIliasIniFile->readVariable("log", "enabled"));
133 }
134 define("ILIAS_LOG_LEVEL", $ilIliasIniFile->readVariable("log", "level"));
135
136 // read path + command for third party tools from ilias.ini
137 define("PATH_TO_CONVERT", $ilIliasIniFile->readVariable("tools", "convert"));
138 define("PATH_TO_FFMPEG", $ilIliasIniFile->readVariable("tools", "ffmpeg"));
139 define("PATH_TO_ZIP", $ilIliasIniFile->readVariable("tools", "zip"));
140 define("PATH_TO_MKISOFS", $ilIliasIniFile->readVariable("tools", "mkisofs"));
141 define("PATH_TO_UNZIP", $ilIliasIniFile->readVariable("tools", "unzip"));
142 define("PATH_TO_GHOSTSCRIPT", $ilIliasIniFile->readVariable("tools", "ghostscript"));
143 define("PATH_TO_JAVA", $ilIliasIniFile->readVariable("tools", "java"));
144 define("PATH_TO_FOP", $ilIliasIniFile->readVariable("tools", "fop"));
145 define("PATH_TO_SCSS", $ilIliasIniFile->readVariable("tools", "scss"));
146
147 if ($ilIliasIniFile->groupExists('error')) {
148 if ($ilIliasIniFile->variableExists('error', 'editor_url')) {
149 define("ERROR_EDITOR_URL", $ilIliasIniFile->readVariable('error', 'editor_url'));
150 }
151
152 if ($ilIliasIniFile->variableExists('error', 'editor_path_translations')) {
153 define(
154 "ERROR_EDITOR_PATH_TRANSLATIONS",
155 $ilIliasIniFile->readVariable('error', 'editor_path_translations')
156 );
157 }
158 }
159
160 // read virus scanner settings
161 switch ($ilIliasIniFile->readVariable("tools", "vscantype")) {
162 case "sophos":
163 define("IL_VIRUS_SCANNER", "Sophos");
164 define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
165 define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
166 break;
167
168 case "antivir":
169 define("IL_VIRUS_SCANNER", "AntiVir");
170 define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
171 define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
172 break;
173
174 case "clamav":
175 define("IL_VIRUS_SCANNER", "ClamAV");
176 define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
177 define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
178 break;
179 case "icap":
180 define("IL_VIRUS_SCANNER", "icap");
181 define("IL_ICAP_HOST", $ilIliasIniFile->readVariable("tools", "icap_host"));
182 define("IL_ICAP_PORT", $ilIliasIniFile->readVariable("tools", "icap_port"));
183 define("IL_ICAP_AV_COMMAND", $ilIliasIniFile->readVariable("tools", "icap_service_name"));
184 define("IL_ICAP_CLIENT", $ilIliasIniFile->readVariable("tools", "icap_client_path"));
185 break;
186
187 default:
188 define("IL_VIRUS_SCANNER", "None");
189 define("IL_VIRUS_CLEAN_COMMAND", '');
190 break;
191 }
192
194 define("IL_TIMEZONE", $tz);
195 }
static initDefaultTimeZone(ilIniFile $ini)
Initialize default timezone from system settings.

References $ilIliasIniFile, ilTimeZone\initDefaultTimeZone(), and initGlobal().

+ Here is the call graph for this function:

◆ initInjector()

static ilInitialisation::initInjector ( \ILIAS\DI\Container  $c)
staticprivate

Definition at line 1929 of file class.ilInitialisation.php.

1929 : void
1930 {
1931 $c["di.dependency_map"] = function ($c) {
1932 return new \ILIAS\BackgroundTasks\Dependencies\DependencyMap\BaseDependencyMap();
1933 };
1934
1935 $c["di.injector"] = function ($c) {
1936 return new \ILIAS\BackgroundTasks\Dependencies\Injector($c, $c["di.dependency_map"]);
1937 };
1938 }

References $c.

◆ initKioskMode()

static ilInitialisation::initKioskMode ( \ILIAS\DI\Container  $c)
staticprivate

Definition at line 1940 of file class.ilInitialisation.php.

1940 : void
1941 {
1942 $c["service.kiosk_mode"] = function ($c) {
1943 return new ilKioskModeService(
1944 $c['ilCtrl'],
1945 $c['lng'],
1946 $c['ilAccess'],
1947 $c['objDefinition']
1948 );
1949 };
1950 }
Central entry point for users of the service.

References $c.

◆ initLearningObjectMetadata()

static ilInitialisation::initLearningObjectMetadata ( \ILIAS\DI\Container  $c)
staticprivate

Definition at line 1952 of file class.ilInitialisation.php.

1952 : void
1953 {
1954 $c['learning_object_metadata'] = function ($c) {
1955 return new \ILIAS\MetaData\Services\Services($c);
1956 };
1957 }

References $c.

◆ initLegalDocuments()

static ilInitialisation::initLegalDocuments ( Container  $c)
staticprotected

Definition at line 763 of file class.ilInitialisation.php.

763 : void
764 {
765 $c['legalDocuments'] = static fn(Container $c) => new Conductor($c);
766 }

References $c.

◆ initLocale()

static ilInitialisation::initLocale ( )
staticprotected

Init Locale.

Definition at line 891 of file class.ilInitialisation.php.

891 : void
892 {
893 global $ilSetting;
894
895 if ($ilSetting->get("locale") && trim($ilSetting->get("locale")) !== "") {
896 $larr = explode(",", trim($ilSetting->get("locale")));
897 $ls = array();
898 $first = $larr[0];
899 foreach ($larr as $l) {
900 if (trim($l) != "") {
901 $ls[] = $l;
902 }
903 }
904 if (count($ls) > 0) {
905 setlocale(LC_ALL, $ls);
906
907 // #15347 - making sure that floats are not changed
908 setlocale(LC_NUMERIC, "C");
909 }
910 }
911 }
global $ilSetting
Definition: privfeed.php:31

References $ilSetting.

◆ initLog()

static ilInitialisation::initLog ( )
staticprotected

Init log instance.

Reimplemented in XapiProxy\ilInitialisation.

Definition at line 1075 of file class.ilInitialisation.php.

1075 : void
1076 {
1078
1079 self::initGlobal("ilLog", $log);
1080 // deprecated
1081 self::initGlobal("log", $log);
1082 }
static getRootLogger()
The unique root logger has a fixed error level.
$log
Definition: ltiresult.php:34

References $log, ilLoggerFactory\getRootLogger(), and initGlobal().

+ Here is the call graph for this function:

◆ initMail()

static ilInitialisation::initMail ( Container  $c)
staticprotected

Definition at line 768 of file class.ilInitialisation.php.

768 : void
769 {
771 }

References $c, and init().

+ Here is the call graph for this function:

◆ initResourceStorage()

static ilInitialisation::initResourceStorage ( )
staticprotected

Definition at line 197 of file class.ilInitialisation.php.

197 : void
198 {
199 global $DIC;
200 (new InitResourceStorage())->init($DIC);
201 }
Responsible for loading the Resource Storage into the dependency injection container of ILIAS.

References $DIC, and init().

+ Here is the call graph for this function:

◆ initSession()

static ilInitialisation::initSession ( )
staticprotected

Init auth session.

Definition at line 1201 of file class.ilInitialisation.php.

1201 : void
1202 {
1203 if (isset($GLOBALS['DIC']['ilAuthSession'])) {
1204 unset($GLOBALS['DIC']['ilAuthSession']);
1205 }
1206
1207 $GLOBALS['DIC']['ilAuthSession'] = static function (Container $c): ilAuthSession {
1208 $auth_session = ilAuthSession::getInstance(
1209 $c['ilLoggerFactory']->getLogger('auth')
1210 );
1211 $auth_session->init();
1212 return $auth_session;
1213 };
1214 }
static getInstance(ilLogger $logger)

References $c, $GLOBALS, and ilAuthSession\getInstance().

+ Here is the call graph for this function:

◆ initSettings()

static ilInitialisation::initSettings ( )
staticprotected

initialise $ilSettings object and define constants Used in Soap

Definition at line 797 of file class.ilInitialisation.php.

797 : void
798 {
799 global $ilSetting;
800
802 "ilSetting",
803 "ilSetting",
804 "components/ILIAS/Administration/classes/class.ilSetting.php"
805 );
806
807 // check correct setup
808 if (!$ilSetting->get("setup_ok")) {
809 self::abortAndDie("Setup is not completed. Please run setup routine again.");
810 }
811
812 // set anonymous user & role id and system role id
813 define("ANONYMOUS_USER_ID", (int) $ilSetting->get("anonymous_user_id"));
814 define("ANONYMOUS_ROLE_ID", (int) $ilSetting->get("anonymous_role_id"));
815 define("SYSTEM_USER_ID", (int) $ilSetting->get("system_user_id"));
816 define("SYSTEM_ROLE_ID", (int) $ilSetting->get("system_role_id"));
817 define("USER_FOLDER_ID", 7);
818
819 // recovery folder
820 define("RECOVERY_FOLDER_ID", (int) $ilSetting->get("recovery_folder_id"));
821
822 // installation id
823 define("IL_INST_ID", $ilSetting->get("inst_id", '0'));
824
825 // define default suffix replacements
826 define("SUFFIX_REPL_DEFAULT", "php,php3,php4,inc,lang,phtml,htaccess");
827 define("SUFFIX_REPL_ADDITIONAL", $ilSetting->get("suffix_repl_additional", ""));
828
829 if (ilContext::usesHTTP()) {
831 }
832 }

References $ilSetting, abortAndDie(), buildHTTPPath(), initGlobal(), and ilContext\usesHTTP().

+ Here is the call graph for this function:

◆ initStyle()

static ilInitialisation::initStyle ( )
staticprotected

provide $styleDefinition object

Definition at line 837 of file class.ilInitialisation.php.

837 : void
838 {
839 global $DIC;
840 $component_factory = $DIC["component.factory"];
841
842 // load style definitions
844 "styleDefinition",
845 "ilStyleDefinition",
846 "./components/ILIAS/Style/System/classes/class.ilStyleDefinition.php"
847 );
848
849 // add user interface hook for style initialisation
850 foreach ($component_factory->getActivePluginsInSlot("uihk") as $ui_plugin) {
851 $gui_class = $ui_plugin->getUIClassInstance();
852 $gui_class->modifyGUI("components/ILIAS/Init", "init_style", array("styleDefinition" => $DIC->systemStyle()));
853 }
854 }

References $DIC, and initGlobal().

+ Here is the call graph for this function:

◆ initUploadPolicies()

static ilInitialisation::initUploadPolicies ( \ILIAS\DI\Container  $dic)
staticprotected

Definition at line 347 of file class.ilInitialisation.php.

347 : void
348 {
349 $dic['upload_policy_repository'] = static function ($dic) {
350 return new UploadPolicyDBRepository($dic->database());
351 };
352
353 $dic['upload_policy_resolver'] = static function ($dic): UploadPolicyResolver {
354 return new UploadPolicyResolver(
355 $dic->rbac()->review(),
356 $dic->user(),
357 $dic['upload_policy_repository']->getAll(),
358 );
359 };
360 }

References $dic.

◆ initUser()

static ilInitialisation::initUser ( )
staticprotected

Init user / authentification (level 2)

Definition at line 1365 of file class.ilInitialisation.php.

1365 : void
1366 {
1367 global $ilias, $ilUser;
1368
1369 // $ilUser
1371 "ilUser",
1373 "./components/ILIAS/User/classes/class.ilObjUser.php",
1374 true
1375 );
1376
1378 'user',
1379 new UserPublicInterface($ilUser),
1380 null,
1381 true
1382 );
1383
1384 $ilias->account = $ilUser;
1385
1387 }
static initAccessHandling()
$ilAccess and $rbac... initialisation
User class.

References ANONYMOUS_USER_ID.

◆ initUserAccount()

static ilInitialisation::initUserAccount ( )
static

Init user with current account id.

Definition at line 859 of file class.ilInitialisation.php.

859 : void
860 {
861 global $DIC;
862
863 static $context_init;
864
865 $uid = $GLOBALS['DIC']['ilAuthSession']->getUserId();
866 if ($uid) {
867 $DIC->user()->setId($uid);
868 $DIC->user()->read();
869 if (!isset($context_init)) {
870 if ($DIC->user()->isAnonymous()) {
871 $DIC->globalScreen()->tool()->context()->claim()->external();
872 } else {
873 $DIC->globalScreen()->tool()->context()->claim()->internal();
874 }
875 $context_init = true;
876 }
877 // init console log handler
878 ilLoggerFactory::getInstance()->initUser($DIC->user()->getLogin());
880 } else {
881 if (is_object($GLOBALS['ilLog'])) {
882 $GLOBALS['ilLog']->logStack();
883 }
884 self::abortAndDie("Init user account failed");
885 }
886 }
static updateAccess(ilObjUser $user)

References $DIC, $GLOBALS, abortAndDie(), ilLoggerFactory\getInstance(), and ilOnlineTracking\updateAccess().

Referenced by goToPublicSection(), ilAuthFrontend\handleAuthenticationSuccess(), and ilCalendarRemoteAccessHandler\initUser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ recursivelyRemoveUnsafeCharacters()

static ilInitialisation::recursivelyRemoveUnsafeCharacters (   $var)
staticprotected
Parameters
array | string$var
Returns
array|string

Definition at line 72 of file class.ilInitialisation.php.

73 {
74 if (is_array($var)) {
75 $mod = [];
76 foreach ($var as $k => $v) {
79 }
80 return $mod;
81 }
82 return strip_tags(
83 str_replace(
84 array("\x00", "\n", "\r", "\\", "'", '"', "\x1a"),
85 "",
86 $var
87 )
88 );
89 }
static recursivelyRemoveUnsafeCharacters($var)

References recursivelyRemoveUnsafeCharacters().

Referenced by recursivelyRemoveUnsafeCharacters(), and removeUnsafeCharacters().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redirect()

static ilInitialisation::redirect ( string  $a_target,
string  $a_message_id = '',
?array  $a_message_static = null 
)
staticprotected

Redirects to target url if context supports it.

Definition at line 1808 of file class.ilInitialisation.php.

1812 : void {
1813 // #12739
1814 if (defined("ILIAS_HTTP_PATH") &&
1815 !stristr($a_target, ILIAS_HTTP_PATH)) {
1816 $a_target = ILIAS_HTTP_PATH . "/" . $a_target;
1817 }
1818
1819 foreach (['ext_uid', 'soap_pw'] as $param) {
1820 if (false === strpos(
1821 $a_target,
1822 $param . '='
1823 ) && isset($GLOBALS['DIC']->http()->request()->getQueryParams()[$param])) {
1824 $a_target = \ilUtil::appendUrlParameterString($a_target, $param . '=' . \ilUtil::stripSlashes(
1825 $GLOBALS['DIC']->http()->request()->getQueryParams()[$param]
1826 ));
1827 }
1828 }
1829
1831 ilUtil::redirect($a_target);
1832 } else {
1833 $message = self::translateMessage($a_message_id, $a_message_static);
1834
1835 // user-directed linked message
1837 $link = self::translateMessage(
1838 "init_error_redirect_click",
1839 array("en" => 'Please click to continue.',
1840 "de" => 'Bitte klicken um fortzufahren.'
1841 )
1842 );
1843 $mess = $message .
1844 '<br /><a href="' . $a_target . '">' . $link . '</a>';
1845 } // plain text
1846 else {
1847 // not much we can do here
1848 $mess = $message;
1849
1850 if (!trim($mess)) {
1851 $mess = self::translateMessage(
1852 "init_error_redirect_info",
1853 array("en" => 'Redirect not supported by context.',
1854 "de" => 'Weiterleitungen werden durch Kontext nicht unterstützt.'
1855 )
1856 ) .
1857 ' (' . $a_target . ')';
1858 }
1859 }
1860
1861 self::abortAndDie($mess);
1862 }
1863 }
static supportsRedirects()
Are redirects supported?
Definition: ilContext.php:89
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 http()
Fetches the global http state from ILIAS.
$param
Definition: xapitoken.php:44

Referenced by goToLogin(), goToPublicSection(), handleMaintenanceMode(), and initClientIniFile().

+ Here is the caller graph for this function:

◆ redirectToStartingPage()

static ilInitialisation::redirectToStartingPage ( string  $target = '')
static

Definition at line 1865 of file class.ilInitialisation.php.

1865 : void
1866 {
1867 global $DIC;
1868
1869 // fallback, should never happen
1870 if ($DIC->user()->getId() === ANONYMOUS_USER_ID) {
1872 return;
1873 }
1874
1875 if (
1876 $target === '' &&
1877 $DIC->http()->wrapper()->query()->has('target')
1878 ) {
1879 $target = $DIC->http()->wrapper()->query()->retrieve(
1880 'target',
1881 $DIC->refinery()->kindlyTo()->string()
1882 );
1883 }
1884
1885 // for password change and incomplete profile
1886 // see ilDashboardGUI
1887 if ($target === '') {
1888 ilLoggerFactory::getLogger('init')->debug('Redirect to default starting page');
1889 $DIC->ctrl()->redirectToURL(ilUserUtil::getStartingPointAsUrl());
1890 } else {
1891 ilLoggerFactory::getLogger('init')->debug('Redirect to target: ' . $target);
1892 $DIC->ctrl()->redirectToURL("goto.php?target=" . $target);
1893 }
1894 }
static getStartingPointAsUrl()

References $DIC, ANONYMOUS_USER_ID, ilLoggerFactory\getLogger(), and ilUserUtil\getStartingPointAsUrl().

Referenced by ILIAS\LegalDocuments\Conductor\__construct(), ilStartUpGUI\doApacheAuthentication(), ilStartUpGUI\doLTIAuthentication(), ilStartUpGUI\doMigration(), ilStartUpGUI\doMigrationNewAccount(), ilStartUpGUI\doOpenIdConnectAuthentication(), ilStartUpGUI\doSamlAuthentication(), ILIAS\AuthShibboleth\LoginPerformer\doShibbolethAuthentication(), ilStartUpGUI\doStandardAuthentication(), ilStartUpGUI\processIndexPHP(), ILIAS\LegalDocuments\ConsumerToolbox\Blocks\routing(), ilStartUpGUI\showLoginPageOrStartupPage(), and ilAuthFrontendCredentialsSoap\tryAuthenticationOnLoginPage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reinitILIAS()

static ilInitialisation::reinitILIAS ( )
static

Definition at line 1130 of file class.ilInitialisation.php.

1130 : void
1131 {
1132 self::$already_initialized = false;
1134 }
static initILIAS()
ilias initialisation

Referenced by ilSoapAdministration\initIlias().

+ Here is the caller graph for this function:

◆ reInitUser()

static ilInitialisation::reInitUser ( )
static

Definition at line 1136 of file class.ilInitialisation.php.

1136 : void
1137 {
1141
1144 }
1145 }
1146 }

References ilContext\hasUser(), ilContext\initClient(), and ilContext\supportsPersistentSessions().

Referenced by ilSoapAdministration\initAuth(), and ilSoapAdministration\reInitUser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeUnsafeCharacters()

static ilInitialisation::removeUnsafeCharacters ( )
staticprotected

Remove unsafe characters from GET.

Definition at line 59 of file class.ilInitialisation.php.

59 : void
60 {
61 // Remove unsafe characters from GET parameters.
62 // We do not need this characters in any case, so it is
63 // feasible to filter them everytime. POST parameters
64 // need attention through ilUtil::stripSlashes() and similar functions)
66 }

References $_GET, and recursivelyRemoveUnsafeCharacters().

+ Here is the call graph for this function:

◆ requireCommonIncludes()

static ilInitialisation::requireCommonIncludes ( )
staticprotected

get common include code files

@noRector

Definition at line 94 of file class.ilInitialisation.php.

94 : void
95 {
97 require_once(__DIR__ . "/../../../../ilias_version.php");
98 self::initGlobal("ilBench", "ilBenchmark", "./components/ILIAS/Utilities/classes/class.ilBenchmark.php");
99 }

References initGlobal().

+ Here is the call graph for this function:

◆ resumeUserSession()

static ilInitialisation::resumeUserSession ( )
static

Resume an existing user session.

Definition at line 1392 of file class.ilInitialisation.php.

1392 : void
1393 {
1394 global $DIC;
1395
1398 }
1399
1400 if (
1401 !$DIC['ilAuthSession']->isAuthenticated() ||
1402 $DIC['ilAuthSession']->isExpired()
1403 ) {
1404 if ($GLOBALS['DIC']['ilAuthSession']->isExpired()) {
1406 }
1407
1408 ilLoggerFactory::getLogger('init')->debug('Current session is invalid: ' . $GLOBALS['DIC']['ilAuthSession']->getId());
1409 $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
1410 if (self::blockedAuthentication($current_script)) {
1411 ilLoggerFactory::getLogger('init')->debug('Authentication is started in current script.');
1412 // nothing todo: authentication is done in current script
1413 return;
1414 }
1415
1417 return;
1418 }
1419 // valid session
1420
1422 }
static isAuthenticationForced()
static handleForcedAuthentication()
static _destroy($a_session_id, ?int $a_closing_context=null, $a_expired_at=null)
Destroy session.

References $_COOKIE, $_SERVER, $DIC, $GLOBALS, ilSession\_destroy(), ILIAS\Survey\Mode\getId(), ilLoggerFactory\getLogger(), ilAuthUtils\handleForcedAuthentication(), ilAuthUtils\isAuthenticationForced(), and ilSession\SESSION_CLOSE_EXPIRE.

+ Here is the call graph for this function:

◆ setClientIdCookie()

static ilInitialisation::setClientIdCookie ( )
staticprivate

Definition at line 677 of file class.ilInitialisation.php.

677 : void
678 {
679 if (defined('CLIENT_ID') &&
680 !defined('IL_PHPUNIT_TEST') &&
682 ilUtil::setCookie('ilClientId', CLIENT_ID);
683 }
684 }

References CLIENT_ID, ilUtil\setCookie(), and ilContext\supportsPersistentSessions().

+ Here is the call graph for this function:

◆ setCookieConstants()

static ilInitialisation::setCookieConstants ( )
staticprotected

Definition at line 646 of file class.ilInitialisation.php.

646 : void
647 {
649 $cookie_path = '/';
650 } elseif (isset($GLOBALS['COOKIE_PATH'])) {
651 // use a predefined cookie path from WebAccessChecker
652 $cookie_path = $GLOBALS['COOKIE_PATH'];
653 } else {
654 $cookie_path = dirname($_SERVER['SCRIPT_NAME']);
655 }
656
657 /* if ilias is called directly within the docroot $cookie_path
658 is set to '/' expecting on servers running under windows..
659 here it is set to '\'.
660 in both cases a further '/' won't be appended due to the following regex
661 */
662 $cookie_path .= (!preg_match("/[\/|\\\\]$/", $cookie_path)) ? "/" : "";
663
664 if ($cookie_path == "\\") {
665 $cookie_path = '/';
666 }
667
668 define('IL_COOKIE_HTTPONLY', true); // Default Value
669 define('IL_COOKIE_EXPIRE', 0);
670 define('IL_COOKIE_DOMAIN', '');
671 if (!defined('IL_COOKIE_PATH')) {
672 // Might be already defined by ./public/sso/index.php or other scripts (like those in ./components/ILIAS/SAML/lib/*)
673 define('IL_COOKIE_PATH', $cookie_path);
674 }
675 }
$cookie_path
Definition: index.php:29
const int CONTEXT_HTTP
HTTP Auth used for WebDAV and CalDAV If a special handling for WebDAV or CalDAV is required overwrite...

References $_SERVER, $cookie_path, $GLOBALS, ilAuthFactory\CONTEXT_HTTP, and ilAuthFactory\getContext().

+ Here is the call graph for this function:

◆ setSessionCookieParams()

static ilInitialisation::setSessionCookieParams ( )
staticprotected

set session cookie params

Definition at line 689 of file class.ilInitialisation.php.

689 : void
690 {
691 global $ilSetting, $DIC;
692
693 if (!defined('IL_COOKIE_SECURE')) {
694 // If this code is executed, we can assume that \ilHTTPS::enableSecureCookies was NOT called before
695 // \ilHTTPS::enableSecureCookies already executes session_set_cookie_params()
696
697 $cookie_secure = !$ilSetting->get('https', '0') && $DIC['https']->isDetected();
698 define('IL_COOKIE_SECURE', $cookie_secure); // Default Value
699
700 $cookie_parameters = [
701 'lifetime' => IL_COOKIE_EXPIRE,
702 'path' => IL_COOKIE_PATH,
703 'domain' => IL_COOKIE_DOMAIN,
704 'secure' => IL_COOKIE_SECURE,
705 'httponly' => IL_COOKIE_HTTPONLY,
706 ];
707
708 if (
709 $cookie_secure &&
710 (!isset(session_get_cookie_params()['samesite']) || strtolower(session_get_cookie_params()['samesite']) !== 'strict')
711 ) {
712 $cookie_parameters['samesite'] = 'Lax';
713 }
714
715 session_set_cookie_params($cookie_parameters);
716 }
717 }
const IL_COOKIE_PATH
Definition: index.php:48

References $DIC, $ilSetting, and IL_COOKIE_PATH.

◆ setSessionHandler()

static ilInitialisation::setSessionHandler ( )
static

set session handler to db Used in Soap

Definition at line 627 of file class.ilInitialisation.php.

627 : void
628 {
629 $db_session_handler = new ilSessionDBHandler();
630 if (!$db_session_handler->setSaveHandler()) {
631 self::abortAndDie("Cannot start session handling.");
632 }
633
634 // Do not accept external session ids
635 if (!ilSession::_exists(session_id()) && !defined('IL_PHPUNIT_TEST')) {
636 // php7-todo, correct-with-php5-removal : alex, 1.3.2016: added if, please check
637 if (function_exists("session_status") && session_status() == PHP_SESSION_ACTIVE) {
638 session_regenerate_id();
639 }
640 }
641 }
static _exists(string $a_session_id)

References ilSession\_exists(), and abortAndDie().

+ Here is the call graph for this function:

◆ translateMessage()

static ilInitialisation::translateMessage ( string  $a_message_id,
?array  $a_message_static = null 
)
staticprotected

Translate message if possible.

Definition at line 1768 of file class.ilInitialisation.php.

1768 : string
1769 {
1770 global $ilDB, $lng, $ilSetting, $ilClientIniFile, $ilUser;
1771
1772 // current language
1773 if (!$lng) {
1774 $lang = "en";
1775 if ($ilUser) {
1776 $lang = $ilUser->getLanguage();
1777 } elseif (isset($_REQUEST["lang"])) {
1778 $lang = (string) $_REQUEST["lang"];
1779 } elseif ($ilSetting) {
1780 $lang = $ilSetting->get("language", '');
1781 } elseif ($ilClientIniFile) {
1782 $lang = $ilClientIniFile->readVariable("language", "default");
1783 }
1784 } else {
1785 $lang = $lng->getLangKey();
1786 }
1787
1788 $message = "";
1789 if ($ilDB && $a_message_id) {
1790 if (!$lng) {
1791 $lng = new ilLanguage($lang);
1792 }
1793
1794 $lng->loadLanguageModule("init");
1795 $message = $lng->txt($a_message_id);
1796 } elseif (is_array($a_message_static)) {
1797 if (!isset($a_message_static[$lang])) {
1798 $lang = "en";
1799 }
1800 $message = $a_message_static[$lang];
1801 }
1802 return $message;
1803 }
language handling
global $lng
Definition: privfeed.php:31

References $ilDB, $ilSetting, and $lng.

Referenced by handleMaintenanceMode().

+ Here is the caller graph for this function:

Field Documentation

◆ $already_initialized

bool ilInitialisation::$already_initialized = false
staticprotected

Definition at line 1128 of file class.ilInitialisation.php.


The documentation for this class was generated from the following file: