ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 More...
 
static initUserAccount ()
 Init user with current account id. 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 initUIFramework (\ILIAS\DI\Container $c)
 init the ILIAS UI framework. 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 initAccessibilityControlConcept (\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 initRefinery (\ILIAS\DI\Container $container)
 
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 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 initGlobalScreen (\ILIAS\DI\Container $c)
 
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 40 of file class.ilInitialisation.php.

Member Function Documentation

◆ abortAndDie()

static ilInitialisation::abortAndDie (   $a_message)
staticprotected

Exit.

Parameters
string$a_message

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

1003 {
1004 if (is_object($GLOBALS['ilLog'])) {
1005 $GLOBALS['ilLog']->write("Fatal Error: ilInitialisation - " . $a_message);
1006 $GLOBALS['ilLog']->logStack();
1007 }
1008 die($a_message);
1009 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64

References $GLOBALS.

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

+ Here is the caller graph for this function:

◆ blockedAuthentication()

static ilInitialisation::blockedAuthentication (   $a_current_script)
staticprotected

Block authentication based on current request.

Returns
boolean

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

1774 {
1776 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for WAC request.');
1777 return true;
1778 }
1780 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for sso request.');
1781 return true;
1782 }
1784 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for webdav request');
1785 return true;
1786 }
1788 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for shibboleth request.');
1789 return true;
1790 }
1792 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for lti provider requests.');
1793 return true;
1794 }
1796 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for SAML request.');
1797 return true;
1798 }
1799 if (
1800 $a_current_script == "register.php" ||
1801 $a_current_script == "pwassist.php" ||
1802 $a_current_script == "confirmReg.php" ||
1803 $a_current_script == "il_securimage_play.php" ||
1804 $a_current_script == "il_securimage_show.php" ||
1805 $a_current_script == 'login.php'
1806 ) {
1807 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for script: ' . $a_current_script);
1808 return true;
1809 }
1810
1811 $requestBaseClass = strtolower($_REQUEST['baseClass']);
1812 if ($requestBaseClass == strtolower(ilStartUpGUI::class)) {
1813 $requestCmdClass = strtolower($_REQUEST['cmdClass']);
1814 if (
1815 $requestCmdClass == strtolower(ilAccountRegistrationGUI::class) ||
1816 $requestCmdClass == strtolower(ilPasswordAssistanceGUI::class)
1817 ) {
1818 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for cmdClass: ' . $requestCmdClass);
1819 return true;
1820 }
1821 $cmd = self::getCurrentCmd();
1822 if (
1823 $cmd == "showTermsOfService" || $cmd == "showClientList" ||
1824 $cmd == 'showAccountMigration' || $cmd == 'migrateAccount' ||
1825 $cmd == 'processCode' || $cmd == 'showLoginPage' || $cmd == 'showLogout' ||
1826 $cmd == 'doStandardAuthentication' || $cmd == 'doCasAuthentication'
1827 ) {
1828 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for cmd: ' . $cmd);
1829 return true;
1830 }
1831 }
1832
1833 // #12884
1834 if (($a_current_script == "goto.php" && $_GET["target"] == "impr_0") ||
1835 strtolower($_GET["baseClass"]) == strtolower(ilImprintGUI::class)) {
1836 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for baseClass: ' . $_GET['baseClass']);
1837 return true;
1838 }
1839
1840 if ($a_current_script == 'goto.php' && in_array($_GET['target'], array(
1841 'usr_registration', 'usr_nameassist', 'usr_pwassist', 'usr_agreement'
1842 ))) {
1843 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for goto target: ' . $_GET['target']);
1844 return true;
1845 }
1846 ilLoggerFactory::getLogger('auth')->debug('Authentication required');
1847 return false;
1848 }
$_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 307 of file class.ilInitialisation.php.

308 {
309 include_once './Services/Http/classes/class.ilHTTPS.php';
310 $https = new ilHTTPS();
311
312 if ($https->isDetected()) {
313 $protocol = 'https://';
314 } else {
315 $protocol = 'http://';
316 }
317 $host = $_SERVER['HTTP_HOST'];
318
319 $rq_uri = strip_tags($_SERVER['REQUEST_URI']);
320
321 // security fix: this failed, if the URI contained "?" and following "/"
322 // -> we remove everything after "?"
323 if (is_int($pos = strpos($rq_uri, "?"))) {
324 $rq_uri = substr($rq_uri, 0, $pos);
325 }
326
327 if (!defined('ILIAS_MODULE')) {
328 $path = pathinfo($rq_uri);
329 if (!$path['extension']) {
330 $uri = $rq_uri;
331 } else {
332 $uri = dirname($rq_uri);
333 }
334 } else {
335 // if in module remove module name from HTTP_PATH
336 $path = dirname($rq_uri);
337
338 // dirname cuts the last directory from a directory path e.g content/classes return content
340
341 $dirs = explode('/', $module);
342 $uri = $path;
343 foreach ($dirs as $dir) {
344 $uri = dirname($uri);
345 }
346 }
347
348 $iliasHttpPath = implode('', [$protocol, $host, $uri]);
352 if (strpos($iliasHttpPath, '/Services/Saml/lib/') !== false && strpos($iliasHttpPath, '/metadata.php') === false) {
353 $iliasHttpPath = substr($iliasHttpPath, 0, strpos($iliasHttpPath, '/Services/Saml/lib/'));
354 }
355 }
356
357 $f = new \ILIAS\Data\Factory();
359
360 return define('ILIAS_HTTP_PATH', $uri->getBaseURI());
361 }
HTTPS.
static removeTrailingPathSeparators($path)
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
$iliasHttpPath
$https
Definition: imgupload.php:19
const ILIAS_MODULE
Definition: server.php:14

References $_SERVER, Vendor\Package\$f, $https, $iliasHttpPath, 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 367 of file class.ilInitialisation.php.

368 {
369 global $ilIliasIniFile;
370
371 // check whether ini file object exists
372 if (!is_object($ilIliasIniFile)) {
373 self::abortAndDie('Fatal Error: ilInitialisation::determineClient called without initialisation of ILIAS ini file object.');
374 }
375
376 if (isset($_GET['client_id']) && strlen($_GET['client_id']) > 0) {
377 $_GET['client_id'] = \ilUtil::getClientIdByString((string) $_GET['client_id'])->toString();
378 if (!defined('IL_PHPUNIT_TEST')) {
380 ilUtil::setCookie('ilClientId', $_GET['client_id']);
381 }
382 }
383 } elseif (!isset($_COOKIE['ilClientId'])) {
384 ilUtil::setCookie('ilClientId', $ilIliasIniFile->readVariable('clients', 'default'));
385 }
386
387 if (!defined('IL_PHPUNIT_TEST') && ilContext::supportsPersistentSessions()) {
388 $clientId = $_COOKIE['ilClientId'];
389 } else {
390 $clientId = $_GET['client_id'];
391 }
392
393 define('CLIENT_ID', \ilUtil::getClientIdByString((string) $clientId)->toString());
394 }
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)
$ilIliasIniFile
$_COOKIE[session_name()]
Definition: xapitoken.php:39

References $_COOKIE, $_GET, $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 1758 of file class.ilInitialisation.php.

1759 {
1760 $cmd = $_REQUEST["cmd"];
1761 if (is_array($cmd)) {
1762 return array_shift(array_keys($cmd));
1763 } else {
1764 return $cmd;
1765 }
1766 }

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

882 {
883 ilLoggerFactory::getLogger('init')->debug('Redirecting to login page.');
884
885 if ($GLOBALS['DIC']['ilAuthSession']->isExpired()) {
887 }
888 if (!$GLOBALS['DIC']['ilAuthSession']->isAuthenticated()) {
890 }
891
892 $script = "login.php?target=" . $_GET["target"] . "&client_id=" . $_COOKIE["ilClientId"] .
893 "&auth_stat=" . $a_auth_stat;
894
896 $script,
897 "init_error_authentication_fail",
898 array(
899 "en" => "Authentication failed.",
900 "de" => "Authentifizierung fehlgeschlagen.")
901 );
902 }
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 826 of file class.ilInitialisation.php.

827 {
828 global $ilAuth;
829
830 if (ANONYMOUS_USER_ID == "") {
831 self::abortAndDie("Public Section enabled, but no Anonymous user found.");
832 }
833
834 $session_destroyed = false;
835 if ($GLOBALS['DIC']['ilAuthSession']->isExpired()) {
836 $session_destroyed = true;
838 }
839 if (!$GLOBALS['DIC']['ilAuthSession']->isAuthenticated()) {
840 $session_destroyed = true;
842 }
843
844 if ($session_destroyed) {
845 $GLOBALS['DIC']['ilAuthSession']->setAuthenticated(true, ANONYMOUS_USER_ID);
846 }
847
849
850 // if target given, try to go there
851 if (strlen($_GET["target"])) {
852 // when we are already "inside" goto.php no redirect is needed
853 $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
854 if ($current_script == "goto.php") {
855 return;
856 }
857 // goto will check if target is accessible or redirect to login
858 self::redirect("goto.php?target=" . $_GET["target"]);
859 }
860
861 // check access of root folder otherwise redirect to login
862 #if(!$GLOBALS['DIC']->rbac()->system()->checkAccess('read', ROOT_FOLDER_ID))
863 #{
864 # return self::goToLogin();
865 #}
866
867 // we do not know if ref_id of request is accesible, so redirecting to root
868 $_GET["ref_id"] = ROOT_FOLDER_ID;
869 $_GET["cmd"] = "frameset";
871 "ilias.php?baseClass=ilrepositorygui&reloadpublic=1&cmd=" .
872 $_GET["cmd"] . "&ref_id=" . $_GET["ref_id"]
873 );
874 }
static initUserAccount()
Init user with current account id.
const SESSION_CLOSE_PUBLIC

References $_GET, $_SERVER, $GLOBALS, abortAndDie(), initUserAccount(), 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 1014 of file class.ilInitialisation.php.

1015 {
1016 if (defined(SHOWNOTICES) && SHOWNOTICES) {
1017 // no further differentiating of php version regarding to 5.4 neccessary
1018 // when the error reporting is set to E_ALL anyway
1019
1020 // add notices to error reporting
1021 error_reporting(E_ALL);
1022 }
1023
1024 if (defined('DEBUGTOOLS') && DEBUGTOOLS) {
1025 include_once "include/inc.debug.php";
1026 }
1027 }

Referenced by initClient().

+ Here is the caller graph for this function:

◆ handleErrorReporting()

static ilInitialisation::handleErrorReporting ( )
static

Set error reporting level.

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

1106 {
1107 // push the error level as high as possible / sane
1108 error_reporting(E_ALL & ~E_NOTICE);
1109
1110 // see handleDevMode() - error reporting might be overwritten again
1111 // but we need the client ini first
1112 }

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

490 {
491 global $ilClientIniFile;
492
493 if (!$ilClientIniFile->readVariable("client", "access")) {
494 $mess = array(
495 "en" => "The server is not available due to maintenance." .
496 " We apologise for any inconvenience.",
497 "de" => "Der Server ist aufgrund von Wartungsarbeiten nicht verfügbar." .
498 " Wir bitten um Verständnis."
499 );
500 $mess_id = "init_error_maintenance";
501
502 if (ilContext::hasHTML() && is_file("./maintenance.html")) {
503 self::redirect("./maintenance.html", $mess_id, $mess);
504 } else {
505 $mess = self::translateMessage($mess_id, $mess);
506 self::abortAndDie($mess);
507 }
508 }
509 }
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 98 of file class.ilInitialisation.php.

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

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

935 {
937 "rbacreview",
938 "ilRbacReview",
939 "./Services/AccessControl/classes/class.ilRbacReview.php"
940 );
941
942 require_once "./Services/AccessControl/classes/class.ilRbacSystem.php";
943 $rbacsystem = ilRbacSystem::getInstance();
944 self::initGlobal("rbacsystem", $rbacsystem);
945
947 "rbacadmin",
948 "ilRbacAdmin",
949 "./Services/AccessControl/classes/class.ilRbacAdmin.php"
950 );
951
953 "ilAccess",
954 "ilAccess",
955 "./Services/AccessControl/classes/class.ilAccess.php"
956 );
957
958 require_once "./Services/Conditions/classes/class.ilConditionHandler.php";
959 }
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:

◆ initAccessibilityControlConcept()

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

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

673 {
674 $c['acc.criteria.type.factory'] = function (\ILIAS\DI\Container $c) {
675 return new ilAccessibilityCriterionTypeFactory($c->rbac()->review(), $c['ilObjDataCache']);
676 };
677
678 $c['acc.document.evaluator'] = function (\ILIAS\DI\Container $c) {
681 $c['acc.criteria.type.factory'],
682 $c->user(),
683 $c->logger()->acc()
684 ),
685 $c->user(),
686 $c->logger()->acc(),
687 \ilAccessibilityDocument::orderBy('sorting')->get()
688 );
689 };
690 }
static orderBy($orderBy, $orderDirection='ASC')
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:18
Interface ilAccessibilitySequentialDocumentEvaluation.

References Vendor\Package\$c, and ActiveRecord\orderBy().

Referenced by initClient().

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

643 {
644 $c["user.avatar.factory"] = function ($c) {
645 return new \ilUserAvatarFactory($c);
646 };
647 }

References Vendor\Package\$c.

Referenced by initClient().

+ Here is the caller graph for this function:

◆ initBackgroundTasks()

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

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

1983 {
1984 global $ilIliasIniFile;
1985
1986 $n_of_tasks = $ilIliasIniFile->readVariable("background_tasks", "number_of_concurrent_tasks");
1987 $sync = $ilIliasIniFile->readVariable("background_tasks", "concurrency");
1988
1989 $n_of_tasks = $n_of_tasks ? $n_of_tasks : 5;
1990 $sync = $sync ? $sync : 'sync'; // The default value is sync.
1991
1992 $c["bt.task_factory"] = function ($c) {
1993 return new \ILIAS\BackgroundTasks\Implementation\Tasks\BasicTaskFactory($c["di.injector"]);
1994 };
1995
1996 $c["bt.persistence"] = function ($c) {
1997 return BasicPersistence::instance();
1998 };
1999
2000 $c["bt.injector"] = function ($c) {
2001 return new \ILIAS\BackgroundTasks\Dependencies\Injector($c, new BaseDependencyMap());
2002 };
2003
2004 $c["bt.task_manager"] = function ($c) use ($sync) {
2005 if ($sync == 'sync') {
2006 return new \ILIAS\BackgroundTasks\Implementation\TaskManager\SyncTaskManager($c["bt.persistence"]);
2007 } elseif ($sync == 'async') {
2008 return new \ILIAS\BackgroundTasks\Implementation\TaskManager\AsyncTaskManager($c["bt.persistence"]);
2009 } else {
2010 throw new ilException("The supported Background Task Managers are sync and async. $sync given.");
2011 }
2012 };
2013 }
Base class for ILIAS Exception handling.

References Vendor\Package\$c, and $ilIliasIniFile.

Referenced by initILIAS().

+ Here is the caller graph for this function:

◆ initClient()

static ilInitialisation::initClient ( )
staticprotected

Init client-based objects (level 1)

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

1160 {
1161 global $https, $ilias, $DIC;
1162
1164
1166
1167 self::bootstrapFilesystems();
1168
1170
1171
1172 // --- needs client ini
1173
1174 $ilias->client_id = CLIENT_ID;
1175
1176 if (DEVMODE) {
1178 }
1179
1180
1182
1184
1185 // init dafault language
1186 self::initLanguage(false);
1187
1188 // moved after databases
1189 self::initLog();
1190
1192 "ilAppEventHandler",
1193 "ilAppEventHandler",
1194 "./Services/EventHandling/classes/class.ilAppEventHandler.php"
1195 );
1196
1197 // there are rare cases where initILIAS is called twice for a request
1198 // example goto.php is called and includes ilias.php later
1199 // we must prevent that ilPluginAdmin is initialized twice in
1200 // this case, since this won't get the values out of plugin.php the
1201 // second time properly
1202 if (!isset($DIC["ilPluginAdmin"]) || !$DIC["ilPluginAdmin"] instanceof ilPluginAdmin) {
1204 "ilPluginAdmin",
1205 "ilPluginAdmin",
1206 "./Services/Component/classes/class.ilPluginAdmin.php"
1207 );
1208 }
1209
1212 self::initMail($GLOBALS['DIC']);
1213 self::initAvatar($GLOBALS['DIC']);
1217
1218
1219 // --- needs settings
1220
1222
1223 if (ilContext::usesHTTP()) {
1224 // $https
1225 self::initGlobal("https", "ilHTTPS", "./Services/Http/classes/class.ilHTTPS.php");
1226 $https->enableSecureCookies();
1227 $https->checkPort();
1228 }
1229
1230
1231 // --- object handling
1232
1234 "ilObjDataCache",
1235 "ilObjectDataCache",
1236 "./Services/Object/classes/class.ilObjectDataCache.php"
1237 );
1238
1239 // needed in ilObjectDefinition
1240 require_once "./Services/Xml/classes/class.ilSaxParser.php";
1241
1243 "objDefinition",
1244 "ilObjectDefinition",
1245 "./Services/Object/classes/class.ilObjectDefinition.php"
1246 );
1247
1248 // $tree
1249 require_once "./Services/Tree/classes/class.ilTree.php";
1250 $tree = new ilTree(ROOT_FOLDER_ID);
1251 self::initGlobal("tree", $tree);
1252 unset($tree);
1253
1255 "ilCtrl",
1256 "ilCtrl",
1257 "./Services/UICore/classes/class.ilCtrl.php"
1258 );
1259
1261
1262 // Init GlobalScreen
1264 }
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 initGlobalScreen(\ILIAS\DI\Container $c)
static initMail(\ILIAS\DI\Container $c)
static initTermsOfService(\ILIAS\DI\Container $c)
static initAccessibilityControlConcept(\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...
$DIC
Definition: xapitoken.php:46

References $DIC, $GLOBALS, $https, determineClient(), handleDevMode(), handleMaintenanceMode(), initAccessibilityControlConcept(), initAvatar(), initClientIniFile(), initCustomObjectIcons(), initDatabase(), initGlobal(), initGlobalScreen(), 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

Reimplemented in XapiProxy\ilInitialisation, and LTI\ilInitialisation.

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

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

References $_COOKIE, Vendor\Package\$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 1117 of file class.ilInitialisation.php.

1118 {
1119 global $ilErr;
1120
1122
1123 // breaks CAS: must be included after CAS context isset in AuthUtils
1124 //self::includePhp5Compliance();
1125
1127
1128
1129 // error handler
1131 "ilErr",
1132 "ilErrorHandling",
1133 "./Services/Init/classes/class.ilErrorHandling.php"
1134 );
1135 $ilErr->setErrorHandling(PEAR_ERROR_CALLBACK, array($ilErr, 'errorHandler'));
1136
1137 // :TODO: obsolete?
1138 // PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($ilErr, "errorHandler"));
1139
1140 // workaround: load old post variables if error handler 'message' was called
1141 include_once "Services/Authentication/classes/class.ilSession.php";
1142 if (ilSession::get("message")) {
1143 $_POST = ilSession::get("post_vars");
1144 }
1145
1147
1149
1150 define('IL_INITIAL_WD', getcwd());
1151
1152 // deprecated
1153 self::initGlobal("ilias", "ILIAS", "./Services/Init/classes/class.ilias.php");
1154 }
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.
$ilErr
Definition: raiseError.php:18

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

628 {
629 $c["object.customicons.factory"] = function ($c) {
630 require_once 'Services/Object/Icon/classes/class.ilObjectCustomIconFactory.php';
631 return new ilObjectCustomIconFactory(
632 $c->filesystem()->web(),
633 $c->upload(),
634 $c['ilObjDataCache']
635 );
636 };
637 }
Class ilObjectCustomIconFactory.

References Vendor\Package\$c.

Referenced by initClient().

+ Here is the caller graph for this function:

◆ initDatabase()

static ilInitialisation::initDatabase ( )
staticprotected

initialise database object $ilDB

Reimplemented in XapiProxy\ilInitialisation, and LTI\ilInitialisation.

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

516 {
517 // build dsn of database connection and connect
519 $ilDB->initFromIniFile();
520 $ilDB->connect();
521
522 self::initGlobal("ilDB", $ilDB);
523 }
global $ilDB

References $ilDB, ilDBWrapperFactory\getWrapper(), 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 284 of file class.ilInitialisation.php.

285 {
286 $dic['upload.processor-manager'] = function ($c) {
287 return new PreProcessorManagerImpl();
288 };
289
290 $dic['upload'] = function (\ILIAS\DI\Container $c) {
291 $fileUploadImpl = new \ILIAS\FileUpload\FileUploadImpl($c['upload.processor-manager'], $c['filesystem'], $c['http']);
292 if (IL_VIRUS_SCANNER != "None") {
293 $fileUploadImpl->register(new VirusScannerPreProcessor(ilVirusScannerFactory::_getInstance()));
294 }
295
296 $fileUploadImpl->register(new FilenameSanitizerPreProcessor());
297 $fileUploadImpl->register(new InsecureFilenameSanitizerPreProcessor());
298 $fileUploadImpl->register(new BlacklistExtensionPreProcessor(ilFileUtils::getExplicitlyBlockedFiles(), $c->language()->txt("msg_info_blacklisted")));
299
300 return $fileUploadImpl;
301 };
302 }
Class BlacklistExtensionPreProcessor PreProcessor which denies all blacklisted file extensions.
static getExplicitlyBlockedFiles()
$dic
Definition: result.php:13

References Vendor\Package\$c, $dic, ilVirusScannerFactory\_getInstance(), and ilFileUtils\getExplicitlyBlockedFiles().

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

Reimplemented in XapiProxy\ilInitialisation, and LTI\ilInitialisation.

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

982 {
983 global $DIC;
984
985 if ($a_source_file) {
986 include_once $a_source_file;
987 $GLOBALS[$a_name] = new $a_class;
988 } else {
989 $GLOBALS[$a_name] = $a_class;
990 }
991
992 $DIC[$a_name] = function ($c) use ($a_name) {
993 return $GLOBALS[$a_name];
994 };
995 }

References Vendor\Package\$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)
staticprivate
Parameters
\ILIAS\DI\Container$c

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

1398 {
1399 $c['global_screen'] = function () use ($c) {
1400 return new Services(new ilGSProviderFactory($c), htmlentities(str_replace(" ", "_", ILIAS_VERSION)));
1401 };
1402 $c->globalScreen()->tool()->context()->stack()->clear();
1403 $c->globalScreen()->tool()->context()->claim()->main();
1404// $c->globalScreen()->tool()->context()->current()->addAdditionalData('DEVMODE', (bool) DEVMODE);
1405 }
Class ilGSProviderFactory.
const ILIAS_VERSION
Class ilAsqQuestionAuthoringFactory.

References Vendor\Package\$c, and ILIAS_VERSION.

Referenced by initClient().

+ Here is the caller graph for this function:

◆ initHTML()

static ilInitialisation::initHTML ( )
staticprotected

init HTML output (level 3)

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

1661 {
1662 global $ilUser, $DIC;
1663
1664 if (ilContext::hasUser()) {
1665 // load style definitions
1666 // use the init function with plugin hook here, too
1668 }
1669
1671 $tpl = new ilGlobalPageTemplate($DIC->globalScreen(), $DIC->ui(), $DIC->http());
1672 self::initGlobal("tpl", $tpl);
1673
1674 if (ilContext::hasUser()) {
1675 $request_adjuster = new ilUserRequestTargetAdjustment(
1676 $ilUser,
1677 $GLOBALS['DIC']['ilCtrl'],
1678 $GLOBALS['DIC']->http()->request()
1679 );
1680 $request_adjuster->adjust();
1681 }
1682
1683 require_once "./Services/UICore/classes/class.ilFrameTargetInfo.php";
1684
1686 "ilNavigationHistory",
1687 "ilNavigationHistory",
1688 "Services/Navigation/classes/class.ilNavigationHistory.php"
1689 );
1690
1692 "ilBrowser",
1693 "ilBrowser",
1694 "./Services/Utilities/classes/class.ilBrowser.php"
1695 );
1696
1698 "ilHelp",
1699 "ilHelpGUI",
1700 "Services/Help/classes/class.ilHelpGUI.php"
1701 );
1702
1704 "ilToolbar",
1705 "ilToolbarGUI",
1706 "./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php"
1707 );
1708
1710 "ilLocator",
1711 "ilLocatorGUI",
1712 "./Services/Locator/classes/class.ilLocatorGUI.php"
1713 );
1714
1716 "ilTabs",
1717 "ilTabsGUI",
1718 "./Services/UIComponent/Tabs/classes/class.ilTabsGUI.php"
1719 );
1720
1721 if (ilContext::hasUser()) {
1722 include_once './Services/MainMenu/classes/class.ilMainMenuGUI.php';
1723 $ilMainMenu = new ilMainMenuGUI("_top");
1724
1725 self::initGlobal("ilMainMenu", $ilMainMenu);
1726 unset($ilMainMenu);
1727
1728 // :TODO: tableGUI related
1729
1730 // set hits per page for all lists using table module
1731 $_GET['limit'] = (int) $ilUser->getPref('hits_per_page');
1732 ilSession::set('tbl_limit', $_GET['limit']);
1733
1734 // the next line makes it impossible to save the offset somehow in a session for
1735 // a specific table (I tried it for the user administration).
1736 // its not posssible to distinguish whether it has been set to page 1 (=offset = 0)
1737 // or not set at all (then we want the last offset, e.g. being used from a session var).
1738 // So I added the wrapping if statement. Seems to work (hopefully).
1739 // Alex April 14th 2006
1740 if (isset($_GET['offset']) && $_GET['offset'] != "") { // added April 14th 2006
1741 $_GET['offset'] = (int) $_GET['offset']; // old code
1742 }
1743
1744 self::initGlobal("lti", "ilLTIViewGUI", "./Services/LTI/classes/class.ilLTIViewGUI.php");
1745 $GLOBALS["DIC"]["lti"]->init();
1747 } else {
1748 // several code parts rely on ilObjUser being always included
1749 include_once "Services/User/classes/class.ilObjUser.php";
1750 }
1751 }
static hasUser()
Based on user authentication?
Class ilGlobalPageTemplate.
static initUIFramework(\ILIAS\DI\Container $c)
init the ILIAS UI framework.
static initKioskMode(\ILIAS\DI\Container $c)
static initStyle()
provide $styleDefinition object
Handles display of the main menu.
static set($a_var, $a_val)
Set a value.
Class ilUserAccountMaintenanceEnforcement.
static http()
Fetches the global http state from ILIAS.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
$ilUser
Definition: imgupload.php:18

References $_GET, $DIC, $GLOBALS, $ilUser, $tpl, ilContext\hasUser(), ILIAS\FileDelivery\http(), initGlobal(), 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 1365 of file class.ilInitialisation.php.

1366 {
1367 $container['http.request_factory'] = function ($c) {
1368 return new \ILIAS\HTTP\Request\RequestFactoryImpl();
1369 };
1370
1371 $container['http.response_factory'] = function ($c) {
1372 return new \ILIAS\HTTP\Response\ResponseFactoryImpl();
1373 };
1374
1375 $container['http.cookie_jar_factory'] = function ($c) {
1376 return new \ILIAS\HTTP\Cookies\CookieJarFactoryImpl();
1377 };
1378
1379 $container['http.response_sender_strategy'] = function ($c) {
1380 return new \ILIAS\HTTP\Response\Sender\DefaultResponseSenderStrategy();
1381 };
1382
1383 $container['http'] = function ($c) {
1384 return new \ILIAS\DI\HTTPServices(
1385 $c['http.response_sender_strategy'],
1386 $c['http.cookie_jar_factory'],
1387 $c['http.request_factory'],
1388 $c['http.response_factory']
1389 );
1390 };
1391 }
$container
Definition: wac.php:13

References Vendor\Package\$c, and $container.

Referenced by initILIAS().

+ Here is the caller graph for this function:

◆ initILIAS()

static ilInitialisation::initILIAS ( )
static

ilias initialisation

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

1042 {
1043 if (self::$already_initialized) {
1044 return;
1045 }
1046
1047 $GLOBALS["DIC"] = new \ILIAS\DI\Container();
1048 $GLOBALS["DIC"]["ilLoggerFactory"] = function ($c) {
1050 };
1051
1052 self::$already_initialized = true;
1053
1056 if (ilContext::initClient()) {
1060
1061 if (ilContext::hasUser()) {
1063
1066 }
1067 }
1068
1069 // init after Auth otherwise breaks CAS
1071
1072 // language may depend on user setting
1073 self::initLanguage(true);
1074 $GLOBALS['DIC']['tree']->initLangCode();
1075
1079
1080 if (ilContext::hasHTML()) {
1082 }
1084 }
1085 }
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 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)
static initRefinery(\ILIAS\DI\Container $container)

References Vendor\Package\$c, $GLOBALS, ilLoggerFactory\getInstance(), ilContext\hasHTML(), ilContext\hasUser(), includePhp5Compliance(), initBackgroundTasks(), ilContext\initClient(), initClient(), initCore(), initFileUploadService(), initHTML(), initHTTPServices(), initInjector(), initKioskMode(), initRefinery(), initSession(), initUser(), resumeUserSession(), and ilContext\supportsPersistentSessions().

Referenced by ilSoapFunctions\__call(), _initIliasForPreview(), ilSoapAdministration\getClientInfoXML(), ilSoapAdministration\getInstallationInfoXML(), ilNusoapUserAdministrationAdapter\handleSoapPlugins(), XapiProxy\DataService\initIlias(), LTI\ilLTIConsumerDataService\initIlias(), ilCalendarRemoteAccessHandler\initIlias(), ilWebAccessChecker\initILIAS(), reinitILIAS(), and ILIAS\GlobalScreen\Client\ContentRenderer\run().

+ 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, and LTI\ilInitialisation.

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

115 {
116 require_once("./Services/Init/classes/class.ilIniFile.php");
117 $ilIliasIniFile = new ilIniFile("./ilias.ini.php");
118 $ilIliasIniFile->read();
119 self::initGlobal('ilIliasIniFile', $ilIliasIniFile);
120
121 // initialize constants
122 define("ILIAS_DATA_DIR", $ilIliasIniFile->readVariable("clients", "datadir"));
123 define("ILIAS_WEB_DIR", $ilIliasIniFile->readVariable("clients", "path"));
124 define("ILIAS_ABSOLUTE_PATH", $ilIliasIniFile->readVariable('server', 'absolute_path'));
125
126 // logging
127 define("ILIAS_LOG_DIR", $ilIliasIniFile->readVariable("log", "path"));
128 define("ILIAS_LOG_FILE", $ilIliasIniFile->readVariable("log", "file"));
129 define("ILIAS_LOG_ENABLED", $ilIliasIniFile->readVariable("log", "enabled"));
130 define("ILIAS_LOG_LEVEL", $ilIliasIniFile->readVariable("log", "level"));
131 define("SLOW_REQUEST_TIME", $ilIliasIniFile->readVariable("log", "slow_request_time"));
132
133 // read path + command for third party tools from ilias.ini
134 define("PATH_TO_CONVERT", $ilIliasIniFile->readVariable("tools", "convert"));
135 define("PATH_TO_FFMPEG", $ilIliasIniFile->readVariable("tools", "ffmpeg"));
136 define("PATH_TO_ZIP", $ilIliasIniFile->readVariable("tools", "zip"));
137 define("PATH_TO_MKISOFS", $ilIliasIniFile->readVariable("tools", "mkisofs"));
138 define("PATH_TO_UNZIP", $ilIliasIniFile->readVariable("tools", "unzip"));
139 define("PATH_TO_GHOSTSCRIPT", $ilIliasIniFile->readVariable("tools", "ghostscript"));
140 define("PATH_TO_JAVA", $ilIliasIniFile->readVariable("tools", "java"));
141 define("URL_TO_LATEX", $ilIliasIniFile->readVariable("tools", "latex"));
142 define("PATH_TO_FOP", $ilIliasIniFile->readVariable("tools", "fop"));
143 define("PATH_TO_LESSC", $ilIliasIniFile->readVariable("tools", "lessc"));
144 define("PATH_TO_PHANTOMJS", $ilIliasIniFile->readVariable("tools", "phantomjs"));
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("ERROR_EDITOR_PATH_TRANSLATIONS", $ilIliasIniFile->readVariable('error', 'editor_path_translations'));
153 }
154 }
155
156 // read virus scanner settings
157 switch ($ilIliasIniFile->readVariable("tools", "vscantype")) {
158 case "sophos":
159 define("IL_VIRUS_SCANNER", "Sophos");
160 define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
161 define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
162 break;
163
164 case "antivir":
165 define("IL_VIRUS_SCANNER", "AntiVir");
166 define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
167 define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
168 break;
169
170 case "clamav":
171 define("IL_VIRUS_SCANNER", "ClamAV");
172 define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
173 define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
174 break;
175
176 default:
177 define("IL_VIRUS_SCANNER", "None");
178 break;
179 }
180
181 include_once './Services/Calendar/classes/class.ilTimeZone.php';
183 define("IL_TIMEZONE", $tz);
184 }
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 2016 of file class.ilInitialisation.php.

2017 {
2018 $c["di.dependency_map"] = function ($c) {
2019 return new \ILIAS\BackgroundTasks\Dependencies\DependencyMap\BaseDependencyMap();
2020 };
2021
2022 $c["di.injector"] = function ($c) {
2023 return new \ILIAS\BackgroundTasks\Dependencies\Injector($c, $c["di.dependency_map"]);
2024 };
2025 }

References Vendor\Package\$c.

Referenced by initILIAS().

+ Here is the caller graph for this function:

◆ initKioskMode()

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

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

2028 {
2029 $c["service.kiosk_mode"] = function ($c) {
2030 return new ilKioskModeService(
2031 $c['ilCtrl'],
2032 $c['lng'],
2033 $c['ilAccess'],
2034 $c['objDefinition']
2035 );
2036 };
2037 }
Central entry point for users of the service.

References Vendor\Package\$c.

Referenced by initHTML(), and initILIAS().

+ Here is the caller graph for this function:

◆ initLocale()

static ilInitialisation::initLocale ( )
staticprotected

Init Locale.

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

793 {
794 global $ilSetting;
795
796 if (trim($ilSetting->get("locale") != "")) {
797 $larr = explode(",", trim($ilSetting->get("locale")));
798 $ls = array();
799 $first = $larr[0];
800 foreach ($larr as $l) {
801 if (trim($l) != "") {
802 $ls[] = $l;
803 }
804 }
805 if (count($ls) > 0) {
806 setlocale(LC_ALL, $ls);
807
808 // #15347 - making sure that floats are not changed
809 setlocale(LC_NUMERIC, "C");
810
811 if (class_exists("Collator")) {
812 $GLOBALS["ilCollator"] = new Collator($first);
813 $GLOBALS["DIC"]["ilCollator"] = function ($c) {
814 return $GLOBALS["ilCollator"];
815 };
816 }
817 }
818 }
819 }
global $ilSetting
Definition: privfeed.php:17

References Vendor\Package\$c, $GLOBALS, and $ilSetting.

Referenced by initClient().

+ Here is the caller graph for this function:

◆ initLog()

static ilInitialisation::initLog ( )
staticprotected

Init log instance.

Reimplemented in XapiProxy\ilInitialisation, and LTI\ilInitialisation.

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

965 {
966 include_once './Services/Logging/classes/public/class.ilLoggerFactory.php';
968
969 self::initGlobal("ilLog", $log);
970 // deprecated
971 self::initGlobal("log", $log);
972 }
static getRootLogger()
The unique root logger has a fixed error level.
$log
Definition: result.php:15

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

612 {
613 $c["mail.mime.transport.factory"] = function (\ILIAS\DI\Container $c) {
614 return new \ilMailMimeTransportFactory($c->settings(), $c->event());
615 };
616 $c["mail.mime.sender.factory"] = function (\ILIAS\DI\Container $c) {
617 return new \ilMailMimeSenderFactory($c->settings());
618 };
619 $c["mail.texttemplates.service"] = function (\ILIAS\DI\Container $c) {
620 return new \ilMailTemplateService(new \ilMailTemplateRepository($c->database()));
621 };
622 }
Class ilMailTemplateRepository.

References Vendor\Package\$c.

Referenced by initClient().

+ Here is the caller graph for this function:

◆ initRefinery()

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

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

1648 {
1649 $container['refinery'] = function ($container) {
1650 $dataFactory = new \ILIAS\Data\Factory();
1651 $language = $container['lng'];
1652
1653 return new \ILIAS\Refinery\Factory($dataFactory, $language);
1654 };
1655 }

References $container.

Referenced by initILIAS().

+ Here is the caller graph for this function:

◆ initSession()

static ilInitialisation::initSession ( )
staticprotected

Init auth session.

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

1091 {
1092 $GLOBALS["DIC"]["ilAuthSession"] = function ($c) {
1093 $auth_session = ilAuthSession::getInstance(
1094 $c['ilLoggerFactory']->getLogger('auth')
1095 );
1096 $auth_session->init();
1097 return $auth_session;
1098 };
1099 }
static getInstance(\ilLogger $logger)
Get instance.

References Vendor\Package\$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 697 of file class.ilInitialisation.php.

698 {
699 global $ilSetting;
700
702 "ilSetting",
703 "ilSetting",
704 "Services/Administration/classes/class.ilSetting.php"
705 );
706
707 // check correct setup
708 if (!$ilSetting->get("setup_ok")) {
709 self::abortAndDie("Setup is not completed. Please run setup routine again.");
710 }
711
712 // set anonymous user & role id and system role id
713 define("ANONYMOUS_USER_ID", $ilSetting->get("anonymous_user_id"));
714 define("ANONYMOUS_ROLE_ID", $ilSetting->get("anonymous_role_id"));
715 define("SYSTEM_USER_ID", $ilSetting->get("system_user_id"));
716 define("SYSTEM_ROLE_ID", $ilSetting->get("system_role_id"));
717 define("USER_FOLDER_ID", 7);
718
719 // recovery folder
720 define("RECOVERY_FOLDER_ID", $ilSetting->get("recovery_folder_id"));
721
722 // installation id
723 define("IL_INST_ID", $ilSetting->get("inst_id", 0));
724
725 // define default suffix replacements
726 define("SUFFIX_REPL_DEFAULT", "php,php3,php4,inc,lang,phtml,htaccess");
727 define("SUFFIX_REPL_ADDITIONAL", $ilSetting->get("suffix_repl_additional"));
728
729 if (ilContext::usesHTTP()) {
731 }
732 }
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 737 of file class.ilInitialisation.php.

738 {
739 global $DIC, $ilPluginAdmin;
740
741 // load style definitions
743 "styleDefinition",
744 "ilStyleDefinition",
745 "./Services/Style/System/classes/class.ilStyleDefinition.php"
746 );
747
748 // add user interface hook for style initialisation
749 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
750 foreach ($pl_names as $pl) {
751 $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
752 $gui_class = $ui_plugin->getUIClassInstance();
753 $gui_class->modifyGUI("Services/Init", "init_style", array("styleDefinition" => $DIC->systemStyle()));
754 }
755 }
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 652 of file class.ilInitialisation.php.

653 {
654 $c['tos.criteria.type.factory'] = function (\ILIAS\DI\Container $c) {
655 return new ilTermsOfServiceCriterionTypeFactory($c->rbac()->review(), $c['ilObjDataCache']);
656 };
657
658 $c['tos.document.evaluator'] = function (\ILIAS\DI\Container $c) {
661 $c['tos.criteria.type.factory'],
662 $c->user(),
663 $c->logger()->tos()
664 ),
665 $c->user(),
666 $c->logger()->tos(),
667 \ilTermsOfServiceDocument::orderBy('sorting')->get()
668 );
669 };
670 }
Interface ilTermsOfServiceSequentialDocumentEvaluation.

References Vendor\Package\$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)
static

init the ILIAS UI framework.

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

1411 {
1412 $c["ui.factory"] = function ($c) {
1413 $c["lng"]->loadLanguageModule("ui");
1415 $c["ui.factory.counter"],
1416 $c["ui.factory.button"],
1417 $c["ui.factory.listing"],
1418 $c["ui.factory.image"],
1419 $c["ui.factory.panel"],
1420 $c["ui.factory.modal"],
1421 $c["ui.factory.dropzone"],
1422 $c["ui.factory.popover"],
1423 $c["ui.factory.divider"],
1424 $c["ui.factory.link"],
1425 $c["ui.factory.dropdown"],
1426 $c["ui.factory.item"],
1427 $c["ui.factory.viewcontrol"],
1428 $c["ui.factory.chart"],
1429 $c["ui.factory.input"],
1430 $c["ui.factory.table"],
1431 $c["ui.factory.messagebox"],
1432 $c["ui.factory.card"],
1433 $c["ui.factory.layout"],
1434 $c["ui.factory.maincontrols"],
1435 $c["ui.factory.tree"],
1436 $c["ui.factory.menu"],
1437 $c["ui.factory.symbol"],
1438 $c["ui.factory.legacy"]
1439 );
1440 };
1441 $c["ui.signal_generator"] = function ($c) {
1443 };
1444 $c["ui.factory.counter"] = function ($c) {
1446 };
1447 $c["ui.factory.button"] = function ($c) {
1449 };
1450 $c["ui.factory.listing"] = function ($c) {
1452 };
1453 $c["ui.factory.image"] = function ($c) {
1455 };
1456 $c["ui.factory.panel"] = function ($c) {
1457 return new ILIAS\UI\Implementation\Component\Panel\Factory($c["ui.factory.panel.listing"]);
1458 };
1459 $c["ui.factory.modal"] = function ($c) {
1460 return new ILIAS\UI\Implementation\Component\Modal\Factory($c["ui.signal_generator"]);
1461 };
1462 $c["ui.factory.dropzone"] = function ($c) {
1463 return new ILIAS\UI\Implementation\Component\Dropzone\Factory($c["ui.factory.dropzone.file"]);
1464 };
1465 $c["ui.factory.popover"] = function ($c) {
1466 return new ILIAS\UI\Implementation\Component\Popover\Factory($c["ui.signal_generator"]);
1467 };
1468 $c["ui.factory.divider"] = function ($c) {
1470 };
1471 $c["ui.factory.link"] = function ($c) {
1473 };
1474 $c["ui.factory.dropdown"] = function ($c) {
1476 };
1477 $c["ui.factory.item"] = function ($c) {
1479 };
1480 $c["ui.factory.viewcontrol"] = function ($c) {
1481 return new ILIAS\UI\Implementation\Component\ViewControl\Factory($c["ui.signal_generator"]);
1482 };
1483 $c["ui.factory.chart"] = function ($c) {
1484 return new ILIAS\UI\Implementation\Component\Chart\Factory($c["ui.factory.progressmeter"]);
1485 };
1486 $c["ui.factory.input"] = function ($c) {
1488 $c["ui.signal_generator"],
1489 $c["ui.factory.input.field"],
1490 $c["ui.factory.input.container"]
1491 );
1492 };
1493 $c["ui.factory.table"] = function ($c) {
1494 return new ILIAS\UI\Implementation\Component\Table\Factory($c["ui.signal_generator"]);
1495 };
1496 $c["ui.factory.messagebox"] = function ($c) {
1498 };
1499 $c["ui.factory.card"] = function ($c) {
1501 };
1502 $c["ui.factory.layout"] = function ($c) {
1504 };
1505 $c["ui.factory.maincontrols.slate"] = function ($c) {
1507 $c['ui.signal_generator'],
1508 $c['ui.factory.counter'],
1509 $c["ui.factory.symbol"]
1510 );
1511 };
1512 $c["ui.factory.maincontrols"] = function ($c) {
1514 $c['ui.signal_generator'],
1515 $c['ui.factory.maincontrols.slate']
1516 );
1517 };
1518 $c["ui.factory.menu"] = function ($c) {
1520 };
1521 $c["ui.factory.symbol.glyph"] = function ($c) {
1523 };
1524 $c["ui.factory.symbol.icon"] = function ($c) {
1526 };
1527 $c["ui.factory.symbol.avatar"] = function ($c) {
1529 };
1530 $c["ui.factory.symbol"] = function ($c) {
1532 $c["ui.factory.symbol.icon"],
1533 $c["ui.factory.symbol.glyph"],
1534 $c["ui.factory.symbol.avatar"]
1535 );
1536 };
1537 $c["ui.factory.progressmeter"] = function ($c) {
1539 };
1540 $c["ui.factory.dropzone.file"] = function ($c) {
1542 };
1543 $c["ui.factory.input.field"] = function ($c) {
1544 $data_factory = new ILIAS\Data\Factory();
1545 $refinery = new ILIAS\Refinery\Factory($data_factory, $c["lng"]);
1546
1548 $c["ui.signal_generator"],
1549 $data_factory,
1550 $refinery,
1551 $c["lng"]
1552 );
1553 };
1554 $c["ui.factory.input.container"] = function ($c) {
1556 $c["ui.factory.input.container.form"],
1557 $c["ui.factory.input.container.filter"]
1558 );
1559 };
1560 $c["ui.factory.input.container.form"] = function ($c) {
1562 $c["ui.factory.input.field"]
1563 );
1564 };
1565 $c["ui.factory.input.container.filter"] = function ($c) {
1567 $c["ui.signal_generator"],
1568 $c["ui.factory.input.field"]
1569 );
1570 };
1571 $c["ui.factory.panel.listing"] = function ($c) {
1573 };
1574
1575 $c["ui.renderer"] = function ($c) {
1577 $c["ui.component_renderer_loader"]
1578 );
1579 };
1580 $c["ui.component_renderer_loader"] = function ($c) {
1582 new ILIAS\UI\Implementation\Render\LoaderResourceRegistryWrapper(
1583 $c["ui.resource_registry"],
1584 new ILIAS\UI\Implementation\Render\FSLoader(
1585 new ILIAS\UI\Implementation\Render\DefaultRendererFactory(
1586 $c["ui.factory"],
1587 $c["ui.template_factory"],
1588 $c["lng"],
1589 $c["ui.javascript_binding"],
1590 $c["refinery"]
1591 ),
1592 new ILIAS\UI\Implementation\Component\Symbol\Glyph\GlyphRendererFactory(
1593 $c["ui.factory"],
1594 $c["ui.template_factory"],
1595 $c["lng"],
1596 $c["ui.javascript_binding"],
1597 $c["refinery"]
1598 ),
1599 new ILIAS\UI\Implementation\Component\Input\Field\FieldRendererFactory(
1600 $c["ui.factory"],
1601 $c["ui.template_factory"],
1602 $c["lng"],
1603 $c["ui.javascript_binding"],
1604 $c["refinery"]
1605 )
1606 )
1607 )
1608 );
1609 };
1610 $c["ui.template_factory"] = function ($c) {
1612 $c["tpl"]
1613 );
1614 };
1615 $c["ui.resource_registry"] = function ($c) {
1617 };
1618 $c["ui.javascript_binding"] = function ($c) {
1620 };
1621
1622 $c["ui.factory.tree"] = function ($c) {
1623 return new ILIAS\UI\Implementation\Component\Tree\Factory($c["ui.signal_generator"]);
1624 };
1625
1626 $c["ui.factory.legacy"] = function ($c) {
1627 return new ILIAS\UI\Implementation\Component\Legacy\Factory($c["ui.signal_generator"]);
1628 };
1629
1631 foreach ($plugins as $plugin_data) {
1632 $plugin = ilPluginAdmin::getPluginObject($plugin_data["component_type"], $plugin_data["component_name"], $plugin_data["slot_id"], $plugin_data["name"]);
1633
1634 $c['ui.renderer'] = $plugin->exchangeUIRendererAfterInitialization($c);
1635
1636 foreach ($c->keys() as $key) {
1637 if (strpos($key, "ui.factory") === 0) {
1638 $c[$key] = $plugin->exchangeUIFactoryAfterInitialization($key, $c);
1639 }
1640 }
1641 }
1642 }
Builds data types.
Definition: Factory.php:20
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.
static getActivePlugins()
Get info for all active plugins.
This is how a factory for buttons looks like.
Definition: Factory.php:13
This is how a factory for filters looks like.
Definition: Factory.php:14
This is what a factory for layouts looks like.
Definition: Factory.php:9
This is how the factory for UI elements looks.
Definition: Factory.php:18
Class ChatMainBarProvider \MainMenu\Provider.
Class Factory.

References Vendor\Package\$c, XapiProxy\$plugin, ilPluginAdmin\getActivePlugins(), and ilPluginAdmin\getPluginObject().

Referenced by initHTML().

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

◆ initUser()

static ilInitialisation::initUser ( )
staticprotected

Init user / authentification (level 2)

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

1270 {
1271 global $ilias, $ilUser;
1272
1273 // $ilUser
1275 "ilUser",
1276 "ilObjUser",
1277 "./Services/User/classes/class.ilObjUser.php"
1278 );
1279 $ilias->account = $ilUser;
1280
1282 }
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:

◆ initUserAccount()

static ilInitialisation::initUserAccount ( )
static

Init user with current account id.

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

761 {
762 global $DIC;
763
764 static $context_init;
765
766 $uid = $GLOBALS['DIC']['ilAuthSession']->getUserId();
767 if ($uid) {
768 $DIC->user()->setId($uid);
769 $DIC->user()->read();
770 if (!isset($context_init)) {
771 if ($DIC->user()->isAnonymous()) {
772 $DIC->globalScreen()->tool()->context()->claim()->external();
773 } else {
774 $DIC->globalScreen()->tool()->context()->claim()->internal();
775 }
776 $context_init = true;
777 }
778 // init console log handler
779 ilLoggerFactory::getInstance()->initUser($DIC->user()->getLogin());
780 \ilOnlineTracking::updateAccess($DIC->user());
781 } else {
782 if (is_object($GLOBALS['ilLog'])) {
783 $GLOBALS['ilLog']->logStack();
784 }
785 self::abortAndDie("Init user account failed");
786 }
787 }

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

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

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

55 {
56 if (is_array($var)) {
57 $mod = [];
58 foreach ($var as $k => $v) {
61 }
62 return $mod;
63 }
64 return strip_tags(
65 str_replace(
66 array("\x00", "\n", "\r", "\\", "'", '"', "\x1a"),
67 "",
68 $var
69 )
70 );
71 }
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 1902 of file class.ilInitialisation.php.

1903 {
1904 // #12739
1905 if (defined("ILIAS_HTTP_PATH") &&
1906 !stristr($a_target, ILIAS_HTTP_PATH)) {
1907 $a_target = ILIAS_HTTP_PATH . "/" . $a_target;
1908 }
1909
1910 foreach (['ext_uid', 'soap_pw'] as $param) {
1911 if (false === strpos($a_target, $param . '=') && isset($GLOBALS['DIC']->http()->request()->getQueryParams()[$param])) {
1912 $a_target = \ilUtil::appendUrlParameterString($a_target, $param . '=' . \ilUtil::stripSlashes(
1913 $GLOBALS['DIC']->http()->request()->getQueryParams()[$param]
1914 ));
1915 }
1916 }
1917
1919 ilUtil::redirect($a_target);
1920 } else {
1921 $message = self::translateMessage($a_message_id, $a_message_static);
1922
1923 // user-directed linked message
1925 $link = self::translateMessage(
1926 "init_error_redirect_click",
1927 array("en" => 'Please click to continue.',
1928 "de" => 'Bitte klicken um fortzufahren.')
1929 );
1930 $mess = $message .
1931 '<br /><a href="' . $a_target . '">' . $link . '</a>';
1932 }
1933 // plain text
1934 else {
1935 // not much we can do here
1936 $mess = $message;
1937
1938 if (!trim($mess)) {
1939 $mess = self::translateMessage(
1940 "init_error_redirect_info",
1941 array("en" => 'Redirect not supported by context.',
1942 "de" => 'Weiterleitungen werden durch Kontext nicht unterstützt.')
1943 ) .
1944 ' (' . $a_target . ')';
1945 }
1946 }
1947
1948 self::abortAndDie($mess);
1949 }
1950 }
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
$message
Definition: xapiexit.php:14
$param
Definition: xapitoken.php:31

References $GLOBALS, $message, $param, abortAndDie(), ilUtil\appendUrlParameterString(), ilContext\hasHTML(), ILIAS\FileDelivery\http(), ILIAS_HTTP_PATH, 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 1032 of file class.ilInitialisation.php.

1033 {
1034 self::$already_initialized = false;
1036 }
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 45 of file class.ilInitialisation.php.

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

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

77 {
78 // ilTemplate
80 require_once "./Services/UICore/classes/class.ilTemplate.php";
81 }
82
83 // really always required?
84 require_once "./Services/Utilities/classes/class.ilUtil.php";
85 require_once "./Services/Calendar/classes/class.ilDatePresentation.php";
86 require_once "include/inc.ilias_version.php";
87
88 include_once './Services/Authentication/classes/class.ilAuthUtils.php';
89
90 self::initGlobal("ilBench", "ilBenchmark", "./Services/Utilities/classes/class.ilBenchmark.php");
91 }
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 1287 of file class.ilInitialisation.php.

1288 {
1289 global $DIC;
1292 }
1293
1294 if (
1295 !$GLOBALS['DIC']['ilAuthSession']->isAuthenticated() or
1296 $GLOBALS['DIC']['ilAuthSession']->isExpired()
1297 ) {
1298 ilLoggerFactory::getLogger('init')->debug('Current session is invalid: ' . $GLOBALS['DIC']['ilAuthSession']->getId());
1299 $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
1300 if (self::blockedAuthentication($current_script)) {
1301 ilLoggerFactory::getLogger('init')->debug('Authentication is started in current script.');
1302 // nothing todo: authentication is done in current script
1303 return;
1304 }
1305
1306 return self::handleAuthenticationFail();
1307 }
1308 // valid session
1309
1310 return self::initUserAccount();
1311 }
static isAuthenticationForced()
Check if authentication is should be forced.
static handleForcedAuthentication()

References $_SERVER, $DIC, $GLOBALS, ilLoggerFactory\getLogger(), ilAuthUtils\handleForcedAuthentication(), initUserAccount(), 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 554 of file class.ilInitialisation.php.

555 {
556 include_once 'Services/Authentication/classes/class.ilAuthFactory.php';
558 $cookie_path = '/';
559 } elseif ($GLOBALS['COOKIE_PATH']) {
560 // use a predefined cookie path from WebAccessChecker
561 $cookie_path = $GLOBALS['COOKIE_PATH'];
562 } else {
563 $cookie_path = dirname($_SERVER['PHP_SELF']);
564 }
565
566 /* if ilias is called directly within the docroot $cookie_path
567 is set to '/' expecting on servers running under windows..
568 here it is set to '\'.
569 in both cases a further '/' won't be appended due to the following regex
570 */
571 $cookie_path .= (!preg_match("/[\/|\\\\]$/", $cookie_path)) ? "/" : "";
572
573 if ($cookie_path == "\\") {
574 $cookie_path = '/';
575 }
576
577 define('IL_COOKIE_HTTPONLY', true); // Default Value
578 define('IL_COOKIE_EXPIRE', 0);
579 define('IL_COOKIE_PATH', $cookie_path);
580 define('IL_COOKIE_DOMAIN', '');
581 }
$cookie_path
Definition: metadata.php:22

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

587 {
588 global $ilSetting;
589
590 if (!defined('IL_COOKIE_SECURE')) {
591 // If this code is executed, we can assume that \ilHTTPS::enableSecureCookies was NOT called before
592 // \ilHTTPS::enableSecureCookies already executes session_set_cookie_params()
593
594 include_once './Services/Http/classes/class.ilHTTPS.php';
595 $cookie_secure = !$ilSetting->get('https', 0) && ilHTTPS::getInstance()->isDetected();
596 define('IL_COOKIE_SECURE', $cookie_secure); // Default Value
597
598 session_set_cookie_params(
599 IL_COOKIE_EXPIRE,
601 IL_COOKIE_DOMAIN,
602 IL_COOKIE_SECURE,
603 IL_COOKIE_HTTPONLY
604 );
605 }
606 }
static getInstance()
Get https instance.
const IL_COOKIE_PATH(isset($_GET["client_id"]))
Definition: metadata.php:47

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

531 {
532 if (ini_get('session.save_handler') != 'user' && version_compare(PHP_VERSION, '7.2.0', '<')) {
533 ini_set("session.save_handler", "user");
534 }
535
536 require_once "Services/Authentication/classes/class.ilSessionDBHandler.php";
537 $db_session_handler = new ilSessionDBHandler();
538 if (!$db_session_handler->setSaveHandler()) {
539 self::abortAndDie("Please turn off Safe mode OR set session.save_handler to \"user\" in your php.ini");
540 }
541
542 // Do not accept external session ids
543 if (!ilSession::_exists(session_id()) && !defined('IL_PHPUNIT_TEST')) {
544 // php7-todo, correct-with-php5-removal : alex, 1.3.2016: added if, please check
545 if (function_exists("session_status") && session_status() == PHP_SESSION_ACTIVE) {
546 session_regenerate_id();
547 }
548 }
549 }
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:

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

1858 {
1859 global $ilDB, $lng, $ilSetting, $ilClientIniFile, $ilUser;
1860
1861 // current language
1862 if (!$lng) {
1863 $lang = "en";
1864 if ($ilUser) {
1865 $lang = $ilUser->getLanguage();
1866 } elseif ($_REQUEST["lang"]) {
1867 $lang = (string) $_REQUEST["lang"];
1868 } elseif ($ilSetting) {
1869 $lang = $ilSetting->get("language");
1870 } elseif ($ilClientIniFile) {
1871 $lang = $ilClientIniFile->readVariable("language", "default");
1872 }
1873 } else {
1874 $lang = $lng->getLangKey();
1875 }
1876
1877 $message = "";
1878 if ($ilDB && $a_message_id) {
1879 if (!$lng) {
1880 require_once "./Services/Language/classes/class.ilLanguage.php";
1881 $lng = new ilLanguage($lang);
1882 }
1883
1884 $lng->loadLanguageModule("init");
1885 $message = $lng->txt($a_message_id);
1886 } elseif (is_array($a_message_static)) {
1887 if (!isset($a_message_static[$lang])) {
1888 $lang = "en";
1889 }
1890 $message = $a_message_static[$lang];
1891 }
1892 return $message;
1893 }
language handling
$lng
$lang
Definition: xapiexit.php:8

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


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