ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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...

+ 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 More...
 
static goToPublicSection ()
 go to public section More...
 
static reinitILIAS ()
 
static initILIAS ()
 ilias initialisation More...
 
static handleErrorReporting ()
 Set error reporting level. More...
 
static resumeUserSession ()
 Resume an existing user session. More...
 
static authenticate ()
 Try authentication. More...
 

Static Protected Member Functions

static removeUnsafeCharacters ()
 Remove unsafe characters from GET. More...
 
static recursivelyRemoveUnsafeCharacters ($var)
 
static requireCommonIncludes ()
 get common include code files More...
 
static includePhp5Compliance ()
 This is a hack for authentication. More...
 
static initIliasIniFile ()
 This method provides a global instance of class ilIniFile for the ilias.ini.php file in variable $ilIliasIniFile. More...
 
static buildHTTPPath ()
 builds http path More...
 
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 setCookieConstants ()
 
static setSessionCookieParams ()
 set session cookie params More...
 
static initMail (\ILIAS\DI\Container $c)
 
static initCustomObjectIcons (\ILIAS\DI\Container $c)
 
static initAvatar (\ILIAS\DI\Container $c)
 
static initTermsOfService (\ILIAS\DI\Container $c)
 
static initSettings ()
 initialise $ilSettings object and define constants 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 ($a_name, $a_class, $a_source_file=null)
 Initialize global instance. More...
 
static abortAndDie ($a_message)
 Exit. More...
 
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 initHTTPServices (\ILIAS\DI\Container $container)
 
static initGlobalScreen (\ILIAS\DI\Container $c)
 init the ILIAS UI framework. More...
 
static initUIFramework (\ILIAS\DI\Container $c)
 
static initHTML ()
 init HTML output (level 3) More...
 
static getCurrentCmd ()
 Extract current cmd from request. More...
 
static blockedAuthentication ($a_current_script)
 Block authentication based on current request. More...
 
static showingLoginForm ($a_current_script)
 Is current view the login form? More...
 
static translateMessage ($a_message_id, array $a_message_static=null)
 Translate message if possible. More...
 
static redirect ($a_target, $a_message_id='', array $a_message_static=null)
 Redirects to target url if context supports it. More...
 

Static Protected Attributes

static $already_initialized
 

Static Private Member Functions

static initBackgroundTasks (\ILIAS\DI\Container $c)
 
static initInjector (\ILIAS\DI\Container $c)
 
static initKioskMode (\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 37 of file class.ilInitialisation.php.

Member Function Documentation

◆ abortAndDie()

static ilInitialisation::abortAndDie (   $a_message)
staticprotected

Exit.

Parameters
string$a_message

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

959 {
960 if (is_object($GLOBALS['ilLog'])) {
961 $GLOBALS['ilLog']->write("Fatal Error: ilInitialisation - " . $a_message);
962 }
963 die($a_message);
964 }
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.

References $GLOBALS.

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

+ Here is the caller graph for this function:

◆ authenticate()

static ilInitialisation::authenticate ( )
static

Try authentication.

This will basically validate the current session

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

1286 {
1287 global $ilAuth, $ilias, $ilErr;
1288
1289 $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
1290
1291 if (self::blockedAuthentication($current_script)) {
1292 return;
1293 }
1294
1295 $oldSid = session_id();
1296
1297 $ilAuth->start();
1298 $ilias->setAuthError($ilErr->getLastError());
1299
1300 if ($ilAuth->getAuth() && $ilAuth->getStatus() == '') {
1301 self::initUserAccount();
1302
1303 self::handleAuthenticationSuccess();
1304 } else {
1305 if (!self::showingLoginForm($current_script)) {
1306 // :TODO: should be moved to context?!
1307 $mandatory_auth = ($current_script != "shib_login.php"
1308 && $current_script != "shib_logout.php"
1309 && $current_script != "saml.php"
1310 && $current_script != "error.php"
1311 && $current_script != "chat.php"
1312 && $current_script != "wac.php"
1313 && $current_script != "index.php"); // #10316
1314
1315 if ($mandatory_auth) {
1316 self::handleAuthenticationFail();
1317 }
1318 }
1319 }
1320 }
$ilErr
Definition: raiseError.php:18
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']

References $_SERVER, and $ilErr.

◆ blockedAuthentication()

static ilInitialisation::blockedAuthentication (   $a_current_script)
staticprotected

Block authentication based on current request.

Returns
boolean

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

1708 {
1710 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for WAC request.');
1711 return true;
1712 }
1714 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for sso request.');
1715 return true;
1716 }
1718 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for webdav request');
1719 return true;
1720 }
1722 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for shibboleth request.');
1723 return true;
1724 }
1726 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for lti provider requests.');
1727 return true;
1728 }
1730 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for SAML request.');
1731 return true;
1732 }
1733 if (
1734 $a_current_script == "register.php" ||
1735 $a_current_script == "pwassist.php" ||
1736 $a_current_script == "confirmReg.php" ||
1737 $a_current_script == "il_securimage_play.php" ||
1738 $a_current_script == "il_securimage_show.php" ||
1739 $a_current_script == 'login.php'
1740 ) {
1741 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for script: ' . $a_current_script);
1742 return true;
1743 }
1744
1745 if ($_REQUEST["baseClass"] == "ilStartUpGUI") {
1746 $cmd_class = $_REQUEST["cmdClass"];
1747
1748 if ($cmd_class == "ilaccountregistrationgui" ||
1749 $cmd_class == "ilpasswordassistancegui") {
1750 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for cmdClass: ' . $cmd_class);
1751 return true;
1752 }
1753
1754 $cmd = self::getCurrentCmd();
1755 if (
1756 $cmd == "showTermsOfService" || $cmd == "showClientList" ||
1757 $cmd == 'showAccountMigration' || $cmd == 'migrateAccount' ||
1758 $cmd == 'processCode' || $cmd == 'showLoginPage' || $cmd == 'doStandardAuthentication' || $cmd == 'doCasAuthentication'
1759 ) {
1760 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for cmd: ' . $cmd);
1761 return true;
1762 }
1763 }
1764
1765 // #12884
1766 if (($a_current_script == "goto.php" && $_GET["target"] == "impr_0") ||
1767 $_GET["baseClass"] == "ilImprintGUI") {
1768 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for baseClass: ' . $_GET['baseClass']);
1769 return true;
1770 }
1771
1772 if ($a_current_script == 'goto.php' && in_array($_GET['target'], array(
1773 'usr_registration', 'usr_nameassist', 'usr_pwassist', 'usr_agreement'
1774 ))) {
1775 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for goto target: ' . $_GET['target']);
1776 return true;
1777 }
1778
1779 ilLoggerFactory::getLogger('auth')->debug('Authentication required');
1780 return false;
1781 }
$_GET["client_id"]
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 getCurrentCmd()
Extract current cmd from request.
static getLogger($a_component_id)
Get component logger.

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

+ Here is the call graph for this function:

◆ buildHTTPPath()

static ilInitialisation::buildHTTPPath ( )
staticprotected

builds http path

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

293 {
294 include_once './Services/Http/classes/class.ilHTTPS.php';
295 $https = new ilHTTPS();
296
297 if ($https->isDetected()) {
298 $protocol = 'https://';
299 } else {
300 $protocol = 'http://';
301 }
302 $host = $_SERVER['HTTP_HOST'];
303
304 $rq_uri = strip_tags($_SERVER['REQUEST_URI']);
305
306 // security fix: this failed, if the URI contained "?" and following "/"
307 // -> we remove everything after "?"
308 if (is_int($pos = strpos($rq_uri, "?"))) {
309 $rq_uri = substr($rq_uri, 0, $pos);
310 }
311
312 if (!defined('ILIAS_MODULE')) {
313 $path = pathinfo($rq_uri);
314 if (!$path['extension']) {
315 $uri = $rq_uri;
316 } else {
317 $uri = dirname($rq_uri);
318 }
319 } else {
320 // if in module remove module name from HTTP_PATH
321 $path = dirname($rq_uri);
322
323 // dirname cuts the last directory from a directory path e.g content/classes return content
325
326 $dirs = explode('/', $module);
327 $uri = $path;
328 foreach ($dirs as $dir) {
329 $uri = dirname($uri);
330 }
331 }
333 return define('ILIAS_HTTP_PATH', ilUtil::removeTrailingPathSeparators(dirname($protocol . $host . $uri)));
335 $iliasHttpPath = implode('', [$protocol, $host, $uri]);
336 if (strpos($iliasHttpPath, '/Services/Saml/lib/') !== false && strpos($iliasHttpPath, '/metadata.php') === false) {
337 return define('ILIAS_HTTP_PATH', ilUtil::removeTrailingPathSeparators(
338 substr($iliasHttpPath, 0, strpos($iliasHttpPath, '/Services/Saml/lib/'))
339 ));
340 }
341 }
342 return define('ILIAS_HTTP_PATH', ilUtil::removeTrailingPathSeparators($protocol . $host . $uri));
343 }
$path
Definition: aliased.php:25
HTTPS.
static removeTrailingPathSeparators($path)
if($modEnd===false) $module
Definition: module.php:59
$iliasHttpPath
$https
Definition: imgupload.php:19
const ILIAS_MODULE
Definition: server.php:14

References $_SERVER, $https, $iliasHttpPath, $module, $path, GuzzleHttp\Psr7\$protocol, ilContext\CONTEXT_APACHE_SSO, ilContext\CONTEXT_SAML, ilContext\getType(), ILIAS_MODULE, and ilUtil\removeTrailingPathSeparators().

Referenced by initSettings().

+ Here is the call graph for this function:
+ 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 349 of file class.ilInitialisation.php.

350 {
351 global $ilIliasIniFile;
352
353 // check whether ini file object exists
354 if (!is_object($ilIliasIniFile)) {
355 self::abortAndDie('Fatal Error: ilInitialisation::determineClient called without initialisation of ILIAS ini file object.');
356 }
357
358 if (isset($_GET['client_id']) && strlen($_GET['client_id']) > 0) {
359 $_GET['client_id'] = \ilUtil::getClientIdByString((string) $_GET['client_id'])->toString();
360 if (!defined('IL_PHPUNIT_TEST')) {
362 ilUtil::setCookie('ilClientId', $_GET['client_id']);
363 }
364 }
365 } elseif (!isset($_COOKIE['ilClientId'])) {
366 ilUtil::setCookie('ilClientId', $ilIliasIniFile->readVariable('clients', 'default'));
367 }
368
369 if (!defined('IL_PHPUNIT_TEST') && ilContext::supportsPersistentSessions()) {
370 $clientId = $_COOKIE['ilClientId'];
371 } else {
372 $clientId = $_GET['client_id'];
373 }
374
375 define('CLIENT_ID', \ilUtil::getClientIdByString((string) $clientId)->toString());
376 }
$_COOKIE['client_id']
Definition: server.php:9
static supportsPersistentSessions()
Check if context supports persistent session handling.
static abortAndDie($a_message)
Exit.
static setCookie($a_cookie_name, $a_cookie_value='', $a_also_set_super_global=true, $a_set_cookie_invalid=false)
static getClientIdByString(string $clientId)
if(array_key_exists('provider', $_GET)) elseif(array_key_exists( 'provider', $_SESSION)) if(!in_array($providerName, ['Google', 'Microsoft', 'Yahoo'])) $clientId
$ilIliasIniFile

References $_COOKIE, $_GET, PHPMailer\PHPMailer\$clientId, $ilIliasIniFile, abortAndDie(), ilUtil\getClientIdByString(), ilUtil\setCookie(), and ilContext\supportsPersistentSessions().

Referenced by initClient().

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

◆ getCurrentCmd()

static ilInitialisation::getCurrentCmd ( )
staticprotected

Extract current cmd from request.

Returns
string

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

1693 {
1694 $cmd = $_REQUEST["cmd"];
1695 if (is_array($cmd)) {
1696 return array_shift(array_keys($cmd));
1697 } else {
1698 return $cmd;
1699 }
1700 }

Referenced by blockedAuthentication().

+ Here is the caller graph for this function:

◆ goToLogin()

static ilInitialisation::goToLogin ( )
staticprotected

go to login

Parameters
int$a_auth_stat

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

838 {
839 ilLoggerFactory::getLogger('init')->debug('Redirecting to login page.');
840
841 if ($GLOBALS['DIC']['ilAuthSession']->isExpired()) {
843 }
844 if (!$GLOBALS['DIC']['ilAuthSession']->isAuthenticated()) {
846 }
847
848 $script = "login.php?target=" . $_GET["target"] . "&client_id=" . $_COOKIE["ilClientId"] .
849 "&auth_stat=" . $a_auth_stat;
850
852 $script,
853 "init_error_authentication_fail",
854 array(
855 "en" => "Authentication failed.",
856 "de" => "Authentifizierung fehlgeschlagen.")
857 );
858 }
static redirect($a_target, $a_message_id='', array $a_message_static=null)
Redirects to target url if context supports it.
static setClosingContext($a_context)
set closing context (for statistics)
const SESSION_CLOSE_LOGIN
const SESSION_CLOSE_EXPIRE

References $_COOKIE, $_GET, $GLOBALS, 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

Parameters
int$a_auth_stat

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

783 {
784 global $ilAuth;
785
786 if (ANONYMOUS_USER_ID == "") {
787 self::abortAndDie("Public Section enabled, but no Anonymous user found.");
788 }
789
790 $session_destroyed = false;
791 if ($GLOBALS['DIC']['ilAuthSession']->isExpired()) {
792 $session_destroyed = true;
794 }
795 if (!$GLOBALS['DIC']['ilAuthSession']->isAuthenticated()) {
796 $session_destroyed = true;
798 }
799
800 if ($session_destroyed) {
801 $GLOBALS['DIC']['ilAuthSession']->setAuthenticated(true, ANONYMOUS_USER_ID);
802 }
803
804 self::initUserAccount();
805
806 // if target given, try to go there
807 if (strlen($_GET["target"])) {
808 // when we are already "inside" goto.php no redirect is needed
809 $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
810 if ($current_script == "goto.php") {
811 return;
812 }
813 // goto will check if target is accessible or redirect to login
814 self::redirect("goto.php?target=" . $_GET["target"]);
815 }
816
817 // check access of root folder otherwise redirect to login
818 #if(!$GLOBALS['DIC']->rbac()->system()->checkAccess('read', ROOT_FOLDER_ID))
819 #{
820 # return self::goToLogin();
821 #}
822
823 // we do not know if ref_id of request is accesible, so redirecting to root
824 $_GET["ref_id"] = ROOT_FOLDER_ID;
825 $_GET["cmd"] = "frameset";
827 "ilias.php?baseClass=ilrepositorygui&reloadpublic=1&cmd=" .
828 $_GET["cmd"] . "&ref_id=" . $_GET["ref_id"]
829 );
830 }
const SESSION_CLOSE_PUBLIC

References $_GET, $_SERVER, $GLOBALS, abortAndDie(), redirect(), 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:

◆ handleDevMode()

static ilInitialisation::handleDevMode ( )
staticprotected

Prepare developer tools.

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

970 {
971 if (defined(SHOWNOTICES) && SHOWNOTICES) {
972 // no further differentiating of php version regarding to 5.4 neccessary
973 // when the error reporting is set to E_ALL anyway
974
975 // add notices to error reporting
976 error_reporting(E_ALL);
977 }
978
979 if (defined('DEBUGTOOLS') && DEBUGTOOLS) {
980 include_once "include/inc.debug.php";
981 }
982 }

Referenced by initClient().

+ Here is the caller graph for this function:

◆ handleErrorReporting()

static ilInitialisation::handleErrorReporting ( )
static

Set error reporting level.

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

1079 {
1080 // push the error level as high as possible / sane
1081 error_reporting(E_ALL & ~E_NOTICE);
1082
1083 // see handleDevMode() - error reporting might be overwritten again
1084 // but we need the client ini first
1085 }

Referenced by ilWebAccessCheckerDelivery\handleRequest(), and initCore().

+ Here is the caller graph for this function:

◆ handleMaintenanceMode()

static ilInitialisation::handleMaintenanceMode ( )
staticprotected

handle maintenance mode

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

472 {
473 global $ilClientIniFile;
474
475 if (!$ilClientIniFile->readVariable("client", "access")) {
476 $mess = array("en" => "The server is not available due to maintenance." .
477 " We apologise for any inconvenience.",
478 "de" => "Der Server ist aufgrund von Wartungsarbeiten nicht verfügbar." .
479 " Wir bitten um Verständnis.");
480 $mess_id = "init_error_maintenance";
481
482 if (ilContext::hasHTML() && is_file("./maintenance.html")) {
483 self::redirect("./maintenance.html", $mess_id, $mess);
484 } else {
485 $mess = self::translateMessage($mess_id, $mess);
486 self::abortAndDie($mess);
487 }
488 }
489 }
static hasHTML()
Has HTML output.
static translateMessage($a_message_id, array $a_message_static=null)
Translate message if possible.

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

Referenced by initClient().

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

◆ includePhp5Compliance()

static ilInitialisation::includePhp5Compliance ( )
staticprotected

This is a hack for authentication.

Since the phpCAS lib ships with its own compliance functions.

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

96 {
97 include_once 'Services/Authentication/classes/class.ilAuthFactory.php';
99 require_once("include/inc.xml5compliance.php");
100 }
101 require_once("include/inc.xsl5compliance.php");
102 }

References ilAuthFactory\CONTEXT_CAS, and ilAuthFactory\getContext().

Referenced by initILIAS().

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

◆ initAccessHandling()

static ilInitialisation::initAccessHandling ( )
staticprotected

$ilAccess and $rbac... initialisation

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

891 {
893 "rbacreview",
894 "ilRbacReview",
895 "./Services/AccessControl/classes/class.ilRbacReview.php"
896 );
897
898 require_once "./Services/AccessControl/classes/class.ilRbacSystem.php";
899 $rbacsystem = ilRbacSystem::getInstance();
900 self::initGlobal("rbacsystem", $rbacsystem);
901
903 "rbacadmin",
904 "ilRbacAdmin",
905 "./Services/AccessControl/classes/class.ilRbacAdmin.php"
906 );
907
909 "ilAccess",
910 "ilAccess",
911 "./Services/AccessControl/classes/class.ilAccess.php"
912 );
913
914 require_once "./Services/Conditions/classes/class.ilConditionHandler.php";
915 }
static initGlobal($a_name, $a_class, $a_source_file=null)
Initialize global instance.

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

Referenced by initUser().

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

◆ initAvatar()

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

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

624 {
625 $c["user.avatar.factory"] = function ($c) {
626 return new \ilUserAvatarFactory($c);
627 };
628 }

References $c.

Referenced by initClient().

+ Here is the caller graph for this function:

◆ initBackgroundTasks()

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

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

1936 {
1937 global $ilIliasIniFile;
1938
1939 $n_of_tasks = $ilIliasIniFile->readVariable("background_tasks", "number_of_concurrent_tasks");
1940 $sync = $ilIliasIniFile->readVariable("background_tasks", "concurrency");
1941
1942 $n_of_tasks = $n_of_tasks ? $n_of_tasks : 5;
1943 $sync = $sync ? $sync : 'sync'; // The default value is sync.
1944
1945 $c["bt.task_factory"] = function ($c) {
1946 return new \ILIAS\BackgroundTasks\Implementation\Tasks\BasicTaskFactory($c["di.injector"]);
1947 };
1948
1949 $c["bt.persistence"] = function ($c) {
1951 };
1952
1953 $c["bt.injector"] = function ($c) {
1954 return new \ILIAS\BackgroundTasks\Dependencies\Injector($c, new BaseDependencyMap());
1955 };
1956
1957 $c["bt.task_manager"] = function ($c) use ($sync) {
1958 if ($sync == 'sync') {
1959 return new \ILIAS\BackgroundTasks\Implementation\TaskManager\SyncTaskManager($c["bt.persistence"]);
1960 } elseif ($sync == 'async') {
1961 return new \ILIAS\BackgroundTasks\Implementation\TaskManager\AsyncTaskManager($c["bt.persistence"]);
1962 } else {
1963 throw new ilException("The supported Background Task Managers are sync and async. $sync given.");
1964 }
1965 };
1966 }
Base class for ILIAS Exception handling.
$sync
instance(Loop $newLoop=null)
Retrieves or sets the global Loop object.
Definition: functions.php:173

References $c, $ilIliasIniFile, $sync, and Sabre\Event\Loop\instance().

Referenced by initILIAS().

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

◆ initClient()

static ilInitialisation::initClient ( )
staticprotected

Init client-based objects (level 1)

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

1133 {
1134 global $https, $ilias, $DIC;
1135
1137
1139
1140 self::bootstrapFilesystems();
1141
1143
1144
1145 // --- needs client ini
1146
1147 $ilias->client_id = CLIENT_ID;
1148
1149 if (DEVMODE) {
1151 }
1152
1153
1155
1157
1158 // init dafault language
1159 self::initLanguage(false);
1160
1161 // moved after databases
1162 self::initLog();
1163
1165 "ilAppEventHandler",
1166 "ilAppEventHandler",
1167 "./Services/EventHandling/classes/class.ilAppEventHandler.php"
1168 );
1169
1170 // there are rare cases where initILIAS is called twice for a request
1171 // example goto.php is called and includes ilias.php later
1172 // we must prevent that ilPluginAdmin is initialized twice in
1173 // this case, since this won't get the values out of plugin.php the
1174 // second time properly
1175 if (!isset($DIC["ilPluginAdmin"]) || !$DIC["ilPluginAdmin"] instanceof ilPluginAdmin) {
1177 "ilPluginAdmin",
1178 "ilPluginAdmin",
1179 "./Services/Component/classes/class.ilPluginAdmin.php"
1180 );
1181 }
1182
1185 self::initMail($GLOBALS['DIC']);
1186 self::initAvatar($GLOBALS['DIC']);
1189
1190
1191 // --- needs settings
1192
1194
1195 if (ilContext::usesHTTP()) {
1196 // $https
1197 self::initGlobal("https", "ilHTTPS", "./Services/Http/classes/class.ilHTTPS.php");
1198 $https->enableSecureCookies();
1199 $https->checkPort();
1200 }
1201
1202
1203 // --- object handling
1204
1206 "ilObjDataCache",
1207 "ilObjectDataCache",
1208 "./Services/Object/classes/class.ilObjectDataCache.php"
1209 );
1210
1211 // needed in ilObjectDefinition
1212 require_once "./Services/Xml/classes/class.ilSaxParser.php";
1213
1215 "objDefinition",
1216 "ilObjectDefinition",
1217 "./Services/Object/classes/class.ilObjectDefinition.php"
1218 );
1219
1220 // $tree
1221 require_once "./Services/Tree/classes/class.ilTree.php";
1222 $tree = new ilTree(ROOT_FOLDER_ID);
1223 self::initGlobal("tree", $tree);
1224 unset($tree);
1225
1227 "ilCtrl",
1228 "ilCtrl",
1229 "./Services/UICore/classes/class.ilCtrl.php"
1230 );
1231
1233 }
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 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
static handleDevMode()
Prepare developer tools.
static setSessionCookieParams()
set session cookie params
static initSettings()
initialise $ilSettings object and define constants
static initMail(\ILIAS\DI\Container $c)
static initTermsOfService(\ILIAS\DI\Container $c)
static handleMaintenanceMode()
handle maintenance mode
static initCustomObjectIcons(\ILIAS\DI\Container $c)
Administration class for plugins.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
global $DIC
Definition: saml.php:7

References $DIC, $GLOBALS, $https, $tree, determineClient(), handleDevMode(), handleMaintenanceMode(), initAvatar(), initClientIniFile(), initCustomObjectIcons(), initDatabase(), initGlobal(), initLocale(), initLog(), initMail(), initSettings(), initTermsOfService(), setCookieConstants(), setSessionCookieParams(), setSessionHandler(), and ilContext\usesHTTP().

Referenced by initILIAS().

+ Here is the call graph for this function:
+ Here is the caller 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
boolean true, if no error occured with client init file otherwise false

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

391 {
392 global $ilIliasIniFile;
393
394 // check whether ILIAS_WEB_DIR is set.
395 if (ILIAS_WEB_DIR == "") {
396 self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile called without ILIAS_WEB_DIR.");
397 }
398
399 // check whether CLIENT_ID is set.
400 if (CLIENT_ID == "") {
401 self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile called without CLIENT_ID.");
402 }
403
404 $ini_file = "./" . ILIAS_WEB_DIR . "/" . CLIENT_ID . "/client.ini.php";
405
406 // get settings from ini file
407 $ilClientIniFile = new ilIniFile($ini_file);
408 $ilClientIniFile->read();
409
410 // invalid client id / client ini
411 if ($ilClientIniFile->ERROR != "") {
412 $c = $_COOKIE["ilClientId"];
413 $default_client = $ilIliasIniFile->readVariable("clients", "default");
414 ilUtil::setCookie("ilClientId", $default_client);
415 if (CLIENT_ID != "" && CLIENT_ID != $default_client) {
416 $mess = array("en" => "Client does not exist.",
417 "de" => "Mandant ist ungültig.");
418 self::redirect("index.php?client_id=" . $default_client, null, $mess);
419 } else {
420 self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile initializing client ini file abborted with: " . $ilClientIniFile->ERROR);
421 }
422 }
423
424 self::initGlobal("ilClientIniFile", $ilClientIniFile);
425
426 // set constants
427 define("SESSION_REMINDER_LEADTIME", 30);
428 define("DEBUG", $ilClientIniFile->readVariable("system", "DEBUG"));
429 define("DEVMODE", $ilClientIniFile->readVariable("system", "DEVMODE"));
430 define("SHOWNOTICES", $ilClientIniFile->readVariable("system", "SHOWNOTICES"));
431 define("DEBUGTOOLS", $ilClientIniFile->readVariable("system", "DEBUGTOOLS"));
432 define("ROOT_FOLDER_ID", $ilClientIniFile->readVariable('system', 'ROOT_FOLDER_ID'));
433 define("SYSTEM_FOLDER_ID", $ilClientIniFile->readVariable('system', 'SYSTEM_FOLDER_ID'));
434 define("ROLE_FOLDER_ID", $ilClientIniFile->readVariable('system', 'ROLE_FOLDER_ID'));
435 define("MAIL_SETTINGS_ID", $ilClientIniFile->readVariable('system', 'MAIL_SETTINGS_ID'));
436 $error_handler = $ilClientIniFile->readVariable('system', 'ERROR_HANDLER');
437 define("ERROR_HANDLER", $error_handler ? $error_handler : "PRETTY_PAGE");
438
439 // this is for the online help installation, which sets OH_REF_ID to the
440 // ref id of the online module
441 define("OH_REF_ID", $ilClientIniFile->readVariable("system", "OH_REF_ID"));
442
443 define("SYSTEM_MAIL_ADDRESS", $ilClientIniFile->readVariable('system', 'MAIL_SENT_ADDRESS')); // Change SS
444 define("MAIL_REPLY_WARNING", $ilClientIniFile->readVariable('system', 'MAIL_REPLY_WARNING')); // Change SS
445
446 // see ilObject::TITLE_LENGTH, ilObject::DESC_LENGTH
447 // define ("MAXLENGTH_OBJ_TITLE",125);#$ilClientIniFile->readVariable('system','MAXLENGTH_OBJ_TITLE'));
448 // define ("MAXLENGTH_OBJ_DESC",$ilClientIniFile->readVariable('system','MAXLENGTH_OBJ_DESC'));
449
450 define("CLIENT_DATA_DIR", ILIAS_DATA_DIR . "/" . CLIENT_ID);
451 define("CLIENT_WEB_DIR", ILIAS_ABSOLUTE_PATH . "/" . ILIAS_WEB_DIR . "/" . CLIENT_ID);
452 define("CLIENT_NAME", $ilClientIniFile->readVariable('client', 'name')); // Change SS
453
454 $val = $ilClientIniFile->readVariable("db", "type");
455 if ($val == "") {
456 define("IL_DB_TYPE", "mysql");
457 } else {
458 define("IL_DB_TYPE", $val);
459 }
460
461 $ilGlobalCacheSettings = new ilGlobalCacheSettings();
462 $ilGlobalCacheSettings->readFromIniFile($ilClientIniFile);
463 ilGlobalCache::setup($ilGlobalCacheSettings);
464
465 return true;
466 }
Class ilGlobalCacheSettings.
static setup(ilGlobalCacheSettings $ilGlobalCacheSettings)
INIFile Parser.

References $_COOKIE, $c, $ilIliasIniFile, abortAndDie(), initGlobal(), redirect(), ilUtil\setCookie(), and ilGlobalCache\setup().

Referenced by initClient().

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

◆ initCore()

static ilInitialisation::initCore ( )
staticprotected

Init core objects (level 0)

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

1091 {
1092 global $ilErr;
1093
1095
1096 // breaks CAS: must be included after CAS context isset in AuthUtils
1097 //self::includePhp5Compliance();
1098
1100
1101
1102 // error handler
1104 "ilErr",
1105 "ilErrorHandling",
1106 "./Services/Init/classes/class.ilErrorHandling.php"
1107 );
1108 $ilErr->setErrorHandling(PEAR_ERROR_CALLBACK, array($ilErr, 'errorHandler'));
1109
1110 // :TODO: obsolete?
1111 // PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($ilErr, "errorHandler"));
1112
1113 // workaround: load old post variables if error handler 'message' was called
1114 include_once "Services/Authentication/classes/class.ilSession.php";
1115 if (ilSession::get("message")) {
1116 $_POST = ilSession::get("post_vars");
1117 }
1118
1120
1122
1123 define('IL_INITIAL_WD', getcwd());
1124
1125 // deprecated
1126 self::initGlobal("ilias", "ILIAS", "./Services/Init/classes/class.ilias.php");
1127 }
const PEAR_ERROR_CALLBACK
Definition: PEAR.php:35
$_POST["username"]
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...
static get($a_var)
Get a value.

References $_POST, $ilErr, ilSession\get(), handleErrorReporting(), initGlobal(), initIliasIniFile(), PEAR_ERROR_CALLBACK, removeUnsafeCharacters(), and requireCommonIncludes().

Referenced by initILIAS().

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

◆ initCustomObjectIcons()

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

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

609 {
610 $c["object.customicons.factory"] = function ($c) {
611 require_once 'Services/Object/Icon/classes/class.ilObjectCustomIconFactory.php';
612 return new ilObjectCustomIconFactory(
613 $c->filesystem()->web(),
614 $c->upload(),
615 $c['ilObjDataCache']
616 );
617 };
618 }
Class ilObjectCustomIconFactory.

References $c.

Referenced by initClient().

+ Here is the caller graph for this function:

◆ initDatabase()

static ilInitialisation::initDatabase ( )
staticprotected

initialise database object $ilDB

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

496 {
497 // build dsn of database connection and connect
498 require_once("./Services/Database/classes/class.ilDBWrapperFactory.php");
499 $ilDB = ilDBWrapperFactory::getWrapper(IL_DB_TYPE);
500 $ilDB->initFromIniFile();
501 $ilDB->connect();
502
503 self::initGlobal("ilDB", $ilDB);
504 }
global $ilDB

References $ilDB, and initGlobal().

Referenced by initClient().

+ Here is the call graph for this function:
+ Here is the caller 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 271 of file class.ilInitialisation.php.

272 {
273 $dic['upload.processor-manager'] = function ($c) {
274 return new \ILIAS\FileUpload\Processor\PreProcessorManagerImpl();
275 };
276
277 $dic['upload'] = function ($c) {
278 $fileUploadImpl = new \ILIAS\FileUpload\FileUploadImpl($c['upload.processor-manager'], $c['filesystem'], $c['http']);
279 if (IL_VIRUS_SCANNER != "None") {
280 $fileUploadImpl->register(new \ILIAS\FileUpload\Processor\VirusScannerPreProcessor(ilVirusScannerFactory::_getInstance()));
281 }
282
283 $fileUploadImpl->register(new \ILIAS\FileUpload\Processor\FilenameSanitizerPreProcessor());
284
285 return $fileUploadImpl;
286 };
287 }
Class BaseForm.

References $c, and ilVirusScannerFactory\_getInstance().

Referenced by initILIAS().

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

◆ initGlobal()

static ilInitialisation::initGlobal (   $a_name,
  $a_class,
  $a_source_file = null 
)
staticprotected

Initialize global instance.

Parameters
string$a_name
string$a_class
string$a_source_file

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

938 {
939 global $DIC;
940
941 if ($a_source_file) {
942 include_once $a_source_file;
943 $GLOBALS[$a_name] = new $a_class;
944 } else {
945 $GLOBALS[$a_name] = $a_class;
946 }
947
948 $DIC[$a_name] = function ($c) use ($a_name) {
949 return $GLOBALS[$a_name];
950 };
951 }

References $c, $DIC, and $GLOBALS.

Referenced by initAccessHandling(), initClient(), initClientIniFile(), initCore(), initDatabase(), initHTML(), initIliasIniFile(), initLog(), initSettings(), initStyle(), initUser(), and requireCommonIncludes().

+ Here is the caller graph for this function:

◆ initGlobalScreen()

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

init the ILIAS UI framework.

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

1405 {
1406 $c["global_screen"] = function () use ($c) {
1407 return new Services(new ilGSProviderFactory($c));
1408 };
1409 }
Class ilGSProviderFactory.
Class ilCertificateAppEventListener.

References $c.

Referenced by initHTML().

+ Here is the caller graph for this function:

◆ initHTML()

static ilInitialisation::initHTML ( )
staticprotected

init HTML output (level 3)

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

1578 {
1579 global $ilUser;
1580 require_once "./Services/LTI/classes/class.ilLTIViewGUI.php";
1581 $lti = new ilLTIViewGUI($ilUser);
1582 $GLOBALS["DIC"]["lti"] = $lti;
1583
1584 if (ilContext::hasUser()) {
1585 // load style definitions
1586 // use the init function with plugin hook here, too
1588 }
1591
1592 // LTI
1593 if ($lti->isActive()) {
1594 include_once "./Services/LTI/classes/class.ilTemplate.php";
1595 $tpl = new LTI\ilTemplate("tpl.main.html", true, true, "Services/LTI");
1596 } else {
1597 $tpl = new ilTemplate("tpl.main.html", true, true);
1598 }
1599
1600 self::initGlobal("tpl", $tpl);
1601
1602 if (ilContext::hasUser()) {
1603 require_once 'Services/User/classes/class.ilUserRequestTargetAdjustment.php';
1604 $request_adjuster = new ilUserRequestTargetAdjustment($ilUser, $GLOBALS['DIC']['ilCtrl']);
1605 $request_adjuster->adjust();
1606 }
1607
1608
1609 // load style sheet depending on user's settings
1610 $location_stylesheet = ilUtil::getStyleSheetLocation();
1611 $tpl->setVariable("LOCATION_STYLESHEET", $location_stylesheet);
1612
1613 require_once "./Services/UICore/classes/class.ilFrameTargetInfo.php";
1614
1616 "ilNavigationHistory",
1617 "ilNavigationHistory",
1618 "Services/Navigation/classes/class.ilNavigationHistory.php"
1619 );
1620
1622 "ilBrowser",
1623 "ilBrowser",
1624 "./Services/Utilities/classes/class.ilBrowser.php"
1625 );
1626
1628 "ilHelp",
1629 "ilHelpGUI",
1630 "Services/Help/classes/class.ilHelpGUI.php"
1631 );
1632
1634 "ilToolbar",
1635 "ilToolbarGUI",
1636 "./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php"
1637 );
1638
1640 "ilLocator",
1641 "ilLocatorGUI",
1642 "./Services/Locator/classes/class.ilLocatorGUI.php"
1643 );
1644
1646 "ilTabs",
1647 "ilTabsGUI",
1648 "./Services/UIComponent/Tabs/classes/class.ilTabsGUI.php"
1649 );
1650
1651 if (ilContext::hasUser()) {
1652 // LTI
1653 if ($lti->isActive()) {
1654 include_once './Services/LTI/classes/class.ilMainMenuGUI.php';
1655 $ilMainMenu = new LTI\ilMainMenuGUI("_top");
1656 } else {
1657 include_once './Services/MainMenu/classes/class.ilMainMenuGUI.php';
1658 $ilMainMenu = new ilMainMenuGUI("_top");
1659 }
1660
1661 self::initGlobal("ilMainMenu", $ilMainMenu);
1662 unset($ilMainMenu);
1663
1664 // :TODO: tableGUI related
1665
1666 // set hits per page for all lists using table module
1667 $_GET['limit'] = (int) $ilUser->getPref('hits_per_page');
1668 ilSession::set('tbl_limit', $_GET['limit']);
1669
1670 // the next line makes it impossible to save the offset somehow in a session for
1671 // a specific table (I tried it for the user administration).
1672 // its not posssible to distinguish whether it has been set to page 1 (=offset = 0)
1673 // or not set at all (then we want the last offset, e.g. being used from a session var).
1674 // So I added the wrapping if statement. Seems to work (hopefully).
1675 // Alex April 14th 2006
1676 if (isset($_GET['offset']) && $_GET['offset'] != "") { // added April 14th 2006
1677 $_GET['offset'] = (int) $_GET['offset']; // old code
1678 }
1679
1681 } else {
1682 // several code parts rely on ilObjUser being always included
1683 include_once "Services/User/classes/class.ilObjUser.php";
1684 }
1685 }
$tpl
Definition: ilias.php:10
Handles display of the main menu for LTI.
special template class to simplify handling of ITX/PEAR
static hasUser()
Based on user authentication?
static initUIFramework(\ILIAS\DI\Container $c)
static initKioskMode(\ILIAS\DI\Container $c)
static initGlobalScreen(\ILIAS\DI\Container $c)
init the ILIAS UI framework.
static initStyle()
provide $styleDefinition object
@classDescription class for ILIAS ViewLTI
Handles display of the main menu.
static set($a_var, $a_val)
Set a value.
special template class to simplify handling of ITX/PEAR
Class ilUserAccountMaintenanceEnforcement.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$ilUser
Definition: imgupload.php:18

References $_GET, $GLOBALS, $ilUser, $tpl, ilUtil\getStyleSheetLocation(), ilContext\hasUser(), initGlobal(), initGlobalScreen(), initKioskMode(), initStyle(), initUIFramework(), and ilSession\set().

Referenced by initILIAS().

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

◆ initHTTPServices()

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

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

1374 {
1375 $container['http.request_factory'] = function ($c) {
1376 return new \ILIAS\HTTP\Request\RequestFactoryImpl();
1377 };
1378
1379 $container['http.response_factory'] = function ($c) {
1380 return new \ILIAS\HTTP\Response\ResponseFactoryImpl();
1381 };
1382
1383 $container['http.cookie_jar_factory'] = function ($c) {
1384 return new \ILIAS\HTTP\Cookies\CookieJarFactoryImpl();
1385 };
1386
1387 $container['http.response_sender_strategy'] = function ($c) {
1388 return new \ILIAS\HTTP\Response\Sender\DefaultResponseSenderStrategy();
1389 };
1390
1391 $container['http'] = function ($c) {
1392 return new \ILIAS\DI\HTTPServices(
1393 $c['http.response_sender_strategy'],
1394 $c['http.cookie_jar_factory'],
1395 $c['http.request_factory'],
1396 $c['http.response_factory']
1397 );
1398 };
1399 }
$container
Definition: wac.php:13

References $c, and $container.

Referenced by initILIAS().

+ Here is the caller graph for this function:

◆ initILIAS()

static ilInitialisation::initILIAS ( )
static

ilias initialisation

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

997 {
998 if (self::$already_initialized) {
999 // workaround for bug #17990
1000 // big mess. we prevent double initialisations with ILIAS 5.1, which is good, but...
1001 // the style service uses $_GET["ref_id"] to determine
1002 // the context styles. $_GET["ref_id"] is "corrected" by the "goto" procedure and which calls
1003 // initILIAS again.
1004 // we need a mechanism that detemines our repository context and stores that in an information object
1005 // usable by the style component afterwars. This needs new concepts and a refactoring.
1006 if (ilContext::initClient()) {
1007 global $tpl;
1008 if (is_object($tpl)) {
1009 // load style sheet depending on user's settings
1010 $location_stylesheet = ilUtil::getStyleSheetLocation();
1011 $tpl->setVariable("LOCATION_STYLESHEET", $location_stylesheet);
1012 }
1013 }
1014
1015 return;
1016 }
1017
1018 $GLOBALS["DIC"] = new \ILIAS\DI\Container();
1019 $GLOBALS["DIC"]["ilLoggerFactory"] = function ($c) {
1021 };
1022
1023 self::$already_initialized = true;
1024
1027 if (ilContext::initClient()) {
1031
1032 if (ilContext::hasUser()) {
1034
1037 }
1038 }
1039
1040 // init after Auth otherwise breaks CAS
1042
1043 // language may depend on user setting
1044 self::initLanguage(true);
1045 $GLOBALS['DIC']['tree']->initLangCode();
1046
1050
1051 if (ilContext::hasHTML()) {
1052 include_once('./Services/WebServices/ECS/classes/class.ilECSTaskScheduler.php');
1054
1056 }
1057 }
1058 }
static initClient()
Init client.
static start()
Start task scheduler for each server instance.
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 includePhp5Compliance()
This is a hack for authentication.
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, $tpl, ilLoggerFactory\getInstance(), ilUtil\getStyleSheetLocation(), ilContext\hasHTML(), ilContext\hasUser(), includePhp5Compliance(), initBackgroundTasks(), ilContext\initClient(), initClient(), initCore(), initFileUploadService(), initHTML(), initHTTPServices(), initInjector(), initKioskMode(), initSession(), initUser(), resumeUserSession(), ilECSTaskScheduler\start(), and ilContext\supportsPersistentSessions().

Referenced by ilSoapFunctions\__call(), ilSoapAdministration\getClientInfoXML(), ilSoapAdministration\getInstallationInfoXML(), ilNusoapUserAdministrationAdapter\handleSoapPlugins(), ilCalendarRemoteAccessHandler\initIlias(), ilWebAccessChecker\initILIAS(), and reinitILIAS().

+ 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.

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

112 {
113 require_once("./Services/Init/classes/class.ilIniFile.php");
114 $ilIliasIniFile = new ilIniFile("./ilias.ini.php");
115 $ilIliasIniFile->read();
116 self::initGlobal('ilIliasIniFile', $ilIliasIniFile);
117
118 // initialize constants
119 define("ILIAS_DATA_DIR", $ilIliasIniFile->readVariable("clients", "datadir"));
120 define("ILIAS_WEB_DIR", $ilIliasIniFile->readVariable("clients", "path"));
121 define("ILIAS_ABSOLUTE_PATH", $ilIliasIniFile->readVariable('server', 'absolute_path'));
122
123 // logging
124 define("ILIAS_LOG_DIR", $ilIliasIniFile->readVariable("log", "path"));
125 define("ILIAS_LOG_FILE", $ilIliasIniFile->readVariable("log", "file"));
126 define("ILIAS_LOG_ENABLED", $ilIliasIniFile->readVariable("log", "enabled"));
127 define("ILIAS_LOG_LEVEL", $ilIliasIniFile->readVariable("log", "level"));
128 define("SLOW_REQUEST_TIME", $ilIliasIniFile->readVariable("log", "slow_request_time"));
129
130 // read path + command for third party tools from ilias.ini
131 define("PATH_TO_CONVERT", $ilIliasIniFile->readVariable("tools", "convert"));
132 define("PATH_TO_FFMPEG", $ilIliasIniFile->readVariable("tools", "ffmpeg"));
133 define("PATH_TO_ZIP", $ilIliasIniFile->readVariable("tools", "zip"));
134 define("PATH_TO_MKISOFS", $ilIliasIniFile->readVariable("tools", "mkisofs"));
135 define("PATH_TO_UNZIP", $ilIliasIniFile->readVariable("tools", "unzip"));
136 define("PATH_TO_GHOSTSCRIPT", $ilIliasIniFile->readVariable("tools", "ghostscript"));
137 define("PATH_TO_JAVA", $ilIliasIniFile->readVariable("tools", "java"));
138 define("URL_TO_LATEX", $ilIliasIniFile->readVariable("tools", "latex"));
139 define("PATH_TO_FOP", $ilIliasIniFile->readVariable("tools", "fop"));
140 define("PATH_TO_LESSC", $ilIliasIniFile->readVariable("tools", "lessc"));
141 define("PATH_TO_PHANTOMJS", $ilIliasIniFile->readVariable("tools", "phantomjs"));
142
143 // read virus scanner settings
144 switch ($ilIliasIniFile->readVariable("tools", "vscantype")) {
145 case "sophos":
146 define("IL_VIRUS_SCANNER", "Sophos");
147 define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
148 define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
149 break;
150
151 case "antivir":
152 define("IL_VIRUS_SCANNER", "AntiVir");
153 define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
154 define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
155 break;
156
157 case "clamav":
158 define("IL_VIRUS_SCANNER", "ClamAV");
159 define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
160 define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
161 break;
162
163 default:
164 define("IL_VIRUS_SCANNER", "None");
165 break;
166 }
167
168 include_once './Services/Calendar/classes/class.ilTimeZone.php';
170 define("IL_TIMEZONE", $tz);
171 }
static initDefaultTimeZone(ilIniFile $ini)
Initialize default timezone from system settings.

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

Referenced by initCore().

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

◆ initInjector()

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

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

1970 {
1971 $c["di.dependency_map"] = function ($c) {
1972 return new \ILIAS\BackgroundTasks\Dependencies\DependencyMap\BaseDependencyMap();
1973 };
1974
1975 $c["di.injector"] = function ($c) {
1976 return new \ILIAS\BackgroundTasks\Dependencies\Injector($c, $c["di.dependency_map"]);
1977 };
1978 }

References $c.

Referenced by initILIAS().

+ Here is the caller graph for this function:

◆ initKioskMode()

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

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

1981 {
1982 $c["service.kiosk_mode"] = function ($c) {
1983 return new ilKioskModeService(
1984 $c['ilCtrl'],
1985 $c['lng'],
1986 $c['ilAccess'],
1987 $c['objDefinition']
1988 );
1989 };
1990 }
Central entry point for users of the service.

References $c.

Referenced by initHTML(), and initILIAS().

+ Here is the caller graph for this function:

◆ initLocale()

static ilInitialisation::initLocale ( )
staticprotected

Init Locale.

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

749 {
750 global $ilSetting;
751
752 if (trim($ilSetting->get("locale") != "")) {
753 $larr = explode(",", trim($ilSetting->get("locale")));
754 $ls = array();
755 $first = $larr[0];
756 foreach ($larr as $l) {
757 if (trim($l) != "") {
758 $ls[] = $l;
759 }
760 }
761 if (count($ls) > 0) {
762 setlocale(LC_ALL, $ls);
763
764 // #15347 - making sure that floats are not changed
765 setlocale(LC_NUMERIC, "C");
766
767 if (class_exists("Collator")) {
768 $GLOBALS["ilCollator"] = new Collator($first);
769 $GLOBALS["DIC"]["ilCollator"] = function ($c) {
770 return $GLOBALS["ilCollator"];
771 };
772 }
773 }
774 }
775 }
global $l
Definition: afr.php:30
global $ilSetting
Definition: privfeed.php:17

References $c, $GLOBALS, $ilSetting, and $l.

Referenced by initClient().

+ Here is the caller graph for this function:

◆ initLog()

static ilInitialisation::initLog ( )
staticprotected

Init log instance.

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

921 {
922 include_once './Services/Logging/classes/public/class.ilLoggerFactory.php';
924
925 self::initGlobal("ilLog", $log);
926 // deprecated
927 self::initGlobal("log", $log);
928 }
static getRootLogger()
The unique root logger has a fixed error level.
$log
Definition: sabredav.php:21

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

Referenced by initClient().

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

◆ initMail()

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

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

593 {
594 $c["mail.mime.transport.factory"] = function (\ILIAS\DI\Container $c) {
595 return new \ilMailMimeTransportFactory($c->settings(), $c->event());
596 };
597 $c["mail.mime.sender.factory"] = function (\ILIAS\DI\Container $c) {
598 return new \ilMailMimeSenderFactory($c->settings());
599 };
600 $c["mail.texttemplates.service"] = function (\ILIAS\DI\Container $c) {
601 return new \ilMailTemplateService(new \ilMailTemplateRepository($c->database()));
602 };
603 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:17
Class ilMailTemplateRepository.

References $c.

Referenced by initClient().

+ Here is the caller graph for this function:

◆ initSession()

static ilInitialisation::initSession ( )
staticprotected

Init auth session.

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

1064 {
1065 $GLOBALS["DIC"]["ilAuthSession"] = function ($c) {
1066 $auth_session = ilAuthSession::getInstance(
1067 $c['ilLoggerFactory']->getLogger('auth')
1068 );
1069 $auth_session->init();
1070 return $auth_session;
1071 };
1072 }
static getInstance(\ilLogger $logger)
Get instance.

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

Referenced by initILIAS().

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

◆ initSettings()

static ilInitialisation::initSettings ( )
staticprotected

initialise $ilSettings object and define constants

Used in Soap

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

659 {
660 global $ilSetting;
661
663 "ilSetting",
664 "ilSetting",
665 "Services/Administration/classes/class.ilSetting.php"
666 );
667
668 // check correct setup
669 if (!$ilSetting->get("setup_ok")) {
670 self::abortAndDie("Setup is not completed. Please run setup routine again.");
671 }
672
673 // set anonymous user & role id and system role id
674 define("ANONYMOUS_USER_ID", $ilSetting->get("anonymous_user_id"));
675 define("ANONYMOUS_ROLE_ID", $ilSetting->get("anonymous_role_id"));
676 define("SYSTEM_USER_ID", $ilSetting->get("system_user_id"));
677 define("SYSTEM_ROLE_ID", $ilSetting->get("system_role_id"));
678 define("USER_FOLDER_ID", 7);
679
680 // recovery folder
681 define("RECOVERY_FOLDER_ID", $ilSetting->get("recovery_folder_id"));
682
683 // installation id
684 define("IL_INST_ID", $ilSetting->get("inst_id", 0));
685
686 // define default suffix replacements
687 define("SUFFIX_REPL_DEFAULT", "php,php3,php4,inc,lang,phtml,htaccess");
688 define("SUFFIX_REPL_ADDITIONAL", $ilSetting->get("suffix_repl_additional"));
689
690 if (ilContext::usesHTTP()) {
692 }
693 }
static buildHTTPPath()
builds http path

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

Referenced by initClient().

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

◆ initStyle()

static ilInitialisation::initStyle ( )
staticprotected

provide $styleDefinition object

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

699 {
700 global $DIC, $ilPluginAdmin;
701
702 // load style definitions
704 "styleDefinition",
705 "ilStyleDefinition",
706 "./Services/Style/System/classes/class.ilStyleDefinition.php"
707 );
708
709 // add user interface hook for style initialisation
710 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
711 foreach ($pl_names as $pl) {
712 $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
713 $gui_class = $ui_plugin->getUIClassInstance();
714 $gui_class->modifyGUI("Services/Init", "init_style", array("styleDefinition" => $DIC->systemStyle()));
715 }
716 }
const IL_COMP_SERVICE
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.

References $DIC, ilPluginAdmin\getPluginObject(), IL_COMP_SERVICE, and initGlobal().

Referenced by initHTML().

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

◆ initTermsOfService()

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

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

634 {
635 $c['tos.criteria.type.factory'] = function (\ILIAS\DI\Container $c) {
636 return new ilTermsOfServiceCriterionTypeFactory($c->rbac()->review(), $c['ilObjDataCache']);
637 };
638
639 $c['tos.document.evaluator'] = function (\ILIAS\DI\Container $c) {
642 $c['tos.criteria.type.factory'],
643 $c->user(),
644 $c->logger()->tos()
645 ),
646 $c->user(),
647 $c->logger()->tos(),
648 \ilTermsOfServiceDocument::orderBy('sorting')->get()
649 );
650 };
651 }
static orderBy($orderBy, $orderDirection='ASC')
Interface ilTermsOfServiceSequentialDocumentEvaluation.

References $c, and ActiveRecord\orderBy().

Referenced by initClient().

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

◆ initUIFramework()

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

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

1412 {
1413 $c["ui.factory"] = function ($c) {
1415 $c["ui.factory.counter"],
1416 $c["ui.factory.glyph"],
1417 $c["ui.factory.button"],
1418 $c["ui.factory.listing"],
1419 $c["ui.factory.image"],
1420 $c["ui.factory.panel"],
1421 $c["ui.factory.modal"],
1422 $c["ui.factory.dropzone"],
1423 $c["ui.factory.popover"],
1424 $c["ui.factory.divider"],
1425 $c["ui.factory.link"],
1426 $c["ui.factory.dropdown"],
1427 $c["ui.factory.item"],
1428 $c["ui.factory.icon"],
1429 $c["ui.factory.viewcontrol"],
1430 $c["ui.factory.chart"],
1431 $c["ui.factory.input"],
1432 $c["ui.factory.table"],
1433 $c["ui.factory.messagebox"],
1434 $c["ui.factory.card"]
1435 );
1436 };
1437 $c["ui.signal_generator"] = function ($c) {
1439 };
1440 $c["ui.factory.counter"] = function ($c) {
1442 };
1443 $c["ui.factory.glyph"] = function ($c) {
1445 };
1446 $c["ui.factory.button"] = function ($c) {
1448 };
1449 $c["ui.factory.listing"] = function ($c) {
1451 };
1452 $c["ui.factory.image"] = function ($c) {
1454 };
1455 $c["ui.factory.panel"] = function ($c) {
1456 return new ILIAS\UI\Implementation\Component\Panel\Factory($c["ui.factory.panel.listing"]);
1457 };
1458 $c["ui.factory.modal"] = function ($c) {
1459 return new ILIAS\UI\Implementation\Component\Modal\Factory($c["ui.signal_generator"]);
1460 };
1461 $c["ui.factory.dropzone"] = function ($c) {
1462 return new ILIAS\UI\Implementation\Component\Dropzone\Factory($c["ui.factory.dropzone.file"]);
1463 };
1464 $c["ui.factory.popover"] = function ($c) {
1465 return new ILIAS\UI\Implementation\Component\Popover\Factory($c["ui.signal_generator"]);
1466 };
1467 $c["ui.factory.divider"] = function ($c) {
1469 };
1470 $c["ui.factory.link"] = function ($c) {
1472 };
1473 $c["ui.factory.dropdown"] = function ($c) {
1475 };
1476 $c["ui.factory.item"] = function ($c) {
1478 };
1479 $c["ui.factory.icon"] = function ($c) {
1481 };
1482 $c["ui.factory.viewcontrol"] = function ($c) {
1483 return new ILIAS\UI\Implementation\Component\ViewControl\Factory($c["ui.signal_generator"]);
1484 };
1485 $c["ui.factory.chart"] = function ($c) {
1486 return new ILIAS\UI\Implementation\Component\Chart\Factory($c["ui.factory.progressmeter"]);
1487 };
1488 $c["ui.factory.input"] = function ($c) {
1490 $c["ui.signal_generator"],
1491 $c["ui.factory.input.field"],
1492 $c["ui.factory.input.container"]
1493 );
1494 };
1495 $c["ui.factory.table"] = function ($c) {
1496 return new ILIAS\UI\Implementation\Component\Table\Factory($c["ui.signal_generator"]);
1497 };
1498 $c["ui.factory.messagebox"] = function ($c) {
1500 };
1501 $c["ui.factory.card"] = function ($c) {
1503 };
1504 $c["ui.factory.progressmeter"] = function ($c) {
1506 };
1507 $c["ui.factory.dropzone.file"] = function ($c) {
1509 };
1510 $c["ui.factory.input.field"] = function ($c) {
1511 $data_factory = new ILIAS\Data\Factory();
1512 $validation_factory = new ILIAS\Validation\Factory($data_factory, $c["lng"]);
1513 $transformation_factory = new ILIAS\Transformation\Factory();
1515 $c["ui.signal_generator"],
1516 $data_factory,
1517 $validation_factory,
1518 $transformation_factory
1519 );
1520 };
1521 $c["ui.factory.input.container"] = function ($c) {
1523 $c["ui.factory.input.container.form"]
1524 );
1525 };
1526 $c["ui.factory.input.container.form"] = function ($c) {
1528 $c["ui.factory.input.field"]
1529 );
1530 };
1531 $c["ui.factory.panel.listing"] = function ($c) {
1533 };
1534
1535 $c["ui.renderer"] = function ($c) {
1537 $c["ui.component_renderer_loader"]
1538 );
1539 };
1540 $c["ui.component_renderer_loader"] = function ($c) {
1542 new ILIAS\UI\Implementation\Render\LoaderResourceRegistryWrapper(
1543 $c["ui.resource_registry"],
1544 new ILIAS\UI\Implementation\Render\FSLoader(
1545 new ILIAS\UI\Implementation\Render\DefaultRendererFactory(
1546 $c["ui.factory"],
1547 $c["ui.template_factory"],
1548 $c["lng"],
1549 $c["ui.javascript_binding"]
1550 ),
1551 new ILIAS\UI\Implementation\Component\Glyph\GlyphRendererFactory(
1552 $c["ui.factory"],
1553 $c["ui.template_factory"],
1554 $c["lng"],
1555 $c["ui.javascript_binding"]
1556 )
1557 )
1558 )
1559 );
1560 };
1561 $c["ui.template_factory"] = function ($c) {
1563 $c["tpl"]
1564 );
1565 };
1566 $c["ui.resource_registry"] = function ($c) {
1568 };
1569 $c["ui.javascript_binding"] = function ($c) {
1571 };
1572 }
Builds data types.
Definition: Factory.php:15
Factory for basic transformations.
Definition: Factory.php:12
Implementation of factory for cards.
Definition: Factory.php:13
Implementation of factory for tables.
Definition: Factory.php:13
Renderer that dispatches rendering of UI components to a Renderer found in the same namespace as the ...
Caches renderers loaded by another loader.
Wraps global ilTemplate to provide JavaScriptBinding.
This is how a factory for buttons looks like.
Definition: Factory.php:13
This is how the factory for UI elements looks.
Definition: Factory.php:16
Class Factory.

References $c.

Referenced by initHTML().

+ Here is the caller graph for this function:

◆ initUser()

static ilInitialisation::initUser ( )
staticprotected

Init user / authentification (level 2)

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

1239 {
1240 global $ilias, $ilUser;
1241
1242 // $ilUser
1244 "ilUser",
1245 "ilObjUser",
1246 "./Services/User/classes/class.ilObjUser.php"
1247 );
1248 $ilias->account = $ilUser;
1249
1251 }
static initAccessHandling()
$ilAccess and $rbac... initialisation

References $ilUser, initAccessHandling(), and initGlobal().

Referenced by initILIAS().

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

◆ recursivelyRemoveUnsafeCharacters()

static ilInitialisation::recursivelyRemoveUnsafeCharacters (   $var)
staticprotected

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

52 {
53 if (is_array($var)) {
54 $mod = [];
55 foreach ($var as $k => $v) {
58 }
59 return $mod;
60 }
61 return strip_tags(
62 str_replace(
63 array("\x00", "\n", "\r", "\\", "'", '"', "\x1a"),
64 "",
65 $var
66 )
67 );
68 }
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 (   $a_target,
  $a_message_id = '',
array  $a_message_static = null 
)
staticprotected

Redirects to target url if context supports it.

Parameters
string$a_target
string$a_message_id
array$a_message_details

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

1856 {
1857 // #12739
1858 if (defined("ILIAS_HTTP_PATH") &&
1859 !stristr($a_target, ILIAS_HTTP_PATH)) {
1860 $a_target = ILIAS_HTTP_PATH . "/" . $a_target;
1861 }
1862
1863 foreach (['ext_uid', 'soap_pw'] as $param) {
1864 if (false === strpos($a_target, $param . '=') && isset($GLOBALS['DIC']->http()->request()->getQueryParams()[$param])) {
1865 $a_target = \ilUtil::appendUrlParameterString($a_target, $param . '=' . \ilUtil::stripSlashes(
1866 $GLOBALS['DIC']->http()->request()->getQueryParams()[$param]
1867 ));
1868 }
1869 }
1870
1872 ilUtil::redirect($a_target);
1873 } else {
1874 $message = self::translateMessage($a_message_id, $a_message_static);
1875
1876 // user-directed linked message
1878 $link = self::translateMessage(
1879 "init_error_redirect_click",
1880 array("en" => 'Please click to continue.',
1881 "de" => 'Bitte klicken um fortzufahren.')
1882 );
1883 $mess = $message .
1884 '<br /><a href="' . $a_target . '">' . $link . '</a>';
1885 }
1886 // plain text
1887 else {
1888 // not much we can do here
1889 $mess = $message;
1890
1891 if (!trim($mess)) {
1892 $mess = self::translateMessage(
1893 "init_error_redirect_info",
1894 array("en" => 'Redirect not supported by context.',
1895 "de" => 'Weiterleitungen werden durch Kontext nicht unterstützt.')
1896 ) .
1897 ' (' . $a_target . ')';
1898 }
1899 }
1900
1901 self::abortAndDie($mess);
1902 }
1903 }
static supportsRedirects()
Are redirects supported?
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
static redirect($a_script)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
catch(Exception $e) $message
static http()
Fetches the global http state from ILIAS.

References $GLOBALS, $message, abortAndDie(), ilUtil\appendUrlParameterString(), ilContext\hasHTML(), ILIAS\FileDelivery\http(), ilUtil\redirect(), ilUtil\stripSlashes(), ilContext\supportsRedirects(), translateMessage(), and ilContext\usesHTTP().

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

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

◆ reinitILIAS()

static ilInitialisation::reinitILIAS ( )
static

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

988 {
989 self::$already_initialized = false;
991 }
static initILIAS()
ilias initialisation

References initILIAS().

Referenced by ilSoapAdministration\initIlias().

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

43 {
44 // Remove unsafe characters from GET parameters.
45 // We do not need this characters in any case, so it is
46 // feasible to filter them everytime. POST parameters
47 // need attention through ilUtil::stripSlashes() and similar functions)
49 }

References $_GET, and recursivelyRemoveUnsafeCharacters().

Referenced by initCore().

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

◆ requireCommonIncludes()

static ilInitialisation::requireCommonIncludes ( )
staticprotected

get common include code files

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

74 {
75 // ilTemplate
77 require_once "./Services/UICore/classes/class.ilTemplate.php";
78 }
79
80 // really always required?
81 require_once "./Services/Utilities/classes/class.ilUtil.php";
82 require_once "./Services/Calendar/classes/class.ilDatePresentation.php";
83 require_once "include/inc.ilias_version.php";
84
85 include_once './Services/Authentication/classes/class.ilAuthUtils.php';
86
87 self::initGlobal("ilBench", "ilBenchmark", "./Services/Utilities/classes/class.ilBenchmark.php");
88 }
static usesTemplate()
Uses template engine.

References initGlobal(), and ilContext\usesTemplate().

Referenced by initCore().

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

◆ resumeUserSession()

static ilInitialisation::resumeUserSession ( )
static

Resume an existing user session.

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

1257 {
1258 include_once './Services/Authentication/classes/class.ilAuthUtils.php';
1261 }
1262
1263 if (
1264 !$GLOBALS['DIC']['ilAuthSession']->isAuthenticated() or
1265 $GLOBALS['DIC']['ilAuthSession']->isExpired()
1266 ) {
1267 ilLoggerFactory::getLogger('init')->debug('Current session is invalid: ' . $GLOBALS['DIC']['ilAuthSession']->getId());
1268 $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
1269 if (self::blockedAuthentication($current_script)) {
1270 ilLoggerFactory::getLogger('init')->debug('Authentication is started in current script.');
1271 // nothing todo: authentication is done in current script
1272 return;
1273 }
1274 return self::handleAuthenticationFail();
1275 }
1276 // valid session
1277 return self::initUserAccount();
1278 }
static isAuthenticationForced()
Check if authentication is should be forced.
static handleForcedAuthentication()

References $_SERVER, $GLOBALS, ilLoggerFactory\getLogger(), ilAuthUtils\handleForcedAuthentication(), and ilAuthUtils\isAuthenticationForced().

Referenced by initILIAS().

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

◆ setCookieConstants()

static ilInitialisation::setCookieConstants ( )
staticprotected

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

536 {
537 include_once 'Services/Authentication/classes/class.ilAuthFactory.php';
539 $cookie_path = '/';
540 } elseif ($GLOBALS['COOKIE_PATH']) {
541 // use a predefined cookie path from WebAccessChecker
542 $cookie_path = $GLOBALS['COOKIE_PATH'];
543 } else {
544 $cookie_path = dirname($_SERVER['PHP_SELF']);
545 }
546
547 /* if ilias is called directly within the docroot $cookie_path
548 is set to '/' expecting on servers running under windows..
549 here it is set to '\'.
550 in both cases a further '/' won't be appended due to the following regex
551 */
552 $cookie_path .= (!preg_match("/[\/|\\\\]$/", $cookie_path)) ? "/" : "";
553
554 if ($cookie_path == "\\") {
555 $cookie_path = '/';
556 }
557
558 define('IL_COOKIE_HTTPONLY', true); // Default Value
559 define('IL_COOKIE_EXPIRE', 0);
560 define('IL_COOKIE_PATH', $cookie_path);
561 define('IL_COOKIE_DOMAIN', '');
562 }
$cookie_path
Definition: metadata.php:7

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

Referenced by initClient().

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

◆ setSessionCookieParams()

static ilInitialisation::setSessionCookieParams ( )
staticprotected

set session cookie params

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

568 {
569 global $ilSetting;
570
571 if (!defined('IL_COOKIE_SECURE')) {
572 // If this code is executed, we can assume that \ilHTTPS::enableSecureCookies was NOT called before
573 // \ilHTTPS::enableSecureCookies already executes session_set_cookie_params()
574
575 include_once './Services/Http/classes/class.ilHTTPS.php';
576 $cookie_secure = !$ilSetting->get('https', 0) && ilHTTPS::getInstance()->isDetected();
577 define('IL_COOKIE_SECURE', $cookie_secure); // Default Value
578
579 session_set_cookie_params(
580 IL_COOKIE_EXPIRE,
582 IL_COOKIE_DOMAIN,
583 IL_COOKIE_SECURE,
584 IL_COOKIE_HTTPONLY
585 );
586 }
587 }
const IL_COOKIE_PATH(isset($_GET["client_id"]))
Definition: metadata.php:32
static getInstance()
Get https instance.

References $ilSetting, ilHTTPS\getInstance(), and IL_COOKIE_PATH.

Referenced by initClient().

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

◆ setSessionHandler()

static ilInitialisation::setSessionHandler ( )
static

set session handler to db

Used in Soap/CAS

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

512 {
513 if (ini_get('session.save_handler') != 'user' && version_compare(PHP_VERSION, '7.2.0', '<')) {
514 ini_set("session.save_handler", "user");
515 }
516
517 require_once "Services/Authentication/classes/class.ilSessionDBHandler.php";
518 $db_session_handler = new ilSessionDBHandler();
519 if (!$db_session_handler->setSaveHandler()) {
520 self::abortAndDie("Please turn off Safe mode OR set session.save_handler to \"user\" in your php.ini");
521 }
522
523 // Do not accept external session ids
524 if (!ilSession::_exists(session_id()) && !defined('IL_PHPUNIT_TEST')) {
525 // php7-todo, correct-with-php5-removal : alex, 1.3.2016: added if, please check
526 if (function_exists("session_status") && session_status() == PHP_SESSION_ACTIVE) {
527 session_regenerate_id();
528 }
529 }
530 }
Database Session Handling.
static _exists($a_session_id)
Check whether session exists.

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

Referenced by initClient().

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

◆ showingLoginForm()

static ilInitialisation::showingLoginForm (   $a_current_script)
staticprotected

Is current view the login form?

Returns
boolean

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

1789 {
1790 if ($a_current_script == "login.php") {
1791 return true;
1792 }
1793
1794 if ($_REQUEST["baseClass"] == "ilStartUpGUI" &&
1795 self::getCurrentCmd() == "showLoginPage") {
1796 return true;
1797 }
1798
1799 return false;
1800 }

◆ translateMessage()

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

Translate message if possible.

Parameters
string$a_message_id
array$a_message_static
Returns
string

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

1810 {
1811 global $ilDB, $lng, $ilSetting, $ilClientIniFile, $ilUser;
1812
1813 // current language
1814 if (!$lng) {
1815 $lang = "en";
1816 if ($ilUser) {
1817 $lang = $ilUser->getLanguage();
1818 } elseif ($_REQUEST["lang"]) {
1819 $lang = (string) $_REQUEST["lang"];
1820 } elseif ($ilSetting) {
1821 $lang = $ilSetting->get("language");
1822 } elseif ($ilClientIniFile) {
1823 $lang = $ilClientIniFile->readVariable("language", "default");
1824 }
1825 } else {
1826 $lang = $lng->getLangKey();
1827 }
1828
1829 $message = "";
1830 if ($ilDB && $a_message_id) {
1831 if (!$lng) {
1832 require_once "./Services/Language/classes/class.ilLanguage.php";
1833 $lng = new ilLanguage($lang);
1834 }
1835
1836 $lng->loadLanguageModule("init");
1837 $message = $lng->txt($a_message_id);
1838 } elseif (is_array($a_message_static)) {
1839 if (!isset($a_message_static[$lang])) {
1840 $lang = "en";
1841 }
1842 $message = $a_message_static[$lang];
1843 }
1844
1845 return utf8_decode($message);
1846 }
language handling
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
Definition: langwiz.php:349
$lng

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

Referenced by handleMaintenanceMode(), and redirect().

+ Here is the caller graph for this function:

Field Documentation

◆ $already_initialized

ilInitialisation::$already_initialized
staticprotected

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


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