ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 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 53 of file class.ilInitialisation.php.

Member Function Documentation

◆ abortAndDie()

static ilInitialisation::abortAndDie ( string  $a_message)
staticprotected

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

1104 : void
1105 {
1106 if (isset($GLOBALS['ilLog'])) {
1107 $GLOBALS['ilLog']->write("Fatal Error: ilInitialisation - " . $a_message);
1108 $GLOBALS['ilLog']->logStack();
1109 }
1110 die($a_message);
1111 }
$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 1502 of file class.ilInitialisation.php.

1502 : void
1503 {
1504 $component_repository = $c["component.repository"];
1505 $component_factory = $c["component.factory"];
1506 foreach ($component_repository->getPlugins() as $pl) {
1507 if (!$pl->isActive()) {
1508 continue;
1509 }
1510 $plugin = $component_factory->getPlugin($pl->getId());
1511 $c['ui.renderer'] = $plugin->exchangeUIRendererAfterInitialization($c);
1512
1513 foreach ($c->keys() as $key) {
1514 if (strpos($key, "ui.factory") === 0) {
1515 $c[$key] = $plugin->exchangeUIFactoryAfterInitialization($key, $c);
1516 }
1517 }
1518 }
1519 }
$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 1631 of file class.ilInitialisation.php.

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

360 : bool
361 {
362 global $DIC;
363
364 return define(
365 'ILIAS_HTTP_PATH',
366 (new \ILIAS\Init\Environment\HttpPathBuilder(
367 $DIC[\ILIAS\Data\Factory::class],
368 $DIC->settings(),
369 $DIC['https'],
370 $DIC['ilIliasIniFile'],
372 ))->build()->getBaseURI()
373 );
374 }
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 380 of file class.ilInitialisation.php.

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

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 446 of file class.ilInitialisation.php.

447 {
448 return new class () implements Transformation {
452 public function transform($from): string
453 {
454 if (!is_string($from)) {
455 throw new InvalidArgumentException(__METHOD__ . " the argument is not a string.");
456 }
457 return strip_tags($from);
458 }
459
463 public function applyTo(Result $result): Result
464 {
465 return $result->then(function ($value): Result {
466 try {
467 return new Ok($this->transform($value));
468 } catch (Exception $exception) {
469 return new Error($exception);
470 }
471 });
472 }
473
477 public function __invoke($from): string
478 {
479 return $this->transform($from);
480 }
481 };
482 }
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 963 of file class.ilInitialisation.php.

963 : void
964 {
965 global $DIC;
966
967 $session_expired = false;
968 ilLoggerFactory::getLogger('init')->debug('Redirecting to login page.');
969
970 if ($DIC['ilAuthSession']->isExpired()) {
972 $session_expired = true;
973 }
974 if (!$DIC['ilAuthSession']->isAuthenticated()) {
976 }
977
978 $target = $DIC->http()->wrapper()->query()->has('target')
979 ? $DIC->http()->wrapper()->query()->retrieve(
980 'target',
981 $DIC->refinery()->kindlyTo()->string()
982 )
983 : '';
984
985 if (strlen($target)) {
986 $target = "target=" . $target . "&";
987 }
988
989 $client_id = $DIC->http()->wrapper()->cookie()->retrieve(
990 'ilClientId',
991 $DIC->refinery()->byTrying([
992 $DIC->refinery()->kindlyTo()->string(),
993 $DIC->refinery()->always('')
994 ])
995 );
996
997 $script = "login.php?" . $target . "client_id=" . $client_id;
998 $script .= $session_expired ? "&session_expired=1" : "";
999
1001 $script,
1002 "init_error_authentication_fail",
1003 array(
1004 "en" => "Authentication failed.",
1005 "de" => "Authentifizierung fehlgeschlagen."
1006 )
1007 );
1008 }
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 909 of file class.ilInitialisation.php.

909 : void
910 {
911 global $DIC;
912
913 if (ANONYMOUS_USER_ID == "") {
914 self::abortAndDie("Public Section enabled, but no Anonymous user found.");
915 }
916
917 $session_destroyed = false;
918 if ($DIC['ilAuthSession']->isExpired()) {
919 $session_destroyed = true;
921 }
922 if (!$DIC['ilAuthSession']->isAuthenticated()) {
923 $session_destroyed = true;
925 }
926
927 if ($session_destroyed) {
928 $GLOBALS['DIC']['ilAuthSession']->setAuthenticated(true, ANONYMOUS_USER_ID);
929 }
930
932
933 $target = '';
934 if ($DIC->http()->wrapper()->query()->has('target')) {
935 $target = $DIC->http()->wrapper()->query()->retrieve(
936 'target',
937 $DIC->refinery()->kindlyTo()->string()
938 );
939 }
940
941 // if target given, try to go there
942 if (strlen($target)) {
943 // when we are already "inside" goto.php no redirect is needed
944 $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
945 if ($current_script == "goto.php") {
946 return;
947 }
948 // goto will check if target is accessible or redirect to login
949 self::redirect("goto.php?target=" . $target);
950 }
951
952 // we do not know if ref_id of request is accesible, so redirecting to root
954 "ilias.php?baseClass=ilrepositorygui&reloadpublic=1&cmd=&ref_id=" . (defined(
955 'ROOT_FOLDER_ID'
956 ) ? (string) ROOT_FOLDER_ID : '0')
957 );
958 }
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 1430 of file class.ilInitialisation.php.

1430 : void
1431 {
1432 global $DIC;
1433
1434 ilLoggerFactory::getLogger('init')->debug('Handling of failed authentication.');
1435
1436 // #10608
1437 if (
1440 throw new Exception("Authentication failed.");
1441 }
1442
1443 if (($DIC->http()->request()->getQueryParams()['cmdMode'] ?? 0) === 'asynch') {
1444 $DIC->language()->loadLanguageModule('init');
1445 $DIC->http()->saveResponse(
1446 $DIC->http()->response()
1447 ->withStatus(403)
1448 ->withBody(Streams::ofString($DIC->language()->txt('init_error_authentication_fail')))
1449 );
1450 $DIC->http()->sendResponse();
1451 $DIC->http()->close();
1452 }
1453 if (
1454 $DIC['ilAuthSession']->isExpired() &&
1455 !\ilObjUser::_isAnonymous($DIC['ilAuthSession']->getUserId())
1456 ) {
1457 ilLoggerFactory::getLogger('init')->debug('Expired session found -> redirect to login page');
1459 return;
1460 }
1461 if (ilPublicSectionSettings::getInstance()->isEnabledForDomain($_SERVER['SERVER_NAME']) &&
1462 $DIC->access()->checkAccessOfUser(ANONYMOUS_USER_ID, 'read', '', ROOT_FOLDER_ID)) {
1463 ilLoggerFactory::getLogger('init')->debug('Redirect to public section.');
1465 return;
1466 }
1467 ilLoggerFactory::getLogger('init')->debug('Redirect to login page.');
1469 }
const CONTEXT_SOAP
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 1116 of file class.ilInitialisation.php.

1116 : void
1117 {
1118 error_reporting(-1);
1119 }

◆ handleErrorReporting()

static ilInitialisation::handleErrorReporting ( )
static

Set error reporting level.

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

1212 : void
1213 {
1214 // push the error level as high as possible / sane
1215 error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
1216
1217 // see handleDevMode() - error reporting might be overwritten again
1218 // but we need the client ini first
1219 }

Referenced by ilWebAccessCheckerDelivery\handleRequest().

+ Here is the caller graph for this function:

◆ handleMaintenanceMode()

static ilInitialisation::handleMaintenanceMode ( )
staticprotected

handle maintenance mode

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

574 : void
575 {
576 global $ilClientIniFile;
577
578 if (!$ilClientIniFile->readVariable("client", "access")) {
579 $mess = array(
580 "en" => "The server is not available due to maintenance." .
581 " We apologise for any inconvenience.",
582 "de" => "Der Server ist aufgrund von Wartungsarbeiten aktuell nicht verfügbar." .
583 " Wir bitten um Verständnis. Versuchen Sie es später noch einmal."
584 );
585 $mess_id = "init_error_maintenance";
586
587 if (ilContext::hasHTML() && is_file("./maintenance.html")) {
588 self::redirect("./maintenance.html", $mess_id, $mess);
589 } else {
590 $mess = self::translateMessage($mess_id, $mess);
591 self::abortAndDie($mess);
592 }
593 }
594 }
static hasHTML()
Has HTML output.
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 1038 of file class.ilInitialisation.php.

1038 : void
1039 {
1041 "rbacreview",
1042 "ilRbacReview",
1043 "./components/ILIAS/AccessControl/classes/class.ilRbacReview.php",
1044 true
1045 );
1046
1047 $rbacsystem = ilRbacSystem::getInstance();
1048 self::initGlobal('rbacsystem', $rbacsystem, null, true);
1049
1051 "rbacadmin",
1052 "ilRbacAdmin",
1053 "./components/ILIAS/AccessControl/classes/class.ilRbacAdmin.php",
1054 true
1055 );
1056
1058 "ilAccess",
1059 "ilAccess",
1060 "./components/ILIAS/AccessControl/classes/class.ilAccess.php",
1061 true
1062 );
1063 }
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 766 of file class.ilInitialisation.php.

766 : void
767 {
768 $c['acc.criteria.type.factory'] = function (\ILIAS\DI\Container $c) {
769 return new ilAccessibilityCriterionTypeFactory($c->rbac()->review(), $c['ilObjDataCache']);
770 };
771
772 $c['acc.document.evaluator'] = function (\ILIAS\DI\Container $c) {
775 $c['acc.criteria.type.factory'],
776 $c->user(),
777 $c->logger()->acc()
778 ),
779 $c->user(),
780 $c->logger()->acc(),
781 \ilAccessibilityDocument::orderBy('sorting')->get()
782 );
783 };
784 }
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 754 of file class.ilInitialisation.php.

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

References $c.

◆ initBackgroundTasks()

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

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

1884 : void
1885 {
1886 global $ilIliasIniFile;
1887
1888 $n_of_tasks = $ilIliasIniFile->readVariable("background_tasks", "number_of_concurrent_tasks");
1889 $sync = $ilIliasIniFile->readVariable("background_tasks", "concurrency");
1890
1891 $n_of_tasks = $n_of_tasks ?: 5;
1892 $sync = $sync ?: 'sync'; // The default value is sync.
1893
1894 $c["bt.task_factory"] = function ($c) {
1895 return new \ILIAS\BackgroundTasks\Implementation\Tasks\BasicTaskFactory($c["di.injector"]);
1896 };
1897
1898 $c["bt.persistence"] = function ($c) {
1899 return \ILIAS\BackgroundTasks\Implementation\Persistence\BasicPersistence::instance($c->database());
1900 };
1901
1902 $c["bt.injector"] = function ($c) {
1903 return new \ILIAS\BackgroundTasks\Dependencies\Injector($c, new BaseDependencyMap());
1904 };
1905
1906 $c["bt.task_manager"] = function ($c) use ($sync) {
1907 if ($sync == 'sync') {
1908 return new \ILIAS\BackgroundTasks\Implementation\TaskManager\SyncTaskManager($c["bt.persistence"]);
1909 } elseif ($sync == 'async') {
1910 return new \ILIAS\BackgroundTasks\Implementation\TaskManager\AsyncTaskManager($c["bt.persistence"]);
1911 } else {
1912 throw new ilException("The supported Background Task Managers are sync and async. $sync given.");
1913 }
1914 };
1915 }
Base class for ILIAS Exception handling.
$ilIliasIniFile
Definition: server.php:37

References $c, and $ilIliasIniFile.

◆ initClient()

static ilInitialisation::initClient ( )
staticprotected

Init client-based objects (level 1)

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

1253 : void
1254 {
1255 global $https, $ilias, $DIC;
1256
1258
1260
1261 self::bootstrapFilesystems();
1262
1264
1266
1267 // --- needs client ini
1268
1269 $ilias->client_id = (string) CLIENT_ID;
1270
1271 if (DEVMODE) {
1273 }
1274
1276
1278
1280
1282
1283 // init dafault language
1284 self::initLanguage(false);
1285
1286 // moved after databases
1287 self::initLog();
1288
1290 "ilAppEventHandler",
1291 "ilAppEventHandler",
1292 "./components/ILIAS/EventHandling/classes/class.ilAppEventHandler.php"
1293 );
1294
1295 // there are rare cases where initILIAS is called twice for a request
1296 // example goto.php is called and includes ilias.php later
1297 // we must prevent that ilPluginAdmin is initialized twice in
1298 // this case, since this won't get the values out of plugin.php the
1299 // second time properly
1300 if (!isset($DIC["ilPluginAdmin"]) || !$DIC["ilPluginAdmin"] instanceof ilPluginAdmin) {
1302 "ilPluginAdmin",
1303 new ilPluginAdmin($DIC["component.repository"]),
1304 "./components/ILIAS/Component/classes/class.ilPluginAdmin.php"
1305 );
1306 }
1307 self::initGlobal("https", "ilHTTPS", "./components/ILIAS/Http/classes/class.ilHTTPS.php");
1310 self::initCron($GLOBALS['DIC']);
1311 self::initAvatar($GLOBALS['DIC']);
1316
1317 // --- needs settings
1318
1320
1321 if (ilContext::usesHTTP()) {
1322 $https->enableSecureCookies();
1323 $https->checkProtocolAndRedirectIfNeeded();
1324 }
1325
1326 // --- object handling
1327
1329 "ilObjDataCache",
1330 "ilObjectDataCache",
1331 "./components/ILIAS/Object/classes/class.ilObjectDataCache.php"
1332 );
1333
1335 "objDefinition",
1336 "ilObjectDefinition",
1337 "./components/ILIAS/Object/classes/class.ilObjectDefinition.php"
1338 );
1339
1340 // $tree
1341 $tree = new ilTree(ROOT_FOLDER_ID);
1342 self::initGlobal("tree", $tree);
1343 unset($tree);
1344
1347
1348 (new InitCtrlService())->init($DIC);
1349
1350 // Init GlobalScreen
1352 }
Class InitCtrlService wraps the initialization of ilCtrl.
static usesHTTP()
Uses HTTP aka browser.
static initDatabase()
initialise database object $ilDB
static initLocale()
Init Locale.
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 493 of file class.ilInitialisation.php.

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

1544 : void
1545 {
1546 $init = new InitComponentService();
1547 $init->init($container);
1548 }
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 1224 of file class.ilInitialisation.php.

1224 : void
1225 {
1226 global $ilErr;
1227
1229
1231 $GLOBALS["DIC"]["ilias.version"] = $GLOBALS["DIC"][\ILIAS\Data\Factory::class]->version(ILIAS_VERSION_NUMERIC);
1232
1233 // error handler
1235 "ilErr",
1236 "ilErrorHandling",
1237 "./components/ILIAS/Init/classes/class.ilErrorHandling.php"
1238 );
1239
1241
1243
1244 define('IL_INITIAL_WD', getcwd());
1245
1246 // deprecated
1247 self::initGlobal("ilias", "ILIAS", "./components/ILIAS/Init/classes/class.ilias.php");
1248 }
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 717 of file class.ilInitialisation.php.

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

References $c.

◆ initCustomObjectIcons()

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

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

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

References $c.

◆ initDatabase()

static ilInitialisation::initDatabase ( )
staticprotected

initialise database object $ilDB

Reimplemented in XapiProxy\ilInitialisation.

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

599 : void
600 {
601 // build dsn of database connection and connect
603 $ilDB->initFromIniFile();
604 $ilDB->connect();
605
606 self::initGlobal("ilDB", $ilDB);
607 }
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 310 of file class.ilInitialisation.php.

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

1085 : void {
1086 global $DIC;
1087
1088 if ($destroy_existing) {
1089 if (isset($GLOBALS[$a_name])) {
1090 unset($GLOBALS[$a_name]);
1091 }
1092 if (isset($DIC[$a_name])) {
1093 unset($DIC[$a_name]);
1094 }
1095 }
1096
1097 $GLOBALS[$a_name] = is_object($a_class) ? $a_class : new $a_class();
1098
1099 $DIC[$a_name] = static function (Container $c) use ($a_name) {
1100 return $GLOBALS[$a_name];
1101 };
1102 }

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 609 of file class.ilInitialisation.php.

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

References $DIC.

◆ initGlobalScreen()

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

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

1485 : void
1486 {
1487 $c['global_screen'] = function () use ($c) {
1488 return new Services(
1490 $c->ui(),
1491 htmlentities(str_replace([" ", ".", "-"], "_", ILIAS_VERSION_NUMERIC))
1492 );
1493 };
1494 $c->globalScreen()->tool()->context()->stack()->clear();
1495 $c->globalScreen()->tool()->context()->claim()->main();
1496 }

References $c, and ILIAS_VERSION_NUMERIC.

◆ initHTML()

static ilInitialisation::initHTML ( )
staticprotected

init HTML output (level 3)

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

1553 : void
1554 {
1555 global $ilUser, $DIC;
1556
1557 if (ilContext::hasUser()) {
1558 // load style definitions
1559 // use the init function with plugin hook here, too
1561
1563 }
1564
1566 $tpl = new ilGlobalPageTemplate($DIC->globalScreen(), $DIC->ui(), $DIC->http());
1567 self::initGlobal("tpl", $tpl);
1568
1569 if (ilContext::hasUser()) {
1570 $dispatcher = new \ILIAS\Init\StartupSequence\StartUpSequenceDispatcher($DIC);
1571 $dispatcher->dispatch();
1572 }
1573
1575 "ilNavigationHistory",
1576 "ilNavigationHistory",
1577 "components/ILIAS/Navigation/classes/class.ilNavigationHistory.php"
1578 );
1579
1581 "ilHelp",
1582 "ilHelpGUI",
1583 "components/ILIAS/Help/classes/class.ilHelpGUI.php"
1584 );
1585
1586 if (DEVMODE) {
1587 $DIC["help.text_retriever"] = new ILIAS\UI\Help\TextRetriever\Echoing();
1588 } else {
1589 $DIC["help.text_retriever"] = new ilHelpUITextRetriever();
1590 }
1591
1593 "ilToolbar",
1594 "ilToolbarGUI",
1595 "./components/ILIAS/UIComponent/Toolbar/classes/class.ilToolbarGUI.php"
1596 );
1597
1599 "ilLocator",
1600 "ilLocatorGUI",
1601 "./components/ILIAS/Locator/classes/class.ilLocatorGUI.php"
1602 );
1603
1605 "ilTabs",
1606 "ilTabsGUI",
1607 "./components/ILIAS/UIComponent/Tabs/classes/class.ilTabsGUI.php"
1608 );
1609
1610 if (ilContext::hasUser()) {
1611 // the next line makes it impossible to save the offset somehow in a session for
1612 // a specific table (I tried it for the user administration).
1613 // its not posssible to distinguish whether it has been set to page 1 (=offset = 0)
1614 // or not set at all (then we want the last offset, e.g. being used from a session var).
1615 // So I added the wrapping if statement. Seems to work (hopefully).
1616 // Alex April 14th 2006
1617 // @todo not replaced by refinery due to unknown sideeffects
1618 if (isset($_GET['offset']) && $_GET['offset'] != "") {
1619 $_GET['offset'] = (int) $_GET['offset']; // old code
1620 }
1621
1622 self::initGlobal("lti", "ilLTIViewGUI", "./components/ILIAS/LTIProvider/classes/class.ilLTIViewGUI.php");
1623 $GLOBALS["DIC"]["lti"]->init();
1625 }
1626 }
This HelpTextRetriever simply echo the purpose and the topics for debugging and development purpose.
Definition: Echoing.php:31
static hasUser()
Based on user authentication?
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 1474 of file class.ilInitialisation.php.

1474 : void
1475 {
1476 $init_http = new InitHttpServices();
1477 $init_http->init($container);
1478
1480 }
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 1144 of file class.ilInitialisation.php.

1144 : void
1145 {
1146 if (self::$already_initialized) {
1147 return;
1148 }
1149
1150 $GLOBALS["DIC"]["ilLoggerFactory"] = function ($c) {
1152 };
1153
1154 self::$already_initialized = true;
1155
1158 if (ilContext::initClient()) {
1160 Init::init($GLOBALS["DIC"]);
1163
1164 if (ilContext::hasUser()) {
1166
1169 }
1170 }
1171
1172 // language may depend on user setting
1173 self::initLanguage(true);
1174 $GLOBALS['DIC']['tree']->initLangCode();
1175
1179
1180 if (ilContext::hasHTML()) {
1182 }
1183 }
1184
1185 // this MUST happen after everything else is initialized,
1186 // because this leads to rather unexpected behaviour which
1187 // is super hard to track down to this.
1188 self::replaceSuperGlobals($GLOBALS['DIC']);
1189 }
static initClient()
Init client.
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\Cron\CLI\StartUp\__construct(), ILIAS\Init\AllModernComponents\enter(), ilSoapAdministration\getClientInfoXML(), ilSoapAdministration\getInstallationInfoXML(), ilSoapSCORMAdministration\getSCORMCompletionStatus(), ilNusoapUserAdministrationAdapter\handleSoapPlugins(), ilCalendarRemoteAccessHandler\initIlias(), ilWebAccessChecker\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 106 of file class.ilInitialisation.php.

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

1917 : void
1918 {
1919 $c["di.dependency_map"] = function ($c) {
1920 return new \ILIAS\BackgroundTasks\Dependencies\DependencyMap\BaseDependencyMap();
1921 };
1922
1923 $c["di.injector"] = function ($c) {
1924 return new \ILIAS\BackgroundTasks\Dependencies\Injector($c, $c["di.dependency_map"]);
1925 };
1926 }

References $c.

◆ initKioskMode()

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

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

1928 : void
1929 {
1930 $c["service.kiosk_mode"] = function ($c) {
1931 return new ilKioskModeService(
1932 $c['ilCtrl'],
1933 $c['lng'],
1934 $c['ilAccess'],
1935 $c['objDefinition']
1936 );
1937 };
1938 }
Central entry point for users of the service.

References $c.

◆ initLearningObjectMetadata()

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

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

1940 : void
1941 {
1942 $c['learning_object_metadata'] = function ($c) {
1943 return new \ILIAS\MetaData\Services\Services($c);
1944 };
1945 }

References $c.

◆ initLegalDocuments()

static ilInitialisation::initLegalDocuments ( Container  $c)
staticprotected

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

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

References $c.

◆ initLocale()

static ilInitialisation::initLocale ( )
staticprotected

Init Locale.

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

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

References $ilSetting.

◆ initLog()

static ilInitialisation::initLog ( )
staticprotected

Init log instance.

Reimplemented in XapiProxy\ilInitialisation.

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

1068 : void
1069 {
1071
1072 self::initGlobal("ilLog", $log);
1073 // deprecated
1074 self::initGlobal("log", $log);
1075 }
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:

◆ initResourceStorage()

static ilInitialisation::initResourceStorage ( )
staticprotected

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

196 : void
197 {
198 global $DIC;
199 (new InitResourceStorage())->init($DIC);
200 }
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 1194 of file class.ilInitialisation.php.

1194 : void
1195 {
1196 if (isset($GLOBALS['DIC']['ilAuthSession'])) {
1197 unset($GLOBALS['DIC']['ilAuthSession']);
1198 }
1199
1200 $GLOBALS['DIC']['ilAuthSession'] = static function (Container $c): ilAuthSession {
1201 $auth_session = ilAuthSession::getInstance(
1202 $c['ilLoggerFactory']->getLogger('auth')
1203 );
1204 $auth_session->init();
1205 return $auth_session;
1206 };
1207 }
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 790 of file class.ilInitialisation.php.

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

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 830 of file class.ilInitialisation.php.

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

References $DIC, and initGlobal().

+ Here is the call graph for this function:

◆ initUploadPolicies()

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

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

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

References $dic.

◆ initUser()

static ilInitialisation::initUser ( )
staticprotected

Init user / authentification (level 2)

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

1357 : void
1358 {
1359 global $ilias, $ilUser;
1360
1361 // $ilUser
1363 "ilUser",
1365 "./components/ILIAS/User/classes/class.ilObjUser.php",
1366 true
1367 );
1368
1370 'user',
1371 new UserPublicInterface($ilUser)
1372 );
1373
1374 $ilias->account = $ilUser;
1375
1377 }
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 852 of file class.ilInitialisation.php.

852 : void
853 {
854 global $DIC;
855
856 static $context_init;
857
858 $uid = $GLOBALS['DIC']['ilAuthSession']->getUserId();
859 if ($uid) {
860 $DIC->user()->setId($uid);
861 $DIC->user()->read();
862 if (!isset($context_init)) {
863 if ($DIC->user()->isAnonymous()) {
864 $DIC->globalScreen()->tool()->context()->claim()->external();
865 } else {
866 $DIC->globalScreen()->tool()->context()->claim()->internal();
867 }
868 $context_init = true;
869 }
870 // init console log handler
871 ilLoggerFactory::getInstance()->initUser($DIC->user()->getLogin());
873 } else {
874 if (is_object($GLOBALS['ilLog'])) {
875 $GLOBALS['ilLog']->logStack();
876 }
877 self::abortAndDie("Init user account failed");
878 }
879 }
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 71 of file class.ilInitialisation.php.

72 {
73 if (is_array($var)) {
74 $mod = [];
75 foreach ($var as $k => $v) {
78 }
79 return $mod;
80 }
81 return strip_tags(
82 str_replace(
83 array("\x00", "\n", "\r", "\\", "'", '"', "\x1a"),
84 "",
85 $var
86 )
87 );
88 }
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 1796 of file class.ilInitialisation.php.

1800 : void {
1801 // #12739
1802 if (defined("ILIAS_HTTP_PATH") &&
1803 !stristr($a_target, ILIAS_HTTP_PATH)) {
1804 $a_target = ILIAS_HTTP_PATH . "/" . $a_target;
1805 }
1806
1807 foreach (['ext_uid', 'soap_pw'] as $param) {
1808 if (false === strpos(
1809 $a_target,
1810 $param . '='
1811 ) && isset($GLOBALS['DIC']->http()->request()->getQueryParams()[$param])) {
1812 $a_target = \ilUtil::appendUrlParameterString($a_target, $param . '=' . \ilUtil::stripSlashes(
1813 $GLOBALS['DIC']->http()->request()->getQueryParams()[$param]
1814 ));
1815 }
1816 }
1817
1819 ilUtil::redirect($a_target);
1820 } else {
1821 $message = self::translateMessage($a_message_id, $a_message_static);
1822
1823 // user-directed linked message
1825 $link = self::translateMessage(
1826 "init_error_redirect_click",
1827 array("en" => 'Please click to continue.',
1828 "de" => 'Bitte klicken um fortzufahren.'
1829 )
1830 );
1831 $mess = $message .
1832 '<br /><a href="' . $a_target . '">' . $link . '</a>';
1833 } // plain text
1834 else {
1835 // not much we can do here
1836 $mess = $message;
1837
1838 if (!trim($mess)) {
1839 $mess = self::translateMessage(
1840 "init_error_redirect_info",
1841 array("en" => 'Redirect not supported by context.',
1842 "de" => 'Weiterleitungen werden durch Kontext nicht unterstützt.'
1843 )
1844 ) .
1845 ' (' . $a_target . ')';
1846 }
1847 }
1848
1849 self::abortAndDie($mess);
1850 }
1851 }
static supportsRedirects()
Are redirects supported?
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.
$message
Definition: xapiexit.php:31
$param
Definition: xapitoken.php:46

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 1853 of file class.ilInitialisation.php.

1853 : void
1854 {
1855 global $DIC;
1856
1857 // fallback, should never happen
1858 if ($DIC->user()->getId() === ANONYMOUS_USER_ID) {
1860 return;
1861 }
1862
1863 if (
1864 $target === '' &&
1865 $DIC->http()->wrapper()->query()->has('target')
1866 ) {
1867 $target = $DIC->http()->wrapper()->query()->retrieve(
1868 'target',
1869 $DIC->refinery()->kindlyTo()->string()
1870 );
1871 }
1872
1873 // for password change and incomplete profile
1874 // see ilDashboardGUI
1875 if ($target === '') {
1876 ilLoggerFactory::getLogger('init')->debug('Redirect to default starting page');
1877 $DIC->ctrl()->redirectToURL(ilUserUtil::getStartingPointAsUrl());
1878 } else {
1879 ilLoggerFactory::getLogger('init')->debug('Redirect to target: ' . $target);
1880 $DIC->ctrl()->redirectToURL("goto.php?target=" . $target);
1881 }
1882 }
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 1123 of file class.ilInitialisation.php.

1123 : void
1124 {
1125 self::$already_initialized = false;
1127 }
static initILIAS()
ilias initialisation

Referenced by ilSoapAdministration\initIlias().

+ Here is the caller graph for this function:

◆ reInitUser()

static ilInitialisation::reInitUser ( )
static

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

1129 : void
1130 {
1134
1137 }
1138 }
1139 }

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 58 of file class.ilInitialisation.php.

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

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 93 of file class.ilInitialisation.php.

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

References initGlobal().

+ Here is the call graph for this function:

◆ resumeUserSession()

static ilInitialisation::resumeUserSession ( )
static

Resume an existing user session.

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

1382 : void
1383 {
1384 global $DIC;
1385
1388 }
1389
1390 if (
1391 !$DIC['ilAuthSession']->isAuthenticated() ||
1392 $DIC['ilAuthSession']->isExpired()
1393 ) {
1394 if ($GLOBALS['DIC']['ilAuthSession']->isExpired()) {
1396 }
1397
1398 ilLoggerFactory::getLogger('init')->debug('Current session is invalid: ' . $GLOBALS['DIC']['ilAuthSession']->getId());
1399 $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
1400 if (self::blockedAuthentication($current_script)) {
1401 ilLoggerFactory::getLogger('init')->debug('Authentication is started in current script.');
1402 // nothing todo: authentication is done in current script
1403 return;
1404 }
1405
1407 return;
1408 }
1409 // valid session
1410
1412 }
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 675 of file class.ilInitialisation.php.

675 : void
676 {
677 if (defined('CLIENT_ID') &&
678 !defined('IL_PHPUNIT_TEST') &&
680 ilUtil::setCookie('ilClientId', CLIENT_ID);
681 }
682 }

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

+ Here is the call graph for this function:

◆ setCookieConstants()

static ilInitialisation::setCookieConstants ( )
staticprotected

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

644 : void
645 {
647 $cookie_path = '/';
648 } elseif (isset($GLOBALS['COOKIE_PATH'])) {
649 // use a predefined cookie path from WebAccessChecker
650 $cookie_path = $GLOBALS['COOKIE_PATH'];
651 } else {
652 $cookie_path = dirname($_SERVER['SCRIPT_NAME']);
653 }
654
655 /* if ilias is called directly within the docroot $cookie_path
656 is set to '/' expecting on servers running under windows..
657 here it is set to '\'.
658 in both cases a further '/' won't be appended due to the following regex
659 */
660 $cookie_path .= (!preg_match("/[\/|\\\\]$/", $cookie_path)) ? "/" : "";
661
662 if ($cookie_path == "\\") {
663 $cookie_path = '/';
664 }
665
666 define('IL_COOKIE_HTTPONLY', true); // Default Value
667 define('IL_COOKIE_EXPIRE', 0);
668 define('IL_COOKIE_DOMAIN', '');
669 if (!defined('IL_COOKIE_PATH')) {
670 // Might be already defined by ./public/sso/index.php or other scripts (like those in ./components/ILIAS/SAML/lib/*)
671 define('IL_COOKIE_PATH', $cookie_path);
672 }
673 }
$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 687 of file class.ilInitialisation.php.

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

References $DIC, $ilSetting, and IL_COOKIE_PATH.

◆ setSessionHandler()

static ilInitialisation::setSessionHandler ( )
static

set session handler to db Used in Soap

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

625 : void
626 {
627 $db_session_handler = new ilSessionDBHandler();
628 if (!$db_session_handler->setSaveHandler()) {
629 self::abortAndDie("Cannot start session handling.");
630 }
631
632 // Do not accept external session ids
633 if (!ilSession::_exists(session_id()) && !defined('IL_PHPUNIT_TEST')) {
634 // php7-todo, correct-with-php5-removal : alex, 1.3.2016: added if, please check
635 if (function_exists("session_status") && session_status() == PHP_SESSION_ACTIVE) {
636 session_regenerate_id();
637 }
638 }
639 }
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 1756 of file class.ilInitialisation.php.

1756 : string
1757 {
1758 global $ilDB, $lng, $ilSetting, $ilClientIniFile, $ilUser;
1759
1760 // current language
1761 if (!$lng) {
1762 $lang = "en";
1763 if ($ilUser) {
1764 $lang = $ilUser->getLanguage();
1765 } elseif (isset($_REQUEST["lang"])) {
1766 $lang = (string) $_REQUEST["lang"];
1767 } elseif ($ilSetting) {
1768 $lang = $ilSetting->get("language", '');
1769 } elseif ($ilClientIniFile) {
1770 $lang = $ilClientIniFile->readVariable("language", "default");
1771 }
1772 } else {
1773 $lang = $lng->getLangKey();
1774 }
1775
1776 $message = "";
1777 if ($ilDB && $a_message_id) {
1778 if (!$lng) {
1779 $lng = new ilLanguage($lang);
1780 }
1781
1782 $lng->loadLanguageModule("init");
1783 $message = $lng->txt($a_message_id);
1784 } elseif (is_array($a_message_static)) {
1785 if (!isset($a_message_static[$lang])) {
1786 $lang = "en";
1787 }
1788 $message = $a_message_static[$lang];
1789 }
1790 return $message;
1791 }
language handling
global $lng
Definition: privfeed.php:31
$lang
Definition: xapiexit.php:25

References $ilDB, $ilSetting, $lang, $lng, and $message.

Referenced by handleMaintenanceMode().

+ Here is the caller graph for this function:

Field Documentation

◆ $already_initialized

bool ilInitialisation::$already_initialized = false
staticprotected

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


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