ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
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 1504 of file class.ilInitialisation.php.

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

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

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

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

1548 : void
1549 {
1550 $init = new InitComponentService();
1551 $init->init($container);
1552 }
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 1487 of file class.ilInitialisation.php.

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

References $c, and ILIAS_VERSION_NUMERIC.

◆ initHTML()

static ilInitialisation::initHTML ( )
staticprotected

init HTML output (level 3)

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

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

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

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

References $c.

◆ initKioskMode()

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

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

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

References $c.

◆ initLearningObjectMetadata()

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

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

1944 : void
1945 {
1946 $c['learning_object_metadata'] = function ($c) {
1947 return new \ILIAS\MetaData\Services\Services($c);
1948 };
1949 }

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 null,
1373 true
1374 );
1375
1376 $ilias->account = $ilUser;
1377
1379 }
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 1800 of file class.ilInitialisation.php.

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

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

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

1760 : string
1761 {
1762 global $ilDB, $lng, $ilSetting, $ilClientIniFile, $ilUser;
1763
1764 // current language
1765 if (!$lng) {
1766 $lang = "en";
1767 if ($ilUser) {
1768 $lang = $ilUser->getLanguage();
1769 } elseif (isset($_REQUEST["lang"])) {
1770 $lang = (string) $_REQUEST["lang"];
1771 } elseif ($ilSetting) {
1772 $lang = $ilSetting->get("language", '');
1773 } elseif ($ilClientIniFile) {
1774 $lang = $ilClientIniFile->readVariable("language", "default");
1775 }
1776 } else {
1777 $lang = $lng->getLangKey();
1778 }
1779
1780 $message = "";
1781 if ($ilDB && $a_message_id) {
1782 if (!$lng) {
1783 $lng = new ilLanguage($lang);
1784 }
1785
1786 $lng->loadLanguageModule("init");
1787 $message = $lng->txt($a_message_id);
1788 } elseif (is_array($a_message_static)) {
1789 if (!isset($a_message_static[$lang])) {
1790 $lang = "en";
1791 }
1792 $message = $a_message_static[$lang];
1793 }
1794 return $message;
1795 }
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 1121 of file class.ilInitialisation.php.


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