ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 
4 // needed for slow queries, etc.
5 if(!isset($GLOBALS['ilGlobalStartTime']) || !$GLOBALS['ilGlobalStartTime'])
6 {
7  $GLOBALS['ilGlobalStartTime'] = microtime();
8 }
9 
10 include_once "Services/Context/classes/class.ilContext.php";
11 
28 {
32  protected static function removeUnsafeCharacters()
33  {
34  // Remove unsafe characters from GET parameters.
35  // We do not need this characters in any case, so it is
36  // feasible to filter them everytime. POST parameters
37  // need attention through ilUtil::stripSlashes() and similar functions)
38  $_GET = self::recursivelyRemoveUnsafeCharacters($_GET);
39  }
40 
41  protected static function recursivelyRemoveUnsafeCharacters($var) {
42  if (is_array($var)) {
43  $mod = array();
44  foreach ($var as $k => $v) {
45  $k = self::recursivelyRemoveUnsafeCharacters($k);
46  $mod[$k] = self::recursivelyRemoveUnsafeCharacters($v);
47  }
48  return $mod;
49  }
50  return strip_tags(
51  str_replace(
52  array("\x00", "\n", "\r", "\\", "'", '"', "\x1a"),
53  "",
54  $var
55  )
56  );
57  }
58 
62  protected static function requireCommonIncludes()
63  {
64  // pear
65  require_once("include/inc.get_pear.php");
66  require_once("include/inc.check_pear.php");
67  require_once "PEAR.php";
68 
69  // ilTemplate
71  {
72  // HTML_Template_IT support
73  require_once "HTML/Template/ITX.php";
74  require_once "./Services/UICore/classes/class.ilTemplateHTMLITX.php";
75  require_once "./Services/UICore/classes/class.ilTemplate.php";
76  }
77 
78  // really always required?
79  require_once "./Services/Utilities/classes/class.ilUtil.php";
80  require_once "./Services/Utilities/classes/class.ilFormat.php";
81  require_once "./Services/Calendar/classes/class.ilDatePresentation.php";
82  require_once "include/inc.ilias_version.php";
83 
84  self::initGlobal("ilBench", "ilBenchmark", "./Services/Utilities/classes/class.ilBenchmark.php");
85  }
86 
92  protected static function includePhp5Compliance()
93  {
94  include_once 'Services/Authentication/classes/class.ilAuthFactory.php';
96  {
97  require_once("include/inc.xml5compliance.php");
98  }
99  require_once("include/inc.xsl5compliance.php");
100  }
101 
109  protected static function initIliasIniFile()
110  {
111  require_once("./Services/Init/classes/class.ilIniFile.php");
112  $ilIliasIniFile = new ilIniFile("./ilias.ini.php");
113  $ilIliasIniFile->read();
114  self::initGlobal('ilIliasIniFile', $ilIliasIniFile);
115 
116  // initialize constants
117  define("ILIAS_DATA_DIR",$ilIliasIniFile->readVariable("clients","datadir"));
118  define("ILIAS_WEB_DIR",$ilIliasIniFile->readVariable("clients","path"));
119  define("ILIAS_ABSOLUTE_PATH",$ilIliasIniFile->readVariable('server','absolute_path'));
120 
121  // logging
122  define ("ILIAS_LOG_DIR",$ilIliasIniFile->readVariable("log","path"));
123  define ("ILIAS_LOG_FILE",$ilIliasIniFile->readVariable("log","file"));
124  define ("ILIAS_LOG_ENABLED",$ilIliasIniFile->readVariable("log","enabled"));
125  define ("ILIAS_LOG_LEVEL",$ilIliasIniFile->readVariable("log","level"));
126  define ("SLOW_REQUEST_TIME",$ilIliasIniFile->readVariable("log","slow_request_time"));
127 
128  // read path + command for third party tools from ilias.ini
129  define ("PATH_TO_CONVERT",$ilIliasIniFile->readVariable("tools","convert"));
130  define ("PATH_TO_FFMPEG",$ilIliasIniFile->readVariable("tools","ffmpeg"));
131  define ("PATH_TO_ZIP",$ilIliasIniFile->readVariable("tools","zip"));
132  define ("PATH_TO_MKISOFS",$ilIliasIniFile->readVariable("tools","mkisofs"));
133  define ("PATH_TO_UNZIP",$ilIliasIniFile->readVariable("tools","unzip"));
134  define ("PATH_TO_GHOSTSCRIPT",$ilIliasIniFile->readVariable("tools","ghostscript"));
135  define ("PATH_TO_JAVA",$ilIliasIniFile->readVariable("tools","java"));
136  define ("PATH_TO_HTMLDOC",$ilIliasIniFile->readVariable("tools","htmldoc"));
137  define ("URL_TO_LATEX",$ilIliasIniFile->readVariable("tools","latex"));
138  define ("PATH_TO_FOP",$ilIliasIniFile->readVariable("tools","fop"));
139 
140  // read virus scanner settings
141  switch ($ilIliasIniFile->readVariable("tools", "vscantype"))
142  {
143  case "sophos":
144  define("IL_VIRUS_SCANNER", "Sophos");
145  define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
146  define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
147  break;
148 
149  case "antivir":
150  define("IL_VIRUS_SCANNER", "AntiVir");
151  define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
152  define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
153  break;
154 
155  case "clamav":
156  define("IL_VIRUS_SCANNER", "ClamAV");
157  define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
158  define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
159  break;
160 
161  default:
162  define("IL_VIRUS_SCANNER", "None");
163  break;
164  }
165 
166  include_once './Services/Calendar/classes/class.ilTimeZone.php';
168  define ("IL_TIMEZONE", $tz);
169  }
170 
174  protected static function buildHTTPPath()
175  {
176  include_once './Services/Http/classes/class.ilHTTPS.php';
177  $https = new ilHTTPS();
178 
179  if($https->isDetected())
180  {
181  $protocol = 'https://';
182  }
183  else
184  {
185  $protocol = 'http://';
186  }
187  $host = $_SERVER['HTTP_HOST'];
188 
189  $rq_uri = strip_tags($_SERVER['REQUEST_URI']);
190 
191  // security fix: this failed, if the URI contained "?" and following "/"
192  // -> we remove everything after "?"
193  if (is_int($pos = strpos($rq_uri, "?")))
194  {
195  $rq_uri = substr($rq_uri, 0, $pos);
196  }
197 
198  if(!defined('ILIAS_MODULE'))
199  {
200  $path = pathinfo($rq_uri);
201  if(!$path['extension'])
202  {
203  $uri = $rq_uri;
204  }
205  else
206  {
207  $uri = dirname($rq_uri);
208  }
209  }
210  else
211  {
212  // if in module remove module name from HTTP_PATH
213  $path = dirname($rq_uri);
214 
215  // dirname cuts the last directory from a directory path e.g content/classes return content
216 
218 
219  $dirs = explode('/',$module);
220  $uri = $path;
221  foreach($dirs as $dir)
222  {
223  $uri = dirname($uri);
224  }
225  }
226 
227  return define('ILIAS_HTTP_PATH',ilUtil::removeTrailingPathSeparators($protocol.$host.$uri));
228  }
229 
234  protected static function determineClient()
235  {
236  global $ilIliasIniFile;
237 
238  // check whether ini file object exists
239  if (!is_object($ilIliasIniFile))
240  {
241  self::abortAndDie("Fatal Error: ilInitialisation::determineClient called without initialisation of ILIAS ini file object.");
242  }
243 
244  // set to default client if empty
245  if ($_GET["client_id"] != "")
246  {
247  $_GET["client_id"] = ilUtil::stripSlashes($_GET["client_id"]);
248  if (!defined("IL_PHPUNIT_TEST"))
249  {
250  ilUtil::setCookie("ilClientId", $_GET["client_id"]);
251  }
252  }
253  else if (!$_COOKIE["ilClientId"])
254  {
255  // to do: ilias ini raus nehmen
256  $client_id = $ilIliasIniFile->readVariable("clients","default");
257  ilUtil::setCookie("ilClientId", $client_id);
258  }
259  if (!defined("IL_PHPUNIT_TEST"))
260  {
261  define ("CLIENT_ID", $_COOKIE["ilClientId"]);
262  }
263  else
264  {
265  define ("CLIENT_ID", $_GET["client_id"]);
266  }
267  }
268 
281  protected static function initClientIniFile()
282  {
283  global $ilIliasIniFile;
284 
285  // check whether ILIAS_WEB_DIR is set.
286  if (ILIAS_WEB_DIR == "")
287  {
288  self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile called without ILIAS_WEB_DIR.");
289  }
290 
291  // check whether CLIENT_ID is set.
292  if (CLIENT_ID == "")
293  {
294  self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile called without CLIENT_ID.");
295  }
296 
297  $ini_file = "./".ILIAS_WEB_DIR."/".CLIENT_ID."/client.ini.php";
298 
299  // get settings from ini file
300  require_once("./Services/Init/classes/class.ilIniFile.php");
301  $ilClientIniFile = new ilIniFile($ini_file);
302  $ilClientIniFile->read();
303 
304  // invalid client id / client ini
305  if ($ilClientIniFile->ERROR != "")
306  {
307  $c = $_COOKIE["ilClientId"];
308  $default_client = $ilIliasIniFile->readVariable("clients","default");
309  ilUtil::setCookie("ilClientId", $default_client);
310  if (CLIENT_ID != "" && CLIENT_ID != $default_client)
311  {
312  $mess = array("en" => "Client does not exist.",
313  "de" => "Mandant ist ungültig.");
314  self::redirect("index.php?client_id=".$default_client, null, $mess);
315  }
316  else
317  {
318  self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile initializing client ini file abborted with: ". $ilClientIniFile->ERROR);
319  }
320  }
321 
322  self::initGlobal("ilClientIniFile", $ilClientIniFile);
323 
324  // set constants
325  define ("SESSION_REMINDER_LEADTIME", 30);
326  define ("DEBUG",$ilClientIniFile->readVariable("system","DEBUG"));
327  define ("DEVMODE",$ilClientIniFile->readVariable("system","DEVMODE"));
328  define ("SHOWNOTICES",$ilClientIniFile->readVariable("system","SHOWNOTICES"));
329  define ("DEBUGTOOLS",$ilClientIniFile->readVariable("system","DEBUGTOOLS"));
330  define ("ROOT_FOLDER_ID",$ilClientIniFile->readVariable('system','ROOT_FOLDER_ID'));
331  define ("SYSTEM_FOLDER_ID",$ilClientIniFile->readVariable('system','SYSTEM_FOLDER_ID'));
332  define ("ROLE_FOLDER_ID",$ilClientIniFile->readVariable('system','ROLE_FOLDER_ID'));
333  define ("MAIL_SETTINGS_ID",$ilClientIniFile->readVariable('system','MAIL_SETTINGS_ID'));
334  $error_handler = $ilClientIniFile->readVariable('system', 'ERROR_HANDLER');
335  define ("ERROR_HANDLER", $error_handler ? $error_handler : "PRETTY_PAGE");
336  $log_error_trace = $ilClientIniFile->readVariable('system', 'LOG_ERROR_TRACE');
337  define ("LOG_ERROR_TRACE", $log_error_trace ? $log_error_trace : false);
338 
339  // this is for the online help installation, which sets OH_REF_ID to the
340  // ref id of the online module
341  define ("OH_REF_ID",$ilClientIniFile->readVariable("system","OH_REF_ID"));
342 
343  define ("SYSTEM_MAIL_ADDRESS",$ilClientIniFile->readVariable('system','MAIL_SENT_ADDRESS')); // Change SS
344  define ("MAIL_REPLY_WARNING",$ilClientIniFile->readVariable('system','MAIL_REPLY_WARNING')); // Change SS
345 
346  // see ilObject::TITLE_LENGTH, ilObject::DESC_LENGTH
347  // define ("MAXLENGTH_OBJ_TITLE",125);#$ilClientIniFile->readVariable('system','MAXLENGTH_OBJ_TITLE'));
348  // define ("MAXLENGTH_OBJ_DESC",$ilClientIniFile->readVariable('system','MAXLENGTH_OBJ_DESC'));
349 
350  define ("CLIENT_DATA_DIR",ILIAS_DATA_DIR."/".CLIENT_ID);
351  define ("CLIENT_WEB_DIR",ILIAS_ABSOLUTE_PATH."/".ILIAS_WEB_DIR."/".CLIENT_ID);
352  define ("CLIENT_NAME",$ilClientIniFile->readVariable('client','name')); // Change SS
353 
354  $val = $ilClientIniFile->readVariable("db","type");
355  if ($val == "")
356  {
357  define ("IL_DB_TYPE", "mysql");
358  }
359  else
360  {
361  define ("IL_DB_TYPE", $val);
362  }
363 
364  require_once('./Services/GlobalCache/classes/Settings/class.ilGlobalCacheSettings.php');
365  $ilGlobalCacheSettings = new ilGlobalCacheSettings();
366  $ilGlobalCacheSettings->readFromIniFile($ilClientIniFile);
367  ilGlobalCache::setup($ilGlobalCacheSettings);
368 
369  return true;
370  }
371 
375  protected static function handleMaintenanceMode()
376  {
377  global $ilClientIniFile;
378 
379  if (!$ilClientIniFile->readVariable("client","access"))
380  {
381  $mess = array("en" => "The server is not available due to maintenance.".
382  " We apologise for any inconvenience.",
383  "de" => "Der Server ist aufgrund von Wartungsarbeiten nicht verfügbar.".
384  " Wir bitten um Verständnis.");
385  $mess_id = "init_error_maintenance";
386 
387  if (ilContext::hasHTML() && is_file("./maintenance.html"))
388  {
389  self::redirect("./maintenance.html", $mess_id, $mess);
390  }
391  else
392  {
393  $mess = self::translateMessage($mess_id, $mess);
394  self::abortAndDie($mess);
395  }
396  }
397  }
398 
403  protected static function initDatabase()
404  {
405  // build dsn of database connection and connect
406  require_once("./Services/Database/classes/class.ilDBWrapperFactory.php");
408  $ilDB->initFromIniFile();
409  $ilDB->connect();
410 
411  self::initGlobal("ilDB", $ilDB);
412  }
413 
419  public static function setSessionHandler()
420  {
421  if(ini_get('session.save_handler') != 'user')
422  {
423  ini_set("session.save_handler", "user");
424  }
425 
426  require_once "Services/Authentication/classes/class.ilSessionDBHandler.php";
427  $db_session_handler = new ilSessionDBHandler();
428  if (!$db_session_handler->setSaveHandler())
429  {
430  self::abortAndDie("Please turn off Safe mode OR set session.save_handler to \"user\" in your php.ini");
431  }
432 
433  // Do not accept external session ids
434  if (!ilSession::_exists(session_id()) && !defined('IL_PHPUNIT_TEST'))
435  {
436  session_regenerate_id();
437  }
438  }
439 
443  protected static function setCookieParams()
444  {
445  global $ilSetting;
446 
447  include_once 'Services/Authentication/classes/class.ilAuthFactory.php';
449  {
450  $cookie_path = '/';
451  }
452  elseif ($GLOBALS['COOKIE_PATH'])
453  {
454  // use a predefined cookie path from WebAccessChecker
455  $cookie_path = $GLOBALS['COOKIE_PATH'];
456  }
457  else
458  {
459  $cookie_path = dirname( $_SERVER['PHP_SELF'] );
460  }
461 
462  /* if ilias is called directly within the docroot $cookie_path
463  is set to '/' expecting on servers running under windows..
464  here it is set to '\'.
465  in both cases a further '/' won't be appended due to the following regex
466  */
467  $cookie_path .= (!preg_match("/[\/|\\\\]$/", $cookie_path)) ? "/" : "";
468 
469  if($cookie_path == "\\") $cookie_path = '/';
470 
471  include_once './Services/Http/classes/class.ilHTTPS.php';
472  $cookie_secure = !$ilSetting->get('https', 0) && ilHTTPS::getInstance()->isDetected();
473 
474  define('IL_COOKIE_EXPIRE',0);
475  define('IL_COOKIE_PATH',$cookie_path);
476  define('IL_COOKIE_DOMAIN','');
477  define('IL_COOKIE_SECURE', $cookie_secure); // Default Value
478 
479  define('IL_COOKIE_HTTPONLY',true); // Default Value
480  session_set_cookie_params(
481  IL_COOKIE_EXPIRE, IL_COOKIE_PATH, IL_COOKIE_DOMAIN, IL_COOKIE_SECURE, IL_COOKIE_HTTPONLY
482  );
483  }
484 
490  protected static function initSettings()
491  {
492  global $ilSetting;
493 
494  self::initGlobal("ilSetting", "ilSetting",
495  "Services/Administration/classes/class.ilSetting.php");
496 
497  // check correct setup
498  if (!$ilSetting->get("setup_ok"))
499  {
500  self::abortAndDie("Setup is not completed. Please run setup routine again.");
501  }
502 
503  // set anonymous user & role id and system role id
504  define ("ANONYMOUS_USER_ID", $ilSetting->get("anonymous_user_id"));
505  define ("ANONYMOUS_ROLE_ID", $ilSetting->get("anonymous_role_id"));
506  define ("SYSTEM_USER_ID", $ilSetting->get("system_user_id"));
507  define ("SYSTEM_ROLE_ID", $ilSetting->get("system_role_id"));
508  define ("USER_FOLDER_ID", 7);
509 
510  // recovery folder
511  define ("RECOVERY_FOLDER_ID", $ilSetting->get("recovery_folder_id"));
512 
513  // installation id
514  define ("IL_INST_ID", $ilSetting->get("inst_id",0));
515 
516  // define default suffix replacements
517  define ("SUFFIX_REPL_DEFAULT", "php,php3,php4,inc,lang,phtml,htaccess");
518  define ("SUFFIX_REPL_ADDITIONAL", $ilSetting->get("suffix_repl_additional"));
519 
520  if(ilContext::usesHTTP())
521  {
522  self::buildHTTPPath();
523  }
524 
525  // payment setting
526  require_once('Services/Payment/classes/class.ilPaymentSettings.php');
527  define('IS_PAYMENT_ENABLED', ilPaymentSettings::_isPaymentEnabled());
528  }
529 
533  protected static function initStyle()
534  {
535  global $styleDefinition, $ilPluginAdmin;
536 
537  // load style definitions
538  self::initGlobal("styleDefinition", "ilStyleDefinition",
539  "./Services/Style/classes/class.ilStyleDefinition.php");
540 
541  // add user interface hook for style initialisation
542  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
543  foreach ($pl_names as $pl)
544  {
545  $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
546  $gui_class = $ui_plugin->getUIClassInstance();
547  $gui_class->modifyGUI("Services/Init", "init_style", array("styleDefinition" => $styleDefinition));
548  }
549 
550  $styleDefinition->startParsing();
551  }
552 
556  public static function initUserAccount()
557  {
561  global $ilUser;
562 
563  // get user id
564  if (!ilSession::get("AccountId"))
565  {
566  ilSession::set("AccountId", $ilUser->checkUserId());
567  ilSession::set('orig_request_target', '');
568  $ilUser->hasToAcceptTermsOfServiceInSession(true);
569  }
570 
571  $uid = ilSession::get("AccountId");
572  if($uid)
573  {
574  $ilUser->setId($uid);
575  $ilUser->read();
576 
577  // init console log handler
578  include_once './Services/Logging/classes/public/class.ilLoggerFactory.php';
579  ilLoggerFactory::getInstance()->initUser($ilUser->getLogin());
580  ilLoggerFactory::getRootLogger()->debug('Using default timezone: '. IL_TIMEZONE);
581  }
582  else
583  {
584  if(is_object($GLOBALS['ilLog']))
585  {
586  $GLOBALS['ilLog']->logStack();
587  }
588  self::abortAndDie("Init user account failed");
589  }
590  }
591 
595  protected static function initLocale()
596  {
597  global $ilSetting;
598 
599  if (trim($ilSetting->get("locale") != ""))
600  {
601  $larr = explode(",", trim($ilSetting->get("locale")));
602  $ls = array();
603  $first = $larr[0];
604  foreach ($larr as $l)
605  {
606  if (trim($l) != "")
607  {
608  $ls[] = $l;
609  }
610  }
611  if (count($ls) > 0)
612  {
613  setlocale(LC_ALL, $ls);
614 
615  // #15347 - making sure that floats are not changed
616  setlocale(LC_NUMERIC, "C");
617 
618  if (class_exists("Collator"))
619  {
620  $GLOBALS["ilCollator"] = new Collator($first);
621  }
622  }
623  }
624  }
625 
631  public static function goToPublicSection($a_auth_stat = "")
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  // logout and end previous session
641  if($a_auth_stat == AUTH_EXPIRED ||
642  $a_auth_stat == AUTH_IDLED)
643  {
645  }
646  else
647  {
649  }
650  $ilAuth->logout();
651  session_unset();
652  session_destroy();
653 
654  // new session and login as anonymous
655  self::setSessionHandler();
656  session_start();
657  $_POST["username"] = "anonymous";
658  $_POST["password"] = "anonymous";
660 
661  // authenticate (anonymous)
662  $oldSid = session_id();
663  $ilAuth->start();
664  if (IS_PAYMENT_ENABLED)
665  {
666  $newSid = session_id();
667  if($oldSid != $newSid)
668  {
669  include_once './Services/Payment/classes/class.ilPaymentShoppingCart.php';
670  ilPaymentShoppingCart::_migrateShoppingCart($oldSid, $newSid);
671  }
672  }
673 
674  if (!$ilAuth->getAuth())
675  {
676  self::abortAndDie("ANONYMOUS user with the object_id ".ANONYMOUS_USER_ID." not found!");
677  }
678 
679  self::initUserAccount();
680 
681  $mess_id = "init_error_authentication_fail";
682  $mess = array("en" => "Authentication failed.",
683  "de" => "Authentifizierung fehlgeschlagen.");
684 
685  // if target given, try to go there
686  if ($_GET["target"] != "")
687  {
688  // when we are already "inside" goto.php no redirect is needed
689  $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
690  if($current_script == "goto.php")
691  {
692  return;
693  }
694 
695  // goto will check if target is accessible or redirect to login
696  self::redirect("goto.php?target=".$_GET["target"], $mess_id, $mess);
697  }
698 
699  // we do not know if ref_id of request is accesible, so redirecting to root
700  $_GET["ref_id"] = ROOT_FOLDER_ID;
701  $_GET["cmd"] = "frameset";
702  self::redirect("ilias.php?baseClass=ilrepositorygui&reloadpublic=1&cmd=".
703  $_GET["cmd"]."&ref_id=".$_GET["ref_id"], $mess_id, $mess);
704  }
705 
711  protected static function goToLogin($a_auth_stat = "")
712  {
713  global $ilAuth;
714 
715  // close current session
716  if($a_auth_stat == AUTH_EXPIRED ||
717  $a_auth_stat == AUTH_IDLED)
718  {
720  }
721  else
722  {
724  }
725  $ilAuth->logout();
726  session_unset();
727  session_destroy();
728 
729  $add = "";
730  if ($_GET["soap_pw"] != "")
731  {
732  $add = "&soap_pw=".$_GET["soap_pw"]."&ext_uid=".$_GET["ext_uid"];
733  }
734 
735  $script = "login.php?target=".$_GET["target"]."&client_id=".$_COOKIE["ilClientId"].
736  "&auth_stat=".$a_auth_stat.$add;
737 
738  self::redirect($script, "init_error_authentication_fail",
739  array("en" => "Authentication failed.",
740  "de" => "Authentifizierung fehlgeschlagen."));
741  }
742 
746  protected static function initLanguage()
747  {
751  global $rbacsystem;
752 
753  require_once 'Services/Language/classes/class.ilLanguage.php';
754  self::initGlobal('lng', ilLanguage::getGlobalInstance());
755  if(is_object($rbacsystem))
756  {
757  $rbacsystem->initMemberView();
758  }
759  }
760 
764  protected static function initAccessHandling()
765  {
766  self::initGlobal("rbacreview", "ilRbacReview",
767  "./Services/AccessControl/classes/class.ilRbacReview.php");
768 
769  require_once "./Services/AccessControl/classes/class.ilRbacSystem.php";
770  $rbacsystem = ilRbacSystem::getInstance();
771  self::initGlobal("rbacsystem", $rbacsystem);
772 
773  self::initGlobal("rbacadmin", "ilRbacAdmin",
774  "./Services/AccessControl/classes/class.ilRbacAdmin.php");
775 
776  self::initGlobal("ilAccess", "ilAccessHandler",
777  "./Services/AccessControl/classes/class.ilAccessHandler.php");
778 
779  require_once "./Services/AccessControl/classes/class.ilConditionHandler.php";
780  }
781 
785  protected static function initLog()
786  {
787  include_once './Services/Logging/classes/public/class.ilLoggerFactory.php';
789 
790  self::initGlobal("ilLog", $log);
791  // deprecated
792  self::initGlobal("log", $log);
793  }
794 
802  protected static function initGlobal($a_name, $a_class, $a_source_file = null)
803  {
804  if($a_source_file)
805  {
806  include_once $a_source_file;
807  $GLOBALS[$a_name] = new $a_class;
808  }
809  else
810  {
811  $GLOBALS[$a_name] = $a_class;
812  }
813  }
814 
820  protected static function abortAndDie($a_message)
821  {
822  if(is_object($GLOBALS['ilLog']))
823  {
824  $GLOBALS['ilLog']->write("Fatal Error: ilInitialisation - ".$a_message);
825  }
826  die($a_message);
827  }
828 
832  protected static function handleDevMode()
833  {
834  if(defined(SHOWNOTICES) && SHOWNOTICES)
835  {
836  // no further differentiating of php version regarding to 5.4 neccessary
837  // when the error reporting is set to E_ALL anyway
838 
839  // add notices to error reporting
840  error_reporting(E_ALL);
841  }
842 
843  if(defined('DEBUGTOOLS') && DEBUGTOOLS)
844  {
845  include_once "include/inc.debug.php";
846  }
847  }
848 
849  protected static $already_initialized;
850 
851 
852  public static function reinitILIAS() {
853  self::$already_initialized = false;
854  self::initILIAS();
855  }
856 
860  public static function initILIAS()
861  {
862  if (self::$already_initialized)
863  {
864  // workaround for bug #17990
865  // big mess. we prevent double initialisations with ILIAS 5.1, which is good, but...
866  // the style service uses $_GET["ref_id"] to determine
867  // the context styles. $_GET["ref_id"] is "corrected" by the "goto" procedure and which calls
868  // initILIAS again.
869  // we need a mechanism that detemines our repository context and stores that in an information object
870  // usable by the style component afterwars. This needs new concepts and a refactoring.
872  {
873  global $tpl;
874  if (is_object($tpl))
875  {
876  // load style sheet depending on user's settings
877  $location_stylesheet = ilUtil::getStyleSheetLocation();
878  $tpl->setVariable("LOCATION_STYLESHEET", $location_stylesheet);
879  }
880  }
881 
882  return;
883  }
884 
885  self::$already_initialized = true;
886 
887  global $tree;
888 
889  self::initCore();
890 
892  {
893  self::initClient();
894 
895  if (ilContext::hasUser())
896  {
897  self::initUser();
898 
900  {
901  self::authenticate();
902  }
903  }
904 
905  // init after Auth otherwise breaks CAS
906  self::includePhp5Compliance();
907 
908  // language may depend on user setting
909  self::initLanguage();
910  $tree->initLangCode();
911 
912  if(ilContext::hasHTML())
913  {
914  include_once('./Services/WebServices/ECS/classes/class.ilECSTaskScheduler.php');
916 
917  self::initHTML();
918  }
919  }
920  }
921 
925  public static function handleErrorReporting()
926  {
927  // remove notices from error reporting
928  if (version_compare(PHP_VERSION, '5.4.0', '>='))
929  {
930  // Prior to PHP 5.4.0 E_ALL does not include E_STRICT.
931  // With PHP 5.4.0 and above E_ALL >DOES< include E_STRICT.
932 
933  error_reporting(((ini_get("error_reporting") & ~E_NOTICE) & ~E_DEPRECATED) & ~E_STRICT);
934  }
935  else
936  {
937  error_reporting((ini_get("error_reporting") & ~E_NOTICE) & ~E_DEPRECATED);
938  }
939 
940  // see handleDevMode() - error reporting might be overwritten again
941  // but we need the client ini first
942  }
943 
947  protected static function initCore()
948  {
949  global $ilErr;
950 
951  self::handleErrorReporting();
952 
953  // breaks CAS: must be included after CAS context isset in AuthUtils
954  //self::includePhp5Compliance();
955 
956  self::requireCommonIncludes();
957 
958 
959  // error handler
960  self::initGlobal("ilErr", "ilErrorHandling",
961  "./Services/Init/classes/class.ilErrorHandling.php");
962  $ilErr->setErrorHandling(PEAR_ERROR_CALLBACK, array($ilErr, 'errorHandler'));
963 
964  // :TODO: obsolete?
965  PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($ilErr, "errorHandler"));
966 
967  // workaround: load old post variables if error handler 'message' was called
968  include_once "Services/Authentication/classes/class.ilSession.php";
969  if (ilSession::get("message"))
970  {
971  $_POST = ilSession::get("post_vars");
972  }
973 
974  self::removeUnsafeCharacters();
975 
976  self::initIliasIniFile();
977 
978  define('IL_INITIAL_WD', getcwd());
979 
980  // deprecated
981  self::initGlobal("ilias", "ILIAS", "./Services/Init/classes/class.ilias.php");
982  }
983 
987  protected static function initClient()
988  {
989  global $https, $ilias;
990 
991  self::determineClient();
992 
993  self::initClientIniFile();
994 
995 
996  // --- needs client ini
997 
998  $ilias->client_id = CLIENT_ID;
999 
1000  if (DEVMODE)
1001  {
1002  self::handleDevMode();
1003  }
1004 
1005 
1006  self::handleMaintenanceMode();
1007 
1008  self::initDatabase();
1009 
1010  // moved after databases
1011  self::initLog();
1012 
1013  self::initGlobal("ilAppEventHandler", "ilAppEventHandler",
1014  "./Services/EventHandling/classes/class.ilAppEventHandler.php");
1015 
1016  // there are rare cases where initILIAS is called twice for a request
1017  // example goto.php is called and includes ilias.php later
1018  // we must prevent that ilPluginAdmin is initialized twice in
1019  // this case, since this won't get the values out of plugin.php the
1020  // second time properly
1021  if (!is_object($GLOBALS["ilPluginAdmin"]))
1022  {
1023  self::initGlobal("ilPluginAdmin", "ilPluginAdmin",
1024  "./Services/Component/classes/class.ilPluginAdmin.php");
1025  }
1026 
1027  self::setSessionHandler();
1028 
1029  self::initSettings();
1030 
1031 
1032  // --- needs settings
1033 
1034  self::initLocale();
1035 
1036  if(ilContext::usesHTTP())
1037  {
1038  // $https
1039  self::initGlobal("https", "ilHTTPS", "./Services/Http/classes/class.ilHTTPS.php");
1040  $https->enableSecureCookies();
1041  $https->checkPort();
1042  }
1043 
1044 
1045  // --- object handling
1046 
1047  self::initGlobal("ilObjDataCache", "ilObjectDataCache",
1048  "./Services/Object/classes/class.ilObjectDataCache.php");
1049 
1050  // needed in ilObjectDefinition
1051  require_once "./Services/Xml/classes/class.ilSaxParser.php";
1052 
1053  self::initGlobal("objDefinition", "ilObjectDefinition",
1054  "./Services/Object/classes/class.ilObjectDefinition.php");
1055 
1056  // $tree
1057  require_once "./Services/Tree/classes/class.ilTree.php";
1058  $tree = new ilTree(ROOT_FOLDER_ID);
1059  self::initGlobal("tree", $tree);
1060  unset($tree);
1061 
1062  self::initGlobal("ilCtrl", "ilCtrl",
1063  "./Services/UICore/classes/class.ilCtrl.php");
1064 
1065  self::setCookieParams();
1066  }
1067 
1071  protected static function initUser()
1072  {
1073  global $ilias, $ilAuth, $ilUser;
1074 
1075  if(ilContext::usesHTTP())
1076  {
1077  // allow login by submitting user data
1078  // in query string when DEVMODE is enabled
1079  if( DEVMODE
1080  && isset($_GET['username']) && strlen($_GET['username'])
1081  && isset($_GET['password']) && strlen($_GET['password'])
1082  ){
1083  $_POST['username'] = $_GET['username'];
1084  $_POST['password'] = $_GET['password'];
1085  }
1086  }
1087 
1088  // $ilAuth
1089  require_once "Auth/Auth.php";
1090  require_once "./Services/AuthShibboleth/classes/class.ilShibboleth.php";
1091  include_once("./Services/Authentication/classes/class.ilAuthUtils.php");
1093  $ilias->auth = $ilAuth;
1094 
1095  // $ilUser
1096  self::initGlobal("ilUser", "ilObjUser",
1097  "./Services/User/classes/class.ilObjUser.php");
1098  $ilias->account =& $ilUser;
1099 
1100  self::initAccessHandling();
1101 
1102 
1103  // force login
1104  if ((isset($_GET["cmd"]) && $_GET["cmd"] == "force_login"))
1105  {
1106  $ilAuth->logout();
1107 
1108  // we need to do this for the session statistics
1109  // could we use session_destroy() instead?
1110  // [this is done after every $ilAuth->logout() call elsewhere]
1112 
1113  // :TODO: keep session because of cart content?
1114  if(!isset($_GET['forceShoppingCartRedirect']))
1115  {
1116  $_SESSION = array();
1117  }
1118  else
1119  {
1120  ilSession::set("AccountId", "");
1121  }
1122  }
1123 
1124  }
1125 
1131  public static function authenticate()
1132  {
1133  global $ilAuth, $ilias, $ilErr;
1134 
1135  $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
1136 
1137  if(self::blockedAuthentication($current_script))
1138  {
1139  return;
1140  }
1141 
1142  if(self::showingLoginForm($current_script))
1143  {
1144  // login form is shown or user tries to authenticate => destroy old user session
1145  $ilAuth->logout();
1147  ilSession::set('AccountId', null);
1148 
1149  ilLoggerFactory::getLogger('auth')->debug('Logout called for old session on login request');
1150  }
1151 
1152 
1153 
1154  $oldSid = session_id();
1155 
1156  $ilAuth->start();
1157  $ilias->setAuthError($ilErr->getLastError());
1158 
1159  if(IS_PAYMENT_ENABLED)
1160  {
1161  // cart is "attached" to session, has to be updated
1162  $newSid = session_id();
1163  if($oldSid != $newSid)
1164  {
1165  include_once './Services/Payment/classes/class.ilPaymentShoppingCart.php';
1166  ilPaymentShoppingCart::_migrateShoppingCart($oldSid, $newSid);
1167  }
1168  }
1169 
1170  if($ilAuth->getAuth() && $ilAuth->getStatus() == '')
1171  {
1172  self::initUserAccount();
1173 
1174  self::handleAuthenticationSuccess();
1175  }
1176  else
1177  {
1178  if (!self::showingLoginForm($current_script))
1179  {
1180  // :TODO: should be moved to context?!
1181  $mandatory_auth = ($current_script != "shib_login.php"
1182  && $current_script != "shib_logout.php"
1183  && $current_script != "error.php"
1184  && $current_script != "chat.php"
1185  && $current_script != "wac.php"
1186  && $current_script != "index.php"); // #10316
1187 
1188  if($mandatory_auth)
1189  {
1190  self::handleAuthenticationFail();
1191  }
1192  }
1193  }
1194  }
1195 
1199  protected static function handleAuthenticationSuccess()
1200  {
1204  global $ilUser;
1205 
1206  require_once 'Services/Tracking/classes/class.ilOnlineTracking.php';
1207  ilOnlineTracking::updateAccess($ilUser);
1208  }
1209 
1213  protected static function handleAuthenticationFail()
1214  {
1219  global $ilAuth, $ilSetting;
1220 
1221  // #10608
1223  {
1224  throw new Exception("Authentication failed.");
1225  }
1226 
1227  $status = $ilAuth->getStatus();
1228 
1229  if($ilSetting->get('pub_section') &&
1230  ($status == '' || $status == AUTH_EXPIRED || $status == AUTH_IDLED) &&
1231  $_GET['reloadpublic'] != '1'
1232  )
1233  {
1234  self::goToPublicSection($status);
1235  }
1236  else
1237  {
1238  self::goToLogin($status);
1239  }
1240  }
1241 
1245  static function initHTML()
1246  {
1247  global $ilUser;
1248 
1249  if(ilContext::hasUser())
1250  {
1251  // load style definitions
1252  // use the init function with plugin hook here, too
1253  self::initStyle();
1254  }
1255 
1256  // $tpl
1257  $tpl = new ilTemplate("tpl.main.html", true, true);
1258  self::initGlobal("tpl", $tpl);
1260  {
1265  global $ilUser, $ilCtrl;
1266 
1267  require_once 'Services/User/classes/class.ilUserRequestTargetAdjustment.php';
1268  $request_adjuster = new ilUserRequestTargetAdjustment($ilUser, $ilCtrl);
1269  $request_adjuster->adjust();
1270  }
1271 
1272  // load style sheet depending on user's settings
1273  $location_stylesheet = ilUtil::getStyleSheetLocation();
1274  $tpl->setVariable("LOCATION_STYLESHEET",$location_stylesheet);
1275 
1276  require_once "./Services/UICore/classes/class.ilFrameTargetInfo.php";
1277 
1278  self::initGlobal("ilNavigationHistory", "ilNavigationHistory",
1279  "Services/Navigation/classes/class.ilNavigationHistory.php");
1280 
1281  self::initGlobal("ilBrowser", "ilBrowser",
1282  "./Services/Utilities/classes/class.ilBrowser.php");
1283 
1284  self::initGlobal("ilHelp", "ilHelpGUI",
1285  "Services/Help/classes/class.ilHelpGUI.php");
1286 
1287  self::initGlobal("ilToolbar", "ilToolbarGUI",
1288  "./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php");
1289 
1290  self::initGlobal("ilLocator", "ilLocatorGUI",
1291  "./Services/Locator/classes/class.ilLocatorGUI.php");
1292 
1293  self::initGlobal("ilTabs", "ilTabsGUI",
1294  "./Services/UIComponent/Tabs/classes/class.ilTabsGUI.php");
1295 
1296  if(ilContext::hasUser())
1297  {
1298  // $ilMainMenu
1299  include_once './Services/MainMenu/classes/class.ilMainMenuGUI.php';
1300  $ilMainMenu = new ilMainMenuGUI("_top");
1301  self::initGlobal("ilMainMenu", $ilMainMenu);
1302  unset($ilMainMenu);
1303 
1304 
1305  // :TODO: tableGUI related
1306 
1307  // set hits per page for all lists using table module
1308  $_GET['limit'] = (int) $ilUser->getPref('hits_per_page');
1309  ilSession::set('tbl_limit', $_GET['limit']);
1310 
1311  // the next line makes it impossible to save the offset somehow in a session for
1312  // a specific table (I tried it for the user administration).
1313  // its not posssible to distinguish whether it has been set to page 1 (=offset = 0)
1314  // or not set at all (then we want the last offset, e.g. being used from a session var).
1315  // So I added the wrapping if statement. Seems to work (hopefully).
1316  // Alex April 14th 2006
1317  if (isset($_GET['offset']) && $_GET['offset'] != "") // added April 14th 2006
1318  {
1319  $_GET['offset'] = (int) $_GET['offset']; // old code
1320  }
1321  }
1322  else
1323  {
1324  // several code parts rely on ilObjUser being always included
1325  include_once "Services/User/classes/class.ilObjUser.php";
1326  }
1327  }
1328 
1334  protected static function getCurrentCmd()
1335  {
1336  $cmd = $_REQUEST["cmd"];
1337  if(is_array($cmd))
1338  {
1339  return array_shift(array_keys($cmd));
1340  }
1341  else
1342  {
1343  return $cmd;
1344  }
1345  }
1346 
1352  protected static function blockedAuthentication($a_current_script)
1353  {
1354  if($a_current_script == "register.php" ||
1355  $a_current_script == "pwassist.php" ||
1356  $a_current_script == "confirmReg.php" ||
1357  $a_current_script == "il_securimage_play.php" ||
1358  $a_current_script == "il_securimage_show.php")
1359  {
1360  return true;
1361  }
1362 
1363  if($_REQUEST["baseClass"] == "ilStartUpGUI")
1364  {
1365  $cmd_class = $_REQUEST["cmdClass"];
1366 
1367  if($cmd_class == "ilaccountregistrationgui" ||
1368  $cmd_class == "ilpasswordassistancegui")
1369  {
1370  return true;
1371  }
1372 
1373  $cmd = self::getCurrentCmd();
1374  if($cmd == "showTermsOfService" || $cmd == "showClientList" ||
1375  $cmd == 'showAccountMigration' || $cmd == 'migrateAccount' ||
1376  $cmd == 'processCode')
1377  {
1378  return true;
1379  }
1380  }
1381 
1382  // #12884
1383  if(($a_current_script == "goto.php" && $_GET["target"] == "impr_0") ||
1384  $_GET["baseClass"] == "ilImprintGUI")
1385  {
1386  return true;
1387  }
1388 
1389  return false;
1390  }
1391 
1397  protected static function showingLoginForm($a_current_script)
1398  {
1399  if($a_current_script == "login.php")
1400  {
1401  return true;
1402  }
1403 
1404  if($_REQUEST["baseClass"] == "ilStartUpGUI" &&
1405  self::getCurrentCmd() == "showLogin")
1406  {
1407  return true;
1408  }
1409 
1410  return false;
1411  }
1412 
1420  protected static function translateMessage($a_message_id, array $a_message_static = null)
1421  {
1422  global $ilDB, $lng, $ilSetting, $ilClientIniFile, $ilUser;
1423 
1424  // current language
1425  if(!$lng)
1426  {
1427  $lang = "en";
1428  if($ilUser)
1429  {
1430  $lang = $ilUser->getLanguage();
1431  }
1432  else if($_REQUEST["lang"])
1433  {
1434  $lang = (string)$_REQUEST["lang"];
1435  }
1436  else if($ilSetting)
1437  {
1438  $lang = $ilSetting->get("language");
1439  }
1440  else if($ilClientIniFile)
1441  {
1442  $lang = $ilClientIniFile->readVariable("language", "default");
1443  }
1444  }
1445  else
1446  {
1447  $lang = $lng->getLangKey();
1448  }
1449 
1450  $message = "";
1451  if($ilDB && $a_message_id)
1452  {
1453  if(!$lng)
1454  {
1455  require_once "./Services/Language/classes/class.ilLanguage.php";
1456  $lng = new ilLanguage($lang);
1457  }
1458 
1459  $lng->loadLanguageModule("init");
1460  $message = $lng->txt($a_message_id);
1461  }
1462  else if(is_array($a_message_static))
1463  {
1464  if(!isset($a_message_static[$lang]))
1465  {
1466  $lang = "en";
1467  }
1468  $message = $a_message_static[$lang];
1469  }
1470 
1471  return utf8_decode($message);
1472  }
1473 
1481  protected static function redirect($a_target, $a_message_id, $a_message_static)
1482  {
1483  // #12739
1484  if(defined("ILIAS_HTTP_PATH") &&
1485  !stristr($a_target, ILIAS_HTTP_PATH))
1486  {
1487  $a_target = ILIAS_HTTP_PATH."/".$a_target;
1488  }
1489 
1491  {
1492  ilUtil::redirect($a_target);
1493  }
1494  else
1495  {
1496  $message = self::translateMessage($a_message_id, $a_message_static);
1497 
1498  // user-directed linked message
1500  {
1501  $link = self::translateMessage("init_error_redirect_click",
1502  array("en" => 'Please click to continue.',
1503  "de" => 'Bitte klicken um fortzufahren.'));
1504  $mess = $message.
1505  '<br /><a href="'.$a_target.'">'.$link.'</a>';
1506  }
1507  // plain text
1508  else
1509  {
1510  // not much we can do here
1511  $mess = $message;
1512 
1513  if(!trim($mess))
1514  {
1515  $mess = self::translateMessage("init_error_redirect_info",
1516  array("en" => 'Redirect not supported by context.',
1517  "de" => 'Weiterleitungen werden durch Kontext nicht unterstützt.')).
1518  ' ('.$a_target.')';
1519  }
1520  }
1521 
1522  self::abortAndDie($mess);
1523  }
1524  }
1525 }
1526 
1527 ?>
static _destroy($a_session_id, $a_closing_context=null, $a_expired_at=null)
Destroy session.
static setCookieParams()
set session cookie params for path, domain, etc.
static handleMaintenanceMode()
handle maintenance mode
Handles display of the main menu.
static hasUser()
Based on user authentication?
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
const CONTEXT_WAC
$_POST['username']
Definition: cron.php:12
setErrorHandling($mode=null, $options=null)
Sets how errors generated by this object should be handled.
Definition: PEAR.php:335
const ILIAS_MODULE
Definition: payment.php:15
const PEAR_ERROR_CALLBACK
Definition: PEAR.php:35
static goToPublicSection($a_auth_stat="")
go to public section
$_SESSION["AccountId"]
static includePhp5Compliance()
This is a hack for authentication.
static usesHTTP()
Uses HTTP aka browser.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
static blockedAuthentication($a_current_script)
Block authentication based on current request.
const IL_TIMEZONE
Class ilGlobalCacheSettings.
Database Session Handling.
static setup(ilGlobalCacheSettings $ilGlobalCacheSettings)
$_COOKIE["ilClientId"]
Definition: cron.php:11
$cmd
Definition: sahs_server.php:35
const SESSION_CLOSE_LOGIN
static determineClient()
This method determines the current client and sets the constant CLIENT_ID.
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
static initDefaultTimeZone(ilIniFile $ini)
Initialize default timezone from system settings.
const IL_COOKIE_PATH
Definition: index.php:6
static setSessionHandler()
set session handler to db
static redirect($a_target, $a_message_id, $a_message_static)
Redirects to target url if context supports it.
static getCurrentCmd()
Extract current cmd from request.
global $tpl
Definition: ilias.php:8
static initAccessHandling()
$ilAccess and $rbac...
global $ilCtrl
Definition: ilias.php:18
const SESSION_CLOSE_EXPIRE
static goToLogin($a_auth_stat="")
go to login
const ILIAS_WEB_DIR
static initILIAS()
ilias initialisation
static usesTemplate()
Uses template engine.
HTTPS.
static setCookie($a_cookie_name, $a_cookie_value='', $a_also_set_super_global=true, $a_set_cookie_invalid=false)
static start()
Start task scheduler for each server instance.
global $https
Definition: imgupload.php:15
static initDatabase()
initialise database object $ilDB
static _exists($a_session_id)
Check whether session exists.
const ILIAS_ABSOLUTE_PATH
static initClientIniFile()
This method provides a global instance of class ilIniFile for the client.ini.php file in variable $il...
static hasHTML()
Has HTML output.
static getWrapper($a_type, $a_inactive_mysqli=null)
static abortAndDie($a_message)
Exit.
special template class to simplify handling of ITX/PEAR
global $ilIliasIniFile
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
static initLocale()
Init Locale.
static requireCommonIncludes()
get common include code files
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static initLog()
Init log instance.
static removeTrailingPathSeparators($path)
Class ilUserAccountMaintenanceEnforcement.
static initStyle()
provide $styleDefinition object
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
_initAuth()
initialises $ilAuth
static initClient()
Init client-based objects (level 1)
static initIliasIniFile()
This method provides a global instance of class ilIniFile for the ilias.ini.php file in variable $ilI...
static getInstance()
Get https instance.
const SESSION_CLOSE_PUBLIC
const AUTH_IDLED
Returned if session exceeds idle time.
Definition: Auth.php:30
static removeUnsafeCharacters()
Remove unsafe characters from GET.
static initCore()
Init core objects (level 0)
static authenticate()
Try authentication.
static setClosingContext($a_context)
set closing context (for statistics)
global $ilUser
Definition: imgupload.php:15
global $l
Definition: afr.php:30
global $ilSetting
Definition: privfeed.php:40
ILIAS Initialisation Utility Class perform basic setup: init database handler, load configuration fil...
static initClient()
Init client.
global $lng
Definition: privfeed.php:40
$path
Definition: index.php:22
global $ilDB
static initGlobal($a_name, $a_class, $a_source_file=null)
Initialize global instance.
language handling
static getLogger($a_component_id)
Get component logger.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
static getType()
Get context type.
$client_id
static translateMessage($a_message_id, array $a_message_static=null)
Translate message if possible.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
static recursivelyRemoveUnsafeCharacters($var)
const CONTEXT_SOAP
const AUTH_EXPIRED
Returned if session has expired.
Definition: Auth.php:34
static redirect($a_script)
http redirect to other script
$dirs
static handleErrorReporting()
Set error reporting level.
static doAuthentication()
Try authentication.
static showingLoginForm($a_current_script)
Is current view the login form?
static initSettings()
initialise $ilSettings object and define constants
INIFile Parser.
const IL_COMP_SERVICE
static initUser()
Init user / authentification (level 2)
static buildHTTPPath()
builds http path
static getRootLogger()
The unique root logger has a fixed error level.
static supportsRedirects()
Are redirects supported?
static handleDevMode()
Prepare developer tools.