ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilInitialisation.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once("libs/composer/vendor/autoload.php");
5
6// needed for slow queries, etc.
7if(!isset($GLOBALS['ilGlobalStartTime']) || !$GLOBALS['ilGlobalStartTime'])
8{
9 $GLOBALS['ilGlobalStartTime'] = microtime();
10}
11
12include_once "Services/Context/classes/class.ilContext.php";
13
30{
34 protected static function removeUnsafeCharacters()
35 {
36 // Remove unsafe characters from GET parameters.
37 // We do not need this characters in any case, so it is
38 // feasible to filter them everytime. POST parameters
39 // need attention through ilUtil::stripSlashes() and similar functions)
41 }
42
43 protected static function recursivelyRemoveUnsafeCharacters($var) {
44 if (is_array($var)) {
45 $mod = [];
46 foreach ($var as $k => $v) {
49 }
50 return $mod;
51 }
52 return strip_tags(
53 str_replace(
54 array("\x00", "\n", "\r", "\\", "'", '"', "\x1a"),
55 "",
56 $var
57 )
58 );
59 }
60
64 protected static function requireCommonIncludes()
65 {
66 // ilTemplate
68 {
69 require_once "./Services/UICore/classes/class.ilTemplate.php";
70 }
71
72 // really always required?
73 require_once "./Services/Utilities/classes/class.ilUtil.php";
74 require_once "./Services/Calendar/classes/class.ilDatePresentation.php";
75 require_once "include/inc.ilias_version.php";
76
77 include_once './Services/Authentication/classes/class.ilAuthUtils.php';
78
79 self::initGlobal("ilBench", "ilBenchmark", "./Services/Utilities/classes/class.ilBenchmark.php");
80 }
81
87 protected static function includePhp5Compliance()
88 {
89 include_once 'Services/Authentication/classes/class.ilAuthFactory.php';
91 {
92 require_once("include/inc.xml5compliance.php");
93 }
94 require_once("include/inc.xsl5compliance.php");
95 }
96
104 protected static function initIliasIniFile()
105 {
106 require_once("./Services/Init/classes/class.ilIniFile.php");
107 $ilIliasIniFile = new ilIniFile("./ilias.ini.php");
108 $ilIliasIniFile->read();
109 self::initGlobal('ilIliasIniFile', $ilIliasIniFile);
110
111 // initialize constants
112 define("ILIAS_DATA_DIR",$ilIliasIniFile->readVariable("clients","datadir"));
113 define("ILIAS_WEB_DIR",$ilIliasIniFile->readVariable("clients","path"));
114 define("ILIAS_ABSOLUTE_PATH",$ilIliasIniFile->readVariable('server','absolute_path'));
115
116 // logging
117 define ("ILIAS_LOG_DIR",$ilIliasIniFile->readVariable("log","path"));
118 define ("ILIAS_LOG_FILE",$ilIliasIniFile->readVariable("log","file"));
119 define ("ILIAS_LOG_ENABLED",$ilIliasIniFile->readVariable("log","enabled"));
120 define ("ILIAS_LOG_LEVEL",$ilIliasIniFile->readVariable("log","level"));
121 define ("SLOW_REQUEST_TIME",$ilIliasIniFile->readVariable("log","slow_request_time"));
122
123 // read path + command for third party tools from ilias.ini
124 define ("PATH_TO_CONVERT",$ilIliasIniFile->readVariable("tools","convert"));
125 define ("PATH_TO_FFMPEG",$ilIliasIniFile->readVariable("tools","ffmpeg"));
126 define ("PATH_TO_ZIP",$ilIliasIniFile->readVariable("tools","zip"));
127 define ("PATH_TO_MKISOFS",$ilIliasIniFile->readVariable("tools","mkisofs"));
128 define ("PATH_TO_UNZIP",$ilIliasIniFile->readVariable("tools","unzip"));
129 define ("PATH_TO_GHOSTSCRIPT",$ilIliasIniFile->readVariable("tools","ghostscript"));
130 define ("PATH_TO_JAVA",$ilIliasIniFile->readVariable("tools","java"));
131 define ("URL_TO_LATEX",$ilIliasIniFile->readVariable("tools","latex"));
132 define ("PATH_TO_FOP",$ilIliasIniFile->readVariable("tools","fop"));
133 define ("PATH_TO_LESSC",$ilIliasIniFile->readVariable("tools","lessc"));
134
135 // read virus scanner settings
136 switch ($ilIliasIniFile->readVariable("tools", "vscantype"))
137 {
138 case "sophos":
139 define("IL_VIRUS_SCANNER", "Sophos");
140 define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
141 define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
142 break;
143
144 case "antivir":
145 define("IL_VIRUS_SCANNER", "AntiVir");
146 define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
147 define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
148 break;
149
150 case "clamav":
151 define("IL_VIRUS_SCANNER", "ClamAV");
152 define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
153 define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
154 break;
155
156 default:
157 define("IL_VIRUS_SCANNER", "None");
158 break;
159 }
160
161 include_once './Services/Calendar/classes/class.ilTimeZone.php';
163 define ("IL_TIMEZONE", $tz);
164 }
165
169 protected static function buildHTTPPath()
170 {
171 include_once './Services/Http/classes/class.ilHTTPS.php';
172 $https = new ilHTTPS();
173
174 if($https->isDetected())
175 {
176 $protocol = 'https://';
177 }
178 else
179 {
180 $protocol = 'http://';
181 }
182 $host = $_SERVER['HTTP_HOST'];
183
184 $rq_uri = strip_tags($_SERVER['REQUEST_URI']);
185
186 // security fix: this failed, if the URI contained "?" and following "/"
187 // -> we remove everything after "?"
188 if (is_int($pos = strpos($rq_uri, "?")))
189 {
190 $rq_uri = substr($rq_uri, 0, $pos);
191 }
192
193 if(!defined('ILIAS_MODULE'))
194 {
195 $path = pathinfo($rq_uri);
196 if(!$path['extension'])
197 {
198 $uri = $rq_uri;
199 }
200 else
201 {
202 $uri = dirname($rq_uri);
203 }
204 }
205 else
206 {
207 // if in module remove module name from HTTP_PATH
208 $path = dirname($rq_uri);
209
210 // dirname cuts the last directory from a directory path e.g content/classes return content
211
213
214 $dirs = explode('/',$module);
215 $uri = $path;
216 foreach($dirs as $dir)
217 {
218 $uri = dirname($uri);
219 }
220 }
222 {
223 return define('ILIAS_HTTP_PATH',ilUtil::removeTrailingPathSeparators(dirname($protocol.$host.$uri)));
224
225 }
226 return define('ILIAS_HTTP_PATH',ilUtil::removeTrailingPathSeparators($protocol.$host.$uri));
227 }
228
233 protected static function determineClient()
234 {
235 global $ilIliasIniFile;
236
237 // check whether ini file object exists
238 if (!is_object($ilIliasIniFile))
239 {
240 self::abortAndDie("Fatal Error: ilInitialisation::determineClient called without initialisation of ILIAS ini file object.");
241 }
242
243 // set to default client if empty
244 if ($_GET["client_id"] != "")
245 {
246 $_GET["client_id"] = ilUtil::stripSlashes($_GET["client_id"]);
247 if (!defined("IL_PHPUNIT_TEST"))
248 {
250 {
251 ilUtil::setCookie("ilClientId", $_GET["client_id"]);
252 }
253 }
254 }
255 else if (!$_COOKIE["ilClientId"])
256 {
257 // to do: ilias ini raus nehmen
258 $client_id = $ilIliasIniFile->readVariable("clients","default");
259 ilUtil::setCookie("ilClientId", $client_id);
260 }
261 if (!defined("IL_PHPUNIT_TEST") && ilContext::supportsPersistentSessions())
262 {
263
264 define ("CLIENT_ID", $_COOKIE["ilClientId"]);
265 }
266 else
267 {
268 define ("CLIENT_ID", $_GET["client_id"]);
269 }
270 }
271
284 protected static function initClientIniFile()
285 {
286 global $ilIliasIniFile;
287
288 // check whether ILIAS_WEB_DIR is set.
289 if (ILIAS_WEB_DIR == "")
290 {
291 self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile called without ILIAS_WEB_DIR.");
292 }
293
294 // check whether CLIENT_ID is set.
295 if (CLIENT_ID == "")
296 {
297 self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile called without CLIENT_ID.");
298 }
299
300 $ini_file = "./".ILIAS_WEB_DIR."/".CLIENT_ID."/client.ini.php";
301
302 // get settings from ini file
303 require_once("./Services/Init/classes/class.ilIniFile.php");
304 $ilClientIniFile = new ilIniFile($ini_file);
305 $ilClientIniFile->read();
306
307 // invalid client id / client ini
308 if ($ilClientIniFile->ERROR != "")
309 {
310 $c = $_COOKIE["ilClientId"];
311 $default_client = $ilIliasIniFile->readVariable("clients","default");
312 ilUtil::setCookie("ilClientId", $default_client);
313 if (CLIENT_ID != "" && CLIENT_ID != $default_client)
314 {
315 $mess = array("en" => "Client does not exist.",
316 "de" => "Mandant ist ungültig.");
317 self::redirect("index.php?client_id=".$default_client, null, $mess);
318 }
319 else
320 {
321 self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile initializing client ini file abborted with: ". $ilClientIniFile->ERROR);
322 }
323 }
324
325 self::initGlobal("ilClientIniFile", $ilClientIniFile);
326
327 // set constants
328 define ("SESSION_REMINDER_LEADTIME", 30);
329 define ("DEBUG",$ilClientIniFile->readVariable("system","DEBUG"));
330 define ("DEVMODE",$ilClientIniFile->readVariable("system","DEVMODE"));
331 define ("SHOWNOTICES",$ilClientIniFile->readVariable("system","SHOWNOTICES"));
332 define ("DEBUGTOOLS",$ilClientIniFile->readVariable("system","DEBUGTOOLS"));
333 define ("ROOT_FOLDER_ID",$ilClientIniFile->readVariable('system','ROOT_FOLDER_ID'));
334 define ("SYSTEM_FOLDER_ID",$ilClientIniFile->readVariable('system','SYSTEM_FOLDER_ID'));
335 define ("ROLE_FOLDER_ID",$ilClientIniFile->readVariable('system','ROLE_FOLDER_ID'));
336 define ("MAIL_SETTINGS_ID",$ilClientIniFile->readVariable('system','MAIL_SETTINGS_ID'));
337 $error_handler = $ilClientIniFile->readVariable('system', 'ERROR_HANDLER');
338 define ("ERROR_HANDLER",$error_handler ? $error_handler : "PRETTY_PAGE");
339
340 // this is for the online help installation, which sets OH_REF_ID to the
341 // ref id of the online module
342 define ("OH_REF_ID",$ilClientIniFile->readVariable("system","OH_REF_ID"));
343
344 define ("SYSTEM_MAIL_ADDRESS",$ilClientIniFile->readVariable('system','MAIL_SENT_ADDRESS')); // Change SS
345 define ("MAIL_REPLY_WARNING",$ilClientIniFile->readVariable('system','MAIL_REPLY_WARNING')); // Change SS
346
347 // see ilObject::TITLE_LENGTH, ilObject::DESC_LENGTH
348 // define ("MAXLENGTH_OBJ_TITLE",125);#$ilClientIniFile->readVariable('system','MAXLENGTH_OBJ_TITLE'));
349 // define ("MAXLENGTH_OBJ_DESC",$ilClientIniFile->readVariable('system','MAXLENGTH_OBJ_DESC'));
350
351 define ("CLIENT_DATA_DIR",ILIAS_DATA_DIR."/".CLIENT_ID);
352 define ("CLIENT_WEB_DIR",ILIAS_ABSOLUTE_PATH."/".ILIAS_WEB_DIR."/".CLIENT_ID);
353 define ("CLIENT_NAME",$ilClientIniFile->readVariable('client','name')); // Change SS
354
355 $val = $ilClientIniFile->readVariable("db","type");
356 if ($val == "")
357 {
358 define ("IL_DB_TYPE", "mysql");
359 }
360 else
361 {
362 define ("IL_DB_TYPE", $val);
363 }
364
365 require_once('./Services/GlobalCache/classes/Settings/class.ilGlobalCacheSettings.php');
366 $ilGlobalCacheSettings = new ilGlobalCacheSettings();
367 $ilGlobalCacheSettings->readFromIniFile($ilClientIniFile);
368 ilGlobalCache::setup($ilGlobalCacheSettings);
369
370 return true;
371 }
372
376 protected static function handleMaintenanceMode()
377 {
378 global $ilClientIniFile;
379
380 if (!$ilClientIniFile->readVariable("client","access"))
381 {
382 $mess = array("en" => "The server is not available due to maintenance.".
383 " We apologise for any inconvenience.",
384 "de" => "Der Server ist aufgrund von Wartungsarbeiten nicht verfügbar.".
385 " Wir bitten um Verständnis.");
386 $mess_id = "init_error_maintenance";
387
388 if (ilContext::hasHTML() && is_file("./maintenance.html"))
389 {
390 self::redirect("./maintenance.html", $mess_id, $mess);
391 }
392 else
393 {
394 $mess = self::translateMessage($mess_id, $mess);
395 self::abortAndDie($mess);
396 }
397 }
398 }
399
404 protected static function initDatabase()
405 {
406 // build dsn of database connection and connect
407 require_once("./Services/Database/classes/class.ilDBWrapperFactory.php");
408 $ilDB = ilDBWrapperFactory::getWrapper(IL_DB_TYPE);
409 $ilDB->initFromIniFile();
410 $ilDB->connect();
411
412 self::initGlobal("ilDB", $ilDB);
413 }
414
420 public static function setSessionHandler()
421 {
422 if(ini_get('session.save_handler') != 'user')
423 {
424 ini_set("session.save_handler", "user");
425 }
426
427 require_once "Services/Authentication/classes/class.ilSessionDBHandler.php";
428 $db_session_handler = new ilSessionDBHandler();
429 if (!$db_session_handler->setSaveHandler())
430 {
431 self::abortAndDie("Please turn off Safe mode OR set session.save_handler to \"user\" in your php.ini");
432 }
433
434 // Do not accept external session ids
435 if (!ilSession::_exists(session_id()) && !defined('IL_PHPUNIT_TEST'))
436 {
437 // php7-todo, correct-with-php5-removal : alex, 1.3.2016: added if, please check
438 if(function_exists("session_status") && session_status() == PHP_SESSION_ACTIVE)
439 {
440 session_regenerate_id();
441 }
442 }
443 }
444
448 protected static function setCookieConstants()
449 {
450 include_once 'Services/Authentication/classes/class.ilAuthFactory.php';
452 {
453 $cookie_path = '/';
454 }
455 else if($GLOBALS['COOKIE_PATH'])
456 {
457 // use a predefined cookie path from WebAccessChecker
458 $cookie_path = $GLOBALS['COOKIE_PATH'];
459 }
460 else
461 {
462 $cookie_path = dirname( $_SERVER['PHP_SELF'] );
463 }
464
465 /* if ilias is called directly within the docroot $cookie_path
466 is set to '/' expecting on servers running under windows..
467 here it is set to '\'.
468 in both cases a further '/' won't be appended due to the following regex
469 */
470 $cookie_path .= (!preg_match("/[\/|\\\\]$/", $cookie_path)) ? "/" : "";
471
472 if($cookie_path == "\\") $cookie_path = '/';
473
474 define('IL_COOKIE_HTTPONLY', true); // Default Value
475 define('IL_COOKIE_EXPIRE', 0);
476 define('IL_COOKIE_PATH', $cookie_path);
477 define('IL_COOKIE_DOMAIN', '');
478 }
479
483 protected static function setSessionCookieParams()
484 {
485 global $ilSetting;
486
487 // TODO: Has to be revised/moved
488 include_once './Services/Http/classes/class.ilHTTPS.php';
489 $cookie_secure = !$ilSetting->get('https', 0) && ilHTTPS::getInstance()->isDetected();
490 define('IL_COOKIE_SECURE', $cookie_secure); // Default Value
491
492 session_set_cookie_params(
493 IL_COOKIE_EXPIRE, IL_COOKIE_PATH, IL_COOKIE_DOMAIN, IL_COOKIE_SECURE, IL_COOKIE_HTTPONLY
494 );
495 }
496
502 protected static function initSettings()
503 {
504 global $ilSetting;
505
506 self::initGlobal("ilSetting", "ilSetting",
507 "Services/Administration/classes/class.ilSetting.php");
508
509 // check correct setup
510 if (!$ilSetting->get("setup_ok"))
511 {
512 self::abortAndDie("Setup is not completed. Please run setup routine again.");
513 }
514
515 // set anonymous user & role id and system role id
516 define ("ANONYMOUS_USER_ID", $ilSetting->get("anonymous_user_id"));
517 define ("ANONYMOUS_ROLE_ID", $ilSetting->get("anonymous_role_id"));
518 define ("SYSTEM_USER_ID", $ilSetting->get("system_user_id"));
519 define ("SYSTEM_ROLE_ID", $ilSetting->get("system_role_id"));
520 define ("USER_FOLDER_ID", 7);
521
522 // recovery folder
523 define ("RECOVERY_FOLDER_ID", $ilSetting->get("recovery_folder_id"));
524
525 // installation id
526 define ("IL_INST_ID", $ilSetting->get("inst_id",0));
527
528 // define default suffix replacements
529 define ("SUFFIX_REPL_DEFAULT", "php,php3,php4,inc,lang,phtml,htaccess");
530 define ("SUFFIX_REPL_ADDITIONAL", $ilSetting->get("suffix_repl_additional"));
531
533 {
535 }
536 }
537
541 protected static function initStyle()
542 {
543 global $styleDefinition, $ilPluginAdmin;
544
545 // load style definitions
546 self::initGlobal("styleDefinition", "ilStyleDefinition",
547 "./Services/Style/System/classes/class.ilStyleDefinition.php");
548
549 // add user interface hook for style initialisation
550 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
551 foreach ($pl_names as $pl)
552 {
553 $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
554 $gui_class = $ui_plugin->getUIClassInstance();
555 $gui_class->modifyGUI("Services/Init", "init_style", array("styleDefinition" => $styleDefinition));
556 }
557 }
558
562 public static function initUserAccount()
563 {
567 global $ilUser;
568
569 $uid = $GLOBALS['DIC']['ilAuthSession']->getUserId();
570 if($uid)
571 {
572 $ilUser->setId($uid);
573 $ilUser->read();
574
575 // init console log handler
576 include_once './Services/Logging/classes/public/class.ilLoggerFactory.php';
577 ilLoggerFactory::getInstance()->initUser($ilUser->getLogin());
578 }
579 else
580 {
581 if(is_object($GLOBALS['ilLog']))
582 {
583 $GLOBALS['ilLog']->logStack();
584 }
585 self::abortAndDie("Init user account failed");
586 }
587 }
588
592 protected static function initLocale()
593 {
594 global $ilSetting;
595
596 if (trim($ilSetting->get("locale") != ""))
597 {
598 $larr = explode(",", trim($ilSetting->get("locale")));
599 $ls = array();
600 $first = $larr[0];
601 foreach ($larr as $l)
602 {
603 if (trim($l) != "")
604 {
605 $ls[] = $l;
606 }
607 }
608 if (count($ls) > 0)
609 {
610 setlocale(LC_ALL, $ls);
611
612 // #15347 - making sure that floats are not changed
613 setlocale(LC_NUMERIC, "C");
614
615 if (class_exists("Collator"))
616 {
617 $GLOBALS["ilCollator"] = new Collator($first);
618 $GLOBALS["DIC"]["ilCollator"] = function($c) {
619 return $GLOBALS["ilCollator"];
620 };
621 }
622 }
623 }
624 }
625
631 public static function goToPublicSection()
632 {
633 global $ilAuth;
634
635 if (ANONYMOUS_USER_ID == "")
636 {
637 self::abortAndDie("Public Section enabled, but no Anonymous user found.");
638 }
639
640 $session_destroyed = false;
641 if($GLOBALS['DIC']['ilAuthSession']->isExpired())
642 {
643 $session_destroyed = true;
645 }
646 if(!$GLOBALS['DIC']['ilAuthSession']->isAuthenticated())
647 {
648 $session_destroyed = true;
650 }
651
652 if($session_destroyed)
653 {
654 $GLOBALS['DIC']['ilAuthSession']->setAuthenticated(true, ANONYMOUS_USER_ID);
655 }
656
657 self::initUserAccount();
658
659 // if target given, try to go there
660 if(strlen($_GET["target"]))
661 {
662 // when we are already "inside" goto.php no redirect is needed
663 $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
664 if($current_script == "goto.php")
665 {
666 return;
667 }
668 // goto will check if target is accessible or redirect to login
669 self::redirect("goto.php?target=".$_GET["target"]);
670 }
671
672 // check access of root folder otherwise redirect to login
673 #if(!$GLOBALS['DIC']->rbac()->system()->checkAccess('read', ROOT_FOLDER_ID))
674 #{
675 # return self::goToLogin();
676 #}
677
678 // we do not know if ref_id of request is accesible, so redirecting to root
679 $_GET["ref_id"] = ROOT_FOLDER_ID;
680 $_GET["cmd"] = "frameset";
682 "ilias.php?baseClass=ilrepositorygui&reloadpublic=1&cmd=".
683 $_GET["cmd"]."&ref_id=".$_GET["ref_id"]);
684 }
685
691 protected static function goToLogin()
692 {
693 ilLoggerFactory::getLogger('init')->debug('Redirecting to login page.');
694
695 if($GLOBALS['DIC']['ilAuthSession']->isExpired())
696 {
698 }
699 if(!$GLOBALS['DIC']['ilAuthSession']->isAuthenticated())
700 {
702 }
703
704 $script = "login.php?target=".$_GET["target"]."&client_id=".$_COOKIE["ilClientId"].
705 "&auth_stat=".$a_auth_stat;
706
708 $script,
709 "init_error_authentication_fail",
710 array(
711 "en" => "Authentication failed.",
712 "de" => "Authentifizierung fehlgeschlagen.")
713 );
714 }
715
719 protected static function initLanguage()
720 {
724 global $rbacsystem;
725
726 require_once 'Services/Language/classes/class.ilLanguage.php';
727 self::initGlobal('lng', ilLanguage::getGlobalInstance());
728 if(is_object($rbacsystem))
729 {
730 $rbacsystem->initMemberView();
731 }
732 }
733
737 protected static function initAccessHandling()
738 {
739 self::initGlobal("rbacreview", "ilRbacReview",
740 "./Services/AccessControl/classes/class.ilRbacReview.php");
741
742 require_once "./Services/AccessControl/classes/class.ilRbacSystem.php";
743 $rbacsystem = ilRbacSystem::getInstance();
744 self::initGlobal("rbacsystem", $rbacsystem);
745
746 self::initGlobal("rbacadmin", "ilRbacAdmin",
747 "./Services/AccessControl/classes/class.ilRbacAdmin.php");
748
749 self::initGlobal("ilAccess", "ilAccessHandler",
750 "./Services/AccessControl/classes/class.ilAccessHandler.php");
751
752 require_once "./Services/AccessControl/classes/class.ilConditionHandler.php";
753 }
754
758 protected static function initLog()
759 {
760 include_once './Services/Logging/classes/public/class.ilLoggerFactory.php';
762
763 self::initGlobal("ilLog", $log);
764 // deprecated
765 self::initGlobal("log", $log);
766 }
767
775 protected static function initGlobal($a_name, $a_class, $a_source_file = null)
776 {
777 global $DIC;
778
779 if($a_source_file)
780 {
781 include_once $a_source_file;
782 $GLOBALS[$a_name] = new $a_class;
783 }
784 else
785 {
786 $GLOBALS[$a_name] = $a_class;
787 }
788
789 $DIC[$a_name] = function ($c) use ($a_name) {
790 return $GLOBALS[$a_name];
791 };
792 }
793
799 protected static function abortAndDie($a_message)
800 {
801 if(is_object($GLOBALS['ilLog']))
802 {
803 $GLOBALS['ilLog']->write("Fatal Error: ilInitialisation - ".$a_message);
804 }
805 die($a_message);
806 }
807
811 protected static function handleDevMode()
812 {
813 if(defined(SHOWNOTICES) && SHOWNOTICES)
814 {
815 // no further differentiating of php version regarding to 5.4 neccessary
816 // when the error reporting is set to E_ALL anyway
817
818 // add notices to error reporting
819 error_reporting(E_ALL);
820 }
821
822 if(defined('DEBUGTOOLS') && DEBUGTOOLS)
823 {
824 include_once "include/inc.debug.php";
825 }
826 }
827
828 protected static $already_initialized;
829
830
831 public static function reinitILIAS() {
832 self::$already_initialized = false;
834 }
835
839 public static function initILIAS()
840 {
841 if (self::$already_initialized)
842 {
843 // workaround for bug #17990
844 // big mess. we prevent double initialisations with ILIAS 5.1, which is good, but...
845 // the style service uses $_GET["ref_id"] to determine
846 // the context styles. $_GET["ref_id"] is "corrected" by the "goto" procedure and which calls
847 // initILIAS again.
848 // we need a mechanism that detemines our repository context and stores that in an information object
849 // usable by the style component afterwars. This needs new concepts and a refactoring.
851 {
852 global $tpl;
853 if (is_object($tpl))
854 {
855 // load style sheet depending on user's settings
856 $location_stylesheet = ilUtil::getStyleSheetLocation();
857 $tpl->setVariable("LOCATION_STYLESHEET", $location_stylesheet);
858 }
859 }
860
861 return;
862 }
863
864 $GLOBALS["DIC"] = new \ILIAS\DI\Container();
865 $GLOBALS["DIC"]["ilLoggerFactory"] = function($c) {
867 };
868
869 self::$already_initialized = true;
870
872
874 {
877
878 if (ilContext::hasUser())
879 {
881
883 {
885 }
886 }
887
888 // init after Auth otherwise breaks CAS
890
891 // language may depend on user setting
892 self::initLanguage();
893 $GLOBALS['DIC']['tree']->initLangCode();
894
896 {
897 include_once('./Services/WebServices/ECS/classes/class.ilECSTaskScheduler.php');
899
901 }
902 }
903 }
904
908 protected static function initSession()
909 {
910 include_once './Services/Authentication/classes/class.ilAuthSession.php';
912
913 $GLOBALS['DIC']['ilAuthSession']->init();
914 }
915
916
920 public static function handleErrorReporting()
921 {
922 // push the error level as high as possible / sane
923 error_reporting(E_ALL & ~E_NOTICE);
924
925 // see handleDevMode() - error reporting might be overwritten again
926 // but we need the client ini first
927 }
928
932 protected static function initCore()
933 {
934 global $ilErr;
935
937
938 // breaks CAS: must be included after CAS context isset in AuthUtils
939 //self::includePhp5Compliance();
940
942
943
944 // error handler
945 self::initGlobal("ilErr", "ilErrorHandling",
946 "./Services/Init/classes/class.ilErrorHandling.php");
947 $ilErr->setErrorHandling(PEAR_ERROR_CALLBACK, array($ilErr, 'errorHandler'));
948
949 // :TODO: obsolete?
950 // PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($ilErr, "errorHandler"));
951
952 // workaround: load old post variables if error handler 'message' was called
953 include_once "Services/Authentication/classes/class.ilSession.php";
954 if (ilSession::get("message"))
955 {
956 $_POST = ilSession::get("post_vars");
957 }
958
960
962
963 define('IL_INITIAL_WD', getcwd());
964
965 // deprecated
966 self::initGlobal("ilias", "ILIAS", "./Services/Init/classes/class.ilias.php");
967 }
968
972 protected static function initClient()
973 {
974 global $https, $ilias;
975
977
979
981
982
983 // --- needs client ini
984
985 $ilias->client_id = CLIENT_ID;
986
987 if (DEVMODE)
988 {
990 }
991
992
994
996
997 // moved after databases
998 self::initLog();
999
1000 self::initGlobal("ilAppEventHandler", "ilAppEventHandler",
1001 "./Services/EventHandling/classes/class.ilAppEventHandler.php");
1002
1003 // there are rare cases where initILIAS is called twice for a request
1004 // example goto.php is called and includes ilias.php later
1005 // we must prevent that ilPluginAdmin is initialized twice in
1006 // this case, since this won't get the values out of plugin.php the
1007 // second time properly
1008 if (!is_object($GLOBALS["ilPluginAdmin"]))
1009 {
1010 self::initGlobal("ilPluginAdmin", "ilPluginAdmin",
1011 "./Services/Component/classes/class.ilPluginAdmin.php");
1012 }
1013
1015
1017
1018
1019 // --- needs settings
1020
1022
1024 {
1025 // $https
1026 self::initGlobal("https", "ilHTTPS", "./Services/Http/classes/class.ilHTTPS.php");
1027 $https->enableSecureCookies();
1028 $https->checkPort();
1029 }
1030
1031
1032 // --- object handling
1033
1034 self::initGlobal("ilObjDataCache", "ilObjectDataCache",
1035 "./Services/Object/classes/class.ilObjectDataCache.php");
1036
1037 // needed in ilObjectDefinition
1038 require_once "./Services/Xml/classes/class.ilSaxParser.php";
1039
1040 self::initGlobal("objDefinition", "ilObjectDefinition",
1041 "./Services/Object/classes/class.ilObjectDefinition.php");
1042
1043 // $tree
1044 require_once "./Services/Tree/classes/class.ilTree.php";
1045 $tree = new ilTree(ROOT_FOLDER_ID);
1046 self::initGlobal("tree", $tree);
1047 unset($tree);
1048
1049 self::initGlobal("ilCtrl", "ilCtrl",
1050 "./Services/UICore/classes/class.ilCtrl.php");
1051
1053 }
1054
1058 protected static function initUser()
1059 {
1060 global $ilias, $ilUser;
1061
1062 // $ilUser
1064 "ilUser",
1065 "ilObjUser",
1066 "./Services/User/classes/class.ilObjUser.php"
1067 );
1068 $ilias->account = $ilUser;
1069
1071 }
1072
1076 public static function resumeUserSession()
1077 {
1078 include_once './Services/Authentication/classes/class.ilAuthUtils.php';
1080 {
1081 }
1082
1083 if(
1084 !$GLOBALS['DIC']['ilAuthSession']->isAuthenticated() or
1085 $GLOBALS['DIC']['ilAuthSession']->isExpired()
1086 )
1087 {
1088 ilLoggerFactory::getLogger('init')->debug('Current session is invalid: ' . $GLOBALS['DIC']['ilAuthSession']->getId());
1089 $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
1090 if(self::blockedAuthentication($current_script))
1091 {
1092 ilLoggerFactory::getLogger('init')->debug('Authentication is started in current script.');
1093 // nothing todo: authentication is done in current script
1094 return;
1095 }
1096 return self::handleAuthenticationFail();
1097 }
1098 // valid session
1099 return self::initUserAccount();
1100
1101 }
1102
1108 public static function authenticate()
1109 {
1110 global $ilAuth, $ilias, $ilErr;
1111
1112 $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
1113
1114 if(self::blockedAuthentication($current_script))
1115 {
1116 return;
1117 }
1118
1119 $oldSid = session_id();
1120
1121 $ilAuth->start();
1122 $ilias->setAuthError($ilErr->getLastError());
1123
1124 if($ilAuth->getAuth() && $ilAuth->getStatus() == '')
1125 {
1126 self::initUserAccount();
1127
1128 self::handleAuthenticationSuccess();
1129 }
1130 else
1131 {
1132 if (!self::showingLoginForm($current_script))
1133 {
1134 // :TODO: should be moved to context?!
1135 $mandatory_auth = ($current_script != "shib_login.php"
1136 && $current_script != "shib_logout.php"
1137 && $current_script != "error.php"
1138 && $current_script != "chat.php"
1139 && $current_script != "wac.php"
1140 && $current_script != "index.php"); // #10316
1141
1142 if($mandatory_auth)
1143 {
1144 self::handleAuthenticationFail();
1145 }
1146 }
1147 }
1148 }
1149
1153 protected static function handleAuthenticationSuccess()
1154 {
1158 global $ilUser;
1159
1160 require_once 'Services/Tracking/classes/class.ilOnlineTracking.php';
1161 ilOnlineTracking::updateAccess($ilUser);
1162 }
1163
1167 protected static function handleAuthenticationFail()
1168 {
1173 global $ilAuth, $ilSetting;
1174
1175 ilLoggerFactory::getLogger('init')->debug('Handling of failed authentication.');
1176
1177 // #10608
1178 if(
1181 {
1182 throw new Exception("Authentication failed.");
1183 }
1184 if($GLOBALS['DIC']['ilAuthSession']->isExpired())
1185 {
1186 ilLoggerFactory::getLogger('init')->debug('Expired session found -> redirect to login page');
1187 return self::goToLogin();
1188 }
1189 if($ilSetting->get('pub_section'))
1190 {
1191 ilLoggerFactory::getLogger('init')->debug('Redirect to public section.');
1192 return self::goToPublicSection();
1193 }
1194 ilLoggerFactory::getLogger('init')->debug('Redirect to login page.');
1195 return self::goToLogin();
1196 }
1197
1201 protected static function initUIFramework(\ILIAS\DI\Container $c) {
1202 $c["ui.factory"] = function ($c) {
1204 };
1205 $c["ui.renderer"] = function($c) {
1207 ( $c["ui.factory"]
1208 , $c["ui.template_factory"]
1209 , $c["ui.resource_registry"]
1210 , $c["lng"]
1211 , $c["ui.javascript_binding"]
1212 );
1213 };
1214 $c["ui.template_factory"] = function($c) {
1216 ( $c["tpl"]
1217 );
1218 };
1219 $c["ui.resource_registry"] = function($c) {
1221 };
1222 $c["ui.javascript_binding"] = function($c) {
1224 };
1225 }
1226
1230 protected static function initHTML()
1231 {
1232 global $ilUser;
1233
1234 if(ilContext::hasUser())
1235 {
1236 // load style definitions
1237 // use the init function with plugin hook here, too
1239 }
1240
1242
1243 // $tpl
1244 $tpl = new ilTemplate("tpl.main.html", true, true);
1245 self::initGlobal("tpl", $tpl);
1246
1247 if (ilContext::hasUser()) {
1248 require_once 'Services/User/classes/class.ilUserRequestTargetAdjustment.php';
1249 $request_adjuster = new ilUserRequestTargetAdjustment($ilUser, $GLOBALS['DIC']['ilCtrl']);
1250 $request_adjuster->adjust();
1251 }
1252
1253
1254 // load style sheet depending on user's settings
1255 $location_stylesheet = ilUtil::getStyleSheetLocation();
1256 $tpl->setVariable("LOCATION_STYLESHEET",$location_stylesheet);
1257
1258 require_once "./Services/UICore/classes/class.ilFrameTargetInfo.php";
1259
1260 self::initGlobal("ilNavigationHistory", "ilNavigationHistory",
1261 "Services/Navigation/classes/class.ilNavigationHistory.php");
1262
1263 self::initGlobal("ilBrowser", "ilBrowser",
1264 "./Services/Utilities/classes/class.ilBrowser.php");
1265
1266 self::initGlobal("ilHelp", "ilHelpGUI",
1267 "Services/Help/classes/class.ilHelpGUI.php");
1268
1269 self::initGlobal("ilToolbar", "ilToolbarGUI",
1270 "./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php");
1271
1272 self::initGlobal("ilLocator", "ilLocatorGUI",
1273 "./Services/Locator/classes/class.ilLocatorGUI.php");
1274
1275 self::initGlobal("ilTabs", "ilTabsGUI",
1276 "./Services/UIComponent/Tabs/classes/class.ilTabsGUI.php");
1277
1278 if(ilContext::hasUser())
1279 {
1280 // $ilMainMenu
1281 include_once './Services/MainMenu/classes/class.ilMainMenuGUI.php';
1282 $ilMainMenu = new ilMainMenuGUI("_top");
1283 self::initGlobal("ilMainMenu", $ilMainMenu);
1284 unset($ilMainMenu);
1285
1286
1287 // :TODO: tableGUI related
1288
1289 // set hits per page for all lists using table module
1290 $_GET['limit'] = (int) $ilUser->getPref('hits_per_page');
1291 ilSession::set('tbl_limit', $_GET['limit']);
1292
1293 // the next line makes it impossible to save the offset somehow in a session for
1294 // a specific table (I tried it for the user administration).
1295 // its not posssible to distinguish whether it has been set to page 1 (=offset = 0)
1296 // or not set at all (then we want the last offset, e.g. being used from a session var).
1297 // So I added the wrapping if statement. Seems to work (hopefully).
1298 // Alex April 14th 2006
1299 if (isset($_GET['offset']) && $_GET['offset'] != "") // added April 14th 2006
1300 {
1301 $_GET['offset'] = (int) $_GET['offset']; // old code
1302 }
1303 }
1304 else
1305 {
1306 // several code parts rely on ilObjUser being always included
1307 include_once "Services/User/classes/class.ilObjUser.php";
1308 }
1309 }
1310
1316 protected static function getCurrentCmd()
1317 {
1318 $cmd = $_REQUEST["cmd"];
1319 if(is_array($cmd))
1320 {
1321 return array_shift(array_keys($cmd));
1322 }
1323 else
1324 {
1325 return $cmd;
1326 }
1327 }
1328
1334 protected static function blockedAuthentication($a_current_script)
1335 {
1337 {
1338 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for WAC request.');
1339 return true;
1340 }
1342 {
1343 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for sso request.');
1344 return true;
1345 }
1347 {
1348 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for webdav request');
1349 return true;
1350 }
1352 {
1353 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for shibboleth request.');
1354 return true;
1355 }
1356
1357 if(
1358 $a_current_script == "register.php" ||
1359 $a_current_script == "pwassist.php" ||
1360 $a_current_script == "confirmReg.php" ||
1361 $a_current_script == "il_securimage_play.php" ||
1362 $a_current_script == "il_securimage_show.php" ||
1363 $a_current_script == 'login.php'
1364 )
1365 {
1366 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for script: ' . $a_current_script);
1367 return true;
1368 }
1369
1370 if($_REQUEST["baseClass"] == "ilStartUpGUI")
1371 {
1372 $cmd_class = $_REQUEST["cmdClass"];
1373
1374 if($cmd_class == "ilaccountregistrationgui" ||
1375 $cmd_class == "ilpasswordassistancegui")
1376 {
1377 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for cmdClass: ' . $cmd_class);
1378 return true;
1379 }
1380
1382 if(
1383 $cmd == "showTermsOfService" || $cmd == "showClientList" ||
1384 $cmd == 'showAccountMigration' || $cmd == 'migrateAccount' ||
1385 $cmd == 'processCode' || $cmd == 'showLoginPage' || $cmd == 'doStandardAuthentication' || $cmd == 'doCasAuthentication'
1386 )
1387 {
1388 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for cmd: ' . $cmd);
1389 return true;
1390 }
1391 }
1392
1393 // #12884
1394 if(($a_current_script == "goto.php" && $_GET["target"] == "impr_0") ||
1395 $_GET["baseClass"] == "ilImprintGUI")
1396 {
1397 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for baseClass: ' . $_GET['baseClass']);
1398 return true;
1399 }
1400 ilLoggerFactory::getLogger('auth')->debug('Authentication required');
1401 return false;
1402 }
1403
1409 protected static function showingLoginForm($a_current_script)
1410 {
1411 if($a_current_script == "login.php")
1412 {
1413 return true;
1414 }
1415
1416 if($_REQUEST["baseClass"] == "ilStartUpGUI" &&
1417 self::getCurrentCmd() == "showLoginPage")
1418 {
1419 return true;
1420 }
1421
1422 return false;
1423 }
1424
1432 protected static function translateMessage($a_message_id, array $a_message_static = null)
1433 {
1434 global $ilDB, $lng, $ilSetting, $ilClientIniFile, $ilUser;
1435
1436 // current language
1437 if(!$lng)
1438 {
1439 $lang = "en";
1440 if($ilUser)
1441 {
1442 $lang = $ilUser->getLanguage();
1443 }
1444 else if($_REQUEST["lang"])
1445 {
1446 $lang = (string)$_REQUEST["lang"];
1447 }
1448 else if($ilSetting)
1449 {
1450 $lang = $ilSetting->get("language");
1451 }
1452 else if($ilClientIniFile)
1453 {
1454 $lang = $ilClientIniFile->readVariable("language", "default");
1455 }
1456 }
1457 else
1458 {
1459 $lang = $lng->getLangKey();
1460 }
1461
1462 $message = "";
1463 if($ilDB && $a_message_id)
1464 {
1465 if(!$lng)
1466 {
1467 require_once "./Services/Language/classes/class.ilLanguage.php";
1468 $lng = new ilLanguage($lang);
1469 }
1470
1471 $lng->loadLanguageModule("init");
1472 $message = $lng->txt($a_message_id);
1473 }
1474 else if(is_array($a_message_static))
1475 {
1476 if(!isset($a_message_static[$lang]))
1477 {
1478 $lang = "en";
1479 }
1480 $message = $a_message_static[$lang];
1481 }
1482
1483 return utf8_decode($message);
1484 }
1485
1493 protected static function redirect($a_target, $a_message_id = '', array $a_message_static = null)
1494 {
1495 // #12739
1496 if(defined("ILIAS_HTTP_PATH") &&
1497 !stristr($a_target, ILIAS_HTTP_PATH))
1498 {
1499 $a_target = ILIAS_HTTP_PATH."/".$a_target;
1500 }
1501
1503 {
1504 ilUtil::redirect($a_target);
1505 }
1506 else
1507 {
1508 $message = self::translateMessage($a_message_id, $a_message_static);
1509
1510 // user-directed linked message
1512 {
1513 $link = self::translateMessage("init_error_redirect_click",
1514 array("en" => 'Please click to continue.',
1515 "de" => 'Bitte klicken um fortzufahren.'));
1516 $mess = $message.
1517 '<br /><a href="'.$a_target.'">'.$link.'</a>';
1518 }
1519 // plain text
1520 else
1521 {
1522 // not much we can do here
1523 $mess = $message;
1524
1525 if(!trim($mess))
1526 {
1527 $mess = self::translateMessage("init_error_redirect_info",
1528 array("en" => 'Redirect not supported by context.',
1529 "de" => 'Weiterleitungen werden durch Kontext nicht unterstützt.')).
1530 ' ('.$a_target.')';
1531 }
1532 }
1533
1534 self::abortAndDie($mess);
1535 }
1536 }
1537
1541 public static function redirectToStartingPage()
1542 {
1546 global $ilUser;
1547
1548 // fallback, should never happen
1549 if ($ilUser->getId() == ANONYMOUS_USER_ID)
1550 {
1552 return true;
1553 }
1554
1555 // for password change and incomplete profile
1556 // see ilPersonalDesktopGUI
1557 if(!$_GET["target"])
1558 {
1559 // Redirect here to switch back to http if desired
1560 include_once './Services/User/classes/class.ilUserUtil.php';
1562 }
1563 else
1564 {
1565 ilUtil::redirect("goto.php?target=".$_GET["target"]);
1566 }
1567 }
1568}
$_COOKIE['ilClientId']
Definition: BPMN2Parser.php:15
const PEAR_ERROR_CALLBACK
Definition: PEAR.php:35
global $tpl
Definition: ilias.php:8
global $l
Definition: afr.php:30
$path
Definition: aliased.php:25
$_GET["client_id"]
$_POST["username"]
An exception for terminatinating execution or to throw for unit testing.
Renderer that dispatches rendering of UI components to a Renderer found in the same namespace as the ...
Wraps global ilTemplate to provide JavaScriptBinding.
const IL_COMP_SERVICE
static getInstance()
Get instance.
static handleForcedAuthentication()
static usesTemplate()
Uses template engine.
const CONTEXT_WEBDAV
const CONTEXT_SHIBBOLETH
const CONTEXT_APACHE_SSO
static supportsRedirects()
Are redirects supported?
static hasUser()
Based on user authentication?
static supportsPersistentSessions()
Check if context supports persistent session handling.
static getType()
Get context type.
static hasHTML()
Has HTML output.
static usesHTTP()
Uses HTTP aka browser.
static initClient()
Init client.
const CONTEXT_SOAP
const CONTEXT_WAC
static start()
Start task scheduler for each server instance.
Class ilGlobalCacheSettings.
static setup(ilGlobalCacheSettings $ilGlobalCacheSettings)
HTTPS.
static getInstance()
Get https instance.
INIFile Parser.
ILIAS Initialisation Utility Class perform basic setup: init database handler, load configuration fil...
static blockedAuthentication($a_current_script)
Block authentication based on current request.
static initDatabase()
initialise database object $ilDB
static goToLogin()
go to login
static initILIAS()
ilias initialisation
static initLocale()
Init Locale.
static removeUnsafeCharacters()
Remove unsafe characters from GET.
static buildHTTPPath()
builds http path
static requireCommonIncludes()
get common include code files
static initClientIniFile()
This method provides a global instance of class ilIniFile for the client.ini.php file in variable $il...
static getCurrentCmd()
Extract current cmd from request.
static initSession()
Init session.
static initClient()
Init client-based objects (level 1)
static initCore()
Init core objects (level 0)
static recursivelyRemoveUnsafeCharacters($var)
static initUIFramework(\ILIAS\DI\Container $c)
init the ILIAS UI framework.
static includePhp5Compliance()
This is a hack for authentication.
static handleErrorReporting()
Set error reporting level.
static determineClient()
This method determines the current client and sets the constant CLIENT_ID.
static authenticate()
Try authentication.
static translateMessage($a_message_id, array $a_message_static=null)
Translate message if possible.
static redirect($a_target, $a_message_id='', array $a_message_static=null)
Redirects to target url if context supports it.
static initHTML()
init HTML output (level 3)
static initLog()
Init log instance.
static goToPublicSection()
go to public section
static resumeUserSession()
Resume an existing user session.
static setSessionHandler()
set session handler to db
static handleDevMode()
Prepare developer tools
static showingLoginForm($a_current_script)
Is current view the login form?
static initUser()
Init user / authentification (level 2)
static initGlobal($a_name, $a_class, $a_source_file=null)
Initialize global instance.
static abortAndDie($a_message)
Exit.
static setSessionCookieParams()
set session cookie params
static initSettings()
initialise $ilSettings object and define constants
static handleMaintenanceMode()
handle maintenance mode
static initAccessHandling()
$ilAccess and $rbac... initialisation
static initIliasIniFile()
This method provides a global instance of class ilIniFile for the ilias.ini.php file in variable $ilI...
static initStyle()
provide $styleDefinition object
language handling
static getRootLogger()
The unique root logger has a fixed error level.
static getLogger($a_component_id)
Get component logger.
Handles display of the main menu.
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
Database Session Handling.
static _exists($a_session_id)
Check whether session exists.
static set($a_var, $a_val)
Set a value.
static setClosingContext($a_context)
set closing context (for statistics)
const SESSION_CLOSE_LOGIN
static get($a_var)
Get a value.
const SESSION_CLOSE_PUBLIC
const SESSION_CLOSE_EXPIRE
special template class to simplify handling of ITX/PEAR
static initDefaultTimeZone(ilIniFile $ini)
Initialize default timezone from system settings.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Class ilUserAccountMaintenanceEnforcement.
static getStartingPointAsUrl()
Get current starting point setting as URL.
static setCookie($a_cookie_name, $a_cookie_value='', $a_also_set_super_global=true, $a_set_cookie_invalid=false)
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static redirect($a_script)
http redirect to other script
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static removeTrailingPathSeparators($path)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$client_id
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
Definition: langwiz.php:349
Interface Card \UI\Component\Card.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27
global $lng
Definition: privfeed.php:17
global $ilSetting
Definition: privfeed.php:17
global $ilErr
Definition: raiseError.php:16
$cmd
Definition: sahs_server.php:35
$cookie_path
Definition: index.php:6
const IL_COOKIE_PATH(isset($_GET["client_id"]))
Definition: index.php:26
global $ilDB
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
$ilIliasIniFile
global $DIC
$https
Definition: imgupload.php:19
$ilUser
Definition: imgupload.php:18
const ILIAS_MODULE
Definition: server.php:14