ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilInitialisation Class Reference

ILIAS Initialisation Utility Class perform basic setup: init database handler, load configuration file, init user authentification & error handler, load object type definitions. More...

+ Collaboration diagram for ilInitialisation:

Public Member Functions

 removeUnsafeCharacters ()
 Remove unsafe characters from GET.
 requireCommonIncludes ()
 get common include code files
 initIliasIniFile ()
 This method provides a global instance of class ilIniFile for the ilias.ini.php file in variable $ilIliasIniFile.
 determineClient ()
 This method determines the current client and sets the constant CLIENT_ID.
 initClientIniFile ()
 This method provides a global instance of class ilIniFile for the client.ini.php file in variable $ilClientIniFile.
 initDatabase ()
 initialise database object $ilDB
 initEventHandling ()
 initialise event handler ilAppEventHandler
 initILIAS ($context="web")
 ilias initialisation
 initLog ()
 persistCMIData ()

Static Public Member Functions

static setSessionHandler ()
 set session handler to db
static goToPublicSection ($a_auth_stat="")
 go to public section
static initILIAS ()
 ilias initialisation
static authenticate ()
 Try authentication.

Static Protected Member Functions

static removeUnsafeCharacters ()
 Remove unsafe characters from GET.
static requireCommonIncludes ()
 get common include code files
static includePhp5Compliance ()
 This is a hack for authentication.
static initIliasIniFile ()
 This method provides a global instance of class ilIniFile for the ilias.ini.php file in variable $ilIliasIniFile.
static buildHTTPPath ()
 builds http path
static determineClient ()
 This method determines the current client and sets the constant CLIENT_ID.
static initClientIniFile ()
 This method provides a global instance of class ilIniFile for the client.ini.php file in variable $ilClientIniFile.
static handleMaintenanceMode ()
 handle maintenance mode
static initDatabase ()
 initialise database object $ilDB
static setCookieParams ()
 set session cookie params for path, domain, etc.
static initSettings ()
 initialise $ilSettings object and define constants
static initStyle ()
 provide $styleDefinition object
static initLocale ()
 Init Locale.
static goToLogin ($a_auth_stat="")
 go to login
static initLanguage ()
 $lng initialisation
static initAccessHandling ()
 $ilAccess and $rbac...
static initLog ()
 Init log instance.
static initGlobal ($a_name, $a_class, $a_source_file=null)
 Initialize global instance.
static abortAndDie ($a_message)
 Exit.
static handleDevMode ()
 Prepare developer tools.
static initCore ()
 Init core objects (level 0)
static initClient ()
 Init client-based objects (level 1)
static initUser ()
 Init user / authentification (level 2)
static getCurrentCmd ()
 Extract current cmd from request.
static blockedAuthentication ($a_current_script)
 Block authentication based on current request.
static showingLoginForm ($a_current_script)
 Is current view the login form?
static translateMessage ($a_message_id, array $a_message_static=null)
 Translate message if possible.
static redirect ($a_target, $a_message_id, $a_message_static)
 Redirects to target url if context supports it.

Static Protected Attributes

static $already_initialized

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:
class.ilInitialisation.php 55257 2014-11-18 10:36:52Z bheyser
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
Uwe Kohnle kohnl.nosp@m.e@in.nosp@m.terne.nosp@m.tleh.nosp@m.rer-g.nosp@m.mbh..nosp@m.de
Version
Id:
class.ilInitialisation.php 26932 2010-12-09 16:26:46Z mjansen

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

Member Function Documentation

static ilInitialisation::abortAndDie (   $a_message)
staticprotected

Exit.

Parameters
string$a_message

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

References $GLOBALS.

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

{
if(is_object($GLOBALS['ilLog']))
{
$GLOBALS['ilLog']->write("Fatal Error: ilInitialisation - ".$a_message);
}
die($a_message);
}

+ Here is the caller graph for this function:

static ilInitialisation::authenticate ( )
static

Try authentication.

This will basically validate the current session

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

References $ilErr.

Referenced by ilWebAccessChecker\checkAccess(), and initILIAS().

{
global $ilAuth, $ilias, $ilErr;
$current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
if(self::blockedAuthentication($current_script))
{
return;
}
$oldSid = session_id();
$ilAuth->start();
$ilias->setAuthError($ilErr->getLastError());
if(IS_PAYMENT_ENABLED)
{
// cart is "attached" to session, has to be updated
$newSid = session_id();
if($oldSid != $newSid)
{
include_once './Services/Payment/classes/class.ilPaymentShoppingCart.php';
ilPaymentShoppingCart::_migrateShoppingCart($oldSid, $newSid);
}
}
if($ilAuth->getAuth() && $ilAuth->getStatus() == '')
{
self::initUserAccount();
self::handleAuthenticationSuccess();
}
else
{
if (!self::showingLoginForm($current_script))
{
// :TODO: should be moved to context?!
$mandatory_auth = ($current_script != "shib_login.php"
&& $current_script != "shib_logout.php"
&& $current_script != "error.php"
&& $current_script != "chat.php"
&& $current_script != "index.php"); // #10316
if($mandatory_auth)
{
self::handleAuthenticationFail();
}
}
}
}

+ Here is the caller graph for this function:

static ilInitialisation::blockedAuthentication (   $a_current_script)
staticprotected

Block authentication based on current request.

Returns
boolean

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

References $_GET, $_REQUEST, $cmd, and getCurrentCmd().

{
if($a_current_script == "register.php" ||
$a_current_script == "pwassist.php" ||
$a_current_script == "confirmReg.php" ||
$a_current_script == "il_securimage_play.php" ||
$a_current_script == "il_securimage_show.php")
{
return true;
}
if($_REQUEST["baseClass"] == "ilStartUpGUI")
{
$cmd_class = $_REQUEST["cmdClass"];
if($cmd_class == "ilaccountregistrationgui" ||
$cmd_class == "ilpasswordassistancegui")
{
return true;
}
if($cmd == "showTermsOfService" || $cmd == "showClientList" ||
$cmd == 'showAccountMigration' || $cmd == 'migrateAccount' ||
$cmd == 'processCode')
{
return true;
}
}
// #12884
if(($a_current_script == "goto.php" && $_GET["target"] == "impr_0") ||
$_GET["baseClass"] == "ilImprintGUI")
{
return true;
}
return false;
}

+ Here is the call graph for this function:

static ilInitialisation::buildHTTPPath ( )
staticprotected

builds http path

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

References $dirs, $https, $path, ILIAS_MODULE, and ilUtil\removeTrailingPathSeparators().

Referenced by initSettings().

{
include_once './Services/Http/classes/class.ilHTTPS.php';
$https = new ilHTTPS();
if($https->isDetected())
{
$protocol = 'https://';
}
else
{
$protocol = 'http://';
}
$host = $_SERVER['HTTP_HOST'];
$rq_uri = $_SERVER['REQUEST_URI'];
// security fix: this failed, if the URI contained "?" and following "/"
// -> we remove everything after "?"
if (is_int($pos = strpos($rq_uri, "?")))
{
$rq_uri = substr($rq_uri, 0, $pos);
}
if(!defined('ILIAS_MODULE'))
{
$path = pathinfo($rq_uri);
if(!$path['extension'])
{
$uri = $rq_uri;
}
else
{
$uri = dirname($rq_uri);
}
}
else
{
// if in module remove module name from HTTP_PATH
$path = dirname($rq_uri);
// dirname cuts the last directory from a directory path e.g content/classes return content
$dirs = explode('/',$module);
$uri = $path;
foreach($dirs as $dir)
{
$uri = dirname($uri);
}
}
return define('ILIAS_HTTP_PATH',ilUtil::removeTrailingPathSeparators($protocol.$host.$uri));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilInitialisation::determineClient ( )

This method determines the current client and sets the constant CLIENT_ID.

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

References $_GET, and $ilIliasIniFile.

{
// check whether ini file object exists
if (!is_object($ilIliasIniFile))
{
die ("Fatal Error: ilInitialisation::determineClient called without initialisation of ILIAS ini file object.");
}
if ($_GET["client_id"] != "") define ("CLIENT_ID", $_GET["client_id"]);
else define ("CLIENT_ID", $ilIliasIniFile->readVariable("clients","default"));
}
static ilInitialisation::determineClient ( )
staticprotected

This method determines the current client and sets the constant CLIENT_ID.

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

References $_COOKIE, $_GET, $client_id, $ilIliasIniFile, abortAndDie(), ilUtil\setCookie(), and ilUtil\stripSlashes().

Referenced by initClient(), and initILIAS().

{
// check whether ini file object exists
if (!is_object($ilIliasIniFile))
{
self::abortAndDie("Fatal Error: ilInitialisation::determineClient called without initialisation of ILIAS ini file object.");
}
// set to default client if empty
if ($_GET["client_id"] != "")
{
$_GET["client_id"] = ilUtil::stripSlashes($_GET["client_id"]);
if (!defined("IL_PHPUNIT_TEST"))
{
ilUtil::setCookie("ilClientId", $_GET["client_id"]);
}
}
else if (!$_COOKIE["ilClientId"])
{
// to do: ilias ini raus nehmen
$client_id = $ilIliasIniFile->readVariable("clients","default");
ilUtil::setCookie("ilClientId", $client_id);
}
if (!defined("IL_PHPUNIT_TEST"))
{
define ("CLIENT_ID", $_COOKIE["ilClientId"]);
}
else
{
define ("CLIENT_ID", $_GET["client_id"]);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilInitialisation::getCurrentCmd ( )
staticprotected

Extract current cmd from request.

Returns
string

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

References $_REQUEST, and $cmd.

Referenced by blockedAuthentication().

{
$cmd = $_REQUEST["cmd"];
if(is_array($cmd))
{
return array_shift(array_keys($cmd));
}
else
{
return $cmd;
}
}

+ Here is the caller graph for this function:

static ilInitialisation::goToLogin (   $a_auth_stat = "")
staticprotected

go to login

Parameters
int$a_auth_stat

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

References $_COOKIE, $_GET, AUTH_EXPIRED, AUTH_IDLED, redirect(), ilSession\SESSION_CLOSE_EXPIRE, ilSession\SESSION_CLOSE_LOGIN, and ilSession\setClosingContext().

{
global $ilAuth;
// close current session
if($a_auth_stat == AUTH_EXPIRED ||
$a_auth_stat == AUTH_IDLED)
{
}
else
{
}
$ilAuth->logout();
session_unset();
session_destroy();
$add = "";
if ($_GET["soap_pw"] != "")
{
$add = "&soap_pw=".$_GET["soap_pw"]."&ext_uid=".$_GET["ext_uid"];
}
$script = "login.php?target=".$_GET["target"]."&client_id=".$_COOKIE["ilClientId"].
"&auth_stat=".$a_auth_stat.$add;
self::redirect($script, "init_error_authentication_fail",
array("en" => "Authentication failed.",
"de" => "Authentifizierung fehlgeschlagen."));
}

+ Here is the call graph for this function:

static ilInitialisation::goToPublicSection (   $a_auth_stat = "")
static

go to public section

Parameters
int$a_auth_stat

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

References $_GET, $_POST, ilAuthUtils\_initAuth(), abortAndDie(), AUTH_EXPIRED, AUTH_IDLED, redirect(), ilSession\SESSION_CLOSE_EXPIRE, ilSession\SESSION_CLOSE_PUBLIC, ilSession\setClosingContext(), and setSessionHandler().

Referenced by ilStartUpGUI\processIndexPHP().

{
global $ilAuth;
if (ANONYMOUS_USER_ID == "")
{
self::abortAndDie("Public Section enabled, but no Anonymous user found.");
}
// logout and end previous session
if($a_auth_stat == AUTH_EXPIRED ||
$a_auth_stat == AUTH_IDLED)
{
}
else
{
}
$ilAuth->logout();
session_unset();
session_destroy();
// new session and login as anonymous
session_start();
$_POST["username"] = "anonymous";
$_POST["password"] = "anonymous";
// authenticate (anonymous)
$oldSid = session_id();
$ilAuth->start();
if (IS_PAYMENT_ENABLED)
{
$newSid = session_id();
if($oldSid != $newSid)
{
include_once './Services/Payment/classes/class.ilPaymentShoppingCart.php';
ilPaymentShoppingCart::_migrateShoppingCart($oldSid, $newSid);
}
}
if (!$ilAuth->getAuth())
{
self::abortAndDie("ANONYMOUS user with the object_id ".ANONYMOUS_USER_ID." not found!");
}
self::initUserAccount();
$mess_id = "init_error_authentication_fail";
$mess = array("en" => "Authentication failed.",
"de" => "Authentifizierung fehlgeschlagen.");
// if target given, try to go there
if ($_GET["target"] != "")
{
// when we are already "inside" goto.php no redirect is needed
$current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
if($current_script == "goto.php")
{
return;
}
// goto will check if target is accessible or redirect to login
self::redirect("goto.php?target=".$_GET["target"], $mess_id, $mess);
}
// we do not know if ref_id of request is accesible, so redirecting to root
$_GET["ref_id"] = ROOT_FOLDER_ID;
$_GET["cmd"] = "frameset";
self::redirect("ilias.php?baseClass=ilrepositorygui&reloadpublic=1&cmd=".
$_GET["cmd"]."&ref_id=".$_GET["ref_id"], $mess_id, $mess);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilInitialisation::handleDevMode ( )
staticprotected

Prepare developer tools.

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

Referenced by initClient().

{
if(defined(SHOWNOTICES) && SHOWNOTICES)
{
// no further differentiating of php version regarding to 5.4 neccessary
// when the error reporting is set to E_ALL anyway
// remove notices from error reporting
if (version_compare(PHP_VERSION, '5.3.0', '>='))
{
error_reporting(E_ALL);
}
else
{
error_reporting(E_ALL);
}
}
include_once "include/inc.debug.php";
}

+ Here is the caller graph for this function:

static ilInitialisation::handleMaintenanceMode ( )
staticprotected

handle maintenance mode

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

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

Referenced by initClient().

{
global $ilClientIniFile;
if (!$ilClientIniFile->readVariable("client","access"))
{
$mess = array("en" => "The server is not available due to maintenance.".
" We apologise for any inconvenience.",
"de" => "Der Server ist aufgrund von Wartungsarbeiten nicht verfügbar.".
" Wir bitten um Verständnis.");
$mess_id = "init_error_maintenance";
if (ilContext::hasHTML() && is_file("./maintenance.html"))
{
self::redirect("./maintenance.html", $mess_id, $mess);
}
else
{
$mess = self::translateMessage($mess_id, $mess);
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilInitialisation::includePhp5Compliance ( )
staticprotected

This is a hack for authentication.

Since the phpCAS lib ships with its own compliance functions.

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

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

Referenced by initILIAS().

{
// php5 downward complaince to php 4 dom xml and clone method
if (version_compare(PHP_VERSION,'5','>='))
{
include_once 'Services/Authentication/classes/class.ilAuthFactory.php';
{
require_once("include/inc.xml5compliance.php");
}
require_once("include/inc.xsl5compliance.php");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilInitialisation::initAccessHandling ( )
staticprotected

$ilAccess and $rbac...

initialisation

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

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

Referenced by initUser().

{
self::initGlobal("rbacreview", "ilRbacReview",
"./Services/AccessControl/classes/class.ilRbacReview.php");
require_once "./Services/AccessControl/classes/class.ilRbacSystem.php";
$rbacsystem = ilRbacSystem::getInstance();
self::initGlobal("rbacsystem", $rbacsystem);
self::initGlobal("rbacadmin", "ilRbacAdmin",
"./Services/AccessControl/classes/class.ilRbacAdmin.php");
self::initGlobal("ilAccess", "ilAccessHandler",
"./Services/AccessControl/classes/class.ilAccessHandler.php");
require_once "./Services/AccessControl/classes/class.ilConditionHandler.php";
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilInitialisation::initClient ( )
staticprotected

Init client-based objects (level 1)

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

References $GLOBALS, $https, determineClient(), handleDevMode(), handleMaintenanceMode(), initClientIniFile(), initDatabase(), initGlobal(), initLocale(), initLog(), initSettings(), setCookieParams(), setSessionHandler(), and ilContext\usesHTTP().

Referenced by initILIAS().

{
global $https, $ilias;
// --- needs client ini
$ilias->client_id = CLIENT_ID;
if (DEVMODE)
{
}
// --- needs database
self::initGlobal("ilAppEventHandler", "ilAppEventHandler",
"./Services/EventHandling/classes/class.ilAppEventHandler.php");
// there are rare cases where initILIAS is called twice for a request
// example goto.php is called and includes ilias.php later
// we must prevent that ilPluginAdmin is initialized twice in
// this case, since this won't get the values out of plugin.php the
// second time properly
if (!is_object($GLOBALS["ilPluginAdmin"]))
{
self::initGlobal("ilPluginAdmin", "ilPluginAdmin",
"./Services/Component/classes/class.ilPluginAdmin.php");
}
// --- needs settings
{
// $https
self::initGlobal("https", "ilHTTPS", "./Services/Http/classes/class.ilHTTPS.php");
$https->enableSecureCookies();
$https->checkPort();
}
// --- object handling
self::initGlobal("ilObjDataCache", "ilObjectDataCache",
"./Services/Object/classes/class.ilObjectDataCache.php");
// needed in ilObjectDefinition
require_once "./Services/Xml/classes/class.ilSaxParser.php";
self::initGlobal("objDefinition", "ilObjectDefinition",
"./Services/Object/classes/class.ilObjectDefinition.php");
// $tree
require_once "./Services/Tree/classes/class.ilTree.php";
$tree = new ilTree(ROOT_FOLDER_ID);
self::initGlobal("tree", $tree);
unset($tree);
self::initGlobal("ilCtrl", "ilCtrl",
"./Services/UICore/classes/class.ilCtrl.php");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilInitialisation::initClientIniFile ( )

This method provides a global instance of class ilIniFile for the client.ini.php file in variable $ilClientIniFile.

It initializes a lot of constants accordingly to the settings in the client.ini.php file.

Preconditions: ILIAS_WEB_DIR and CLIENT_ID must be set.

Returns
boolean true, if no error occured with client init file otherwise false

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

References $GLOBALS, ILIAS_ABSOLUTE_PATH, and ILIAS_WEB_DIR.

{
global $ilClientIniFile;
// check whether ILIAS_WEB_DIR is set.
if (ILIAS_WEB_DIR == "")
{
die ("Fatal Error: ilInitialisation::initClientIniFile called without ILIAS_WEB_DIR.");
}
// check whether CLIENT_ID is set.
if (CLIENT_ID == "")
{
die ("Fatal Error: ilInitialisation::initClientIniFile called without CLIENT_ID.");
}
$ini_file = "./".ILIAS_WEB_DIR."/".CLIENT_ID."/client.ini.php";
// get settings from ini file
require_once("./Services/Init/classes/class.ilIniFile.php");
$ilClientIniFile = new ilIniFile($ini_file);
$GLOBALS['ilClientIniFile'] =& $ilClientIniFile;
$ilClientIniFile->read();
// if no ini-file found switch to setup routine
if ($ilClientIniFile->ERROR != "")
{
throw new ilException('No Client INI File!! (ClientID "'.CLIENT_ID.'" / '.$ilClientIniFile->ERROR.')');
return false;
}
// set constants
define ("CLIENT_DATA_DIR",ILIAS_DATA_DIR."/".CLIENT_ID);
define ("CLIENT_WEB_DIR",ILIAS_ABSOLUTE_PATH."/".ILIAS_WEB_DIR."/".CLIENT_ID);
define ("CLIENT_NAME",$ilClientIniFile->readVariable('client','name')); // Change SS
define ("ROOT_FOLDER_ID",$ilClientIniFile->readVariable('system','ROOT_FOLDER_ID'));
$val = $ilClientIniFile->readVariable("db","type");
if ($val == "")
{
define ("IL_DB_TYPE", "mysql");
}
else
{
define ("IL_DB_TYPE", $val);
}
return true;
}
static ilInitialisation::initClientIniFile ( )
staticprotected

This method provides a global instance of class ilIniFile for the client.ini.php file in variable $ilClientIniFile.

It initializes a lot of constants accordingly to the settings in the client.ini.php file.

Preconditions: ILIAS_WEB_DIR and CLIENT_ID must be set.

Returns
boolean true, if no error occured with client init file otherwise false

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

References $_COOKIE, $ilIliasIniFile, abortAndDie(), ILIAS_ABSOLUTE_PATH, ILIAS_WEB_DIR, initGlobal(), redirect(), and ilUtil\setCookie().

Referenced by initClient(), and initILIAS().

{
// check whether ILIAS_WEB_DIR is set.
if (ILIAS_WEB_DIR == "")
{
self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile called without ILIAS_WEB_DIR.");
}
// check whether CLIENT_ID is set.
if (CLIENT_ID == "")
{
self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile called without CLIENT_ID.");
}
$ini_file = "./".ILIAS_WEB_DIR."/".CLIENT_ID."/client.ini.php";
// get settings from ini file
require_once("./Services/Init/classes/class.ilIniFile.php");
$ilClientIniFile = new ilIniFile($ini_file);
$ilClientIniFile->read();
// invalid client id / client ini
if ($ilClientIniFile->ERROR != "")
{
$c = $_COOKIE["ilClientId"];
$default_client = $ilIliasIniFile->readVariable("clients","default");
ilUtil::setCookie("ilClientId", $default_client);
if (CLIENT_ID != "" && CLIENT_ID != $default_client)
{
$mess = array("en" => "Client does not exist.",
"de" => "Mandant ist ungültig.");
self::redirect("index.php?client_id=".$default_client, null, $mess);
}
else
{
self::abortAndDie("Invalid client");
}
}
self::initGlobal("ilClientIniFile", $ilClientIniFile);
// set constants
define ("SESSION_REMINDER_LEADTIME", 30);
define ("DEBUG",$ilClientIniFile->readVariable("system","DEBUG"));
define ("DEVMODE",$ilClientIniFile->readVariable("system","DEVMODE"));
define ("SHOWNOTICES",$ilClientIniFile->readVariable("system","SHOWNOTICES"));
define ("ROOT_FOLDER_ID",$ilClientIniFile->readVariable('system','ROOT_FOLDER_ID'));
define ("SYSTEM_FOLDER_ID",$ilClientIniFile->readVariable('system','SYSTEM_FOLDER_ID'));
define ("ROLE_FOLDER_ID",$ilClientIniFile->readVariable('system','ROLE_FOLDER_ID'));
define ("MAIL_SETTINGS_ID",$ilClientIniFile->readVariable('system','MAIL_SETTINGS_ID'));
// this is for the online help installation, which sets OH_REF_ID to the
// ref id of the online module
define ("OH_REF_ID",$ilClientIniFile->readVariable("system","OH_REF_ID"));
define ("SYSTEM_MAIL_ADDRESS",$ilClientIniFile->readVariable('system','MAIL_SENT_ADDRESS')); // Change SS
define ("MAIL_REPLY_WARNING",$ilClientIniFile->readVariable('system','MAIL_REPLY_WARNING')); // Change SS
// see ilObject::TITLE_LENGTH, ilObject::DESC_LENGTH
// define ("MAXLENGTH_OBJ_TITLE",125);#$ilClientIniFile->readVariable('system','MAXLENGTH_OBJ_TITLE'));
// define ("MAXLENGTH_OBJ_DESC",$ilClientIniFile->readVariable('system','MAXLENGTH_OBJ_DESC'));
define ("CLIENT_DATA_DIR",ILIAS_DATA_DIR."/".CLIENT_ID);
define ("CLIENT_WEB_DIR",ILIAS_ABSOLUTE_PATH."/".ILIAS_WEB_DIR."/".CLIENT_ID);
define ("CLIENT_NAME",$ilClientIniFile->readVariable('client','name')); // Change SS
$val = $ilClientIniFile->readVariable("db","type");
if ($val == "")
{
define ("IL_DB_TYPE", "mysql");
}
else
{
define ("IL_DB_TYPE", $val);
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilInitialisation::initCore ( )
staticprotected

Init core objects (level 0)

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

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

Referenced by initILIAS().

{
global $ilErr;
// remove notices from error reporting
if (version_compare(PHP_VERSION, '5.4.0', '>='))
{
// Prior to PHP 5.4.0 E_ALL does not include E_STRICT.
// With PHP 5.4.0 and above E_ALL >DOES< include E_STRICT.
error_reporting(((ini_get("error_reporting") & ~E_NOTICE) & ~E_DEPRECATED) & ~E_STRICT);
}
elseif (version_compare(PHP_VERSION, '5.3.0', '>='))
{
error_reporting((ini_get("error_reporting") & ~E_NOTICE) & ~E_DEPRECATED);
}
else
{
error_reporting(ini_get('error_reporting') & ~E_NOTICE);
}
// breaks CAS: must be included after CAS context isset in AuthUtils
//self::includePhp5Compliance();
// error handler
self::initGlobal("ilErr", "ilErrorHandling",
"./Services/Init/classes/class.ilErrorHandling.php");
$ilErr->setErrorHandling(PEAR_ERROR_CALLBACK, array($ilErr, 'errorHandler'));
// :TODO: obsolete?
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($ilErr, "errorHandler"));
// workaround: load old post variables if error handler 'message' was called
include_once "Services/Authentication/classes/class.ilSession.php";
if (ilSession::get("message"))
{
$_POST = ilSession::get("post_vars");
}
// deprecated
self::initGlobal("ilias", "ILIAS", "./Services/Init/classes/class.ilias.php");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilInitialisation::initDatabase ( )

initialise database object $ilDB

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

References $GLOBALS, $ilDB, and ilDBWrapperFactory\getWrapper().

{
global $ilDB, $ilClientIniFile;
// build dsn of database connection and connect
require_once("./Services/Database/classes/class.ilDBWrapperFactory.php");
$ilDB = ilDBWrapperFactory::getWrapper(IL_DB_TYPE);
$ilDB->initFromIniFile();
$ilDB->connect();
$GLOBALS['ilDB'] = $ilDB;
}

+ Here is the call graph for this function:

static ilInitialisation::initDatabase ( )
staticprotected

initialise database object $ilDB

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

References $ilDB, ilDBWrapperFactory\getWrapper(), and initGlobal().

Referenced by initClient(), and initILIAS().

{
// build dsn of database connection and connect
require_once("./Services/Database/classes/class.ilDBWrapperFactory.php");
$ilDB->initFromIniFile();
$ilDB->connect();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilInitialisation::initEventHandling ( )

initialise event handler ilAppEventHandler

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

References $GLOBALS.

{
global $ilAppEventHandler;
// build dsn of database connection and connect
require_once("./Services/EventHandling/classes/class.ilAppEventHandler.php");
$ilAppEventHandler = new ilAppEventHandler();
$GLOBALS['ilAppEventHandler'] =& $ilAppEventHandler;
}
static ilInitialisation::initGlobal (   $a_name,
  $a_class,
  $a_source_file = null 
)
staticprotected

Initialize global instance.

Parameters
string$a_name
string$a_class
string$a_source_file

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

References $GLOBALS.

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

{
if($a_source_file)
{
include_once $a_source_file;
$GLOBALS[$a_name] = new $a_class;
}
else
{
$GLOBALS[$a_name] = $a_class;
}
}

+ Here is the caller graph for this function:

ilInitialisation::initILIAS (   $context = "web")

ilias initialisation

Parameters
string$contextthis is used for circumvent redirects to the login page if called e.g. by soap

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

References $_GET, $GLOBALS, $https, $ilBench, $ilCtrl, $ilDB, $ilErr, $ilIliasIniFile, $ilLog, $ilSetting, $ilUser, $lng, determineClient(), initClientIniFile(), initDatabase(), initIliasIniFile(), initLog(), persistCMIData(), removeUnsafeCharacters(), requireCommonIncludes(), and ilSCORM2004StoreData\scormPlayerUnload().

{
global $ilDB, $ilUser, $ilLog, $ilErr, $ilClientIniFile, $ilIliasIniFile,
$ilSetting, $ilias, $https, $ilObjDataCache,
$ilLog, $objDefinition, $lng, $ilCtrl, $ilBrowser, $ilHelp,
$ilTabs, $ilMainMenu, $rbacsystem, $ilNavigationHistory;
// remove unsafe characters
// error reporting
// remove notices from error reporting
if (version_compare(PHP_VERSION, '5.3.0', '>='))
{
error_reporting((ini_get("error_reporting") & ~E_NOTICE) & ~E_DEPRECATED);
}
else
{
error_reporting(ini_get('error_reporting') & ~E_NOTICE);
}
$ilUser = new ilObjUserMin();
$GLOBALS['ilUser'] =& $ilUser;
// include common code files
global $ilBench;
// $ilIliasIniFile initialisation
$this->initIliasIniFile();
// CLIENT_ID determination
$this->determineClient();
// $ilAppEventHandler initialisation
//$this->initEventHandling();
// $ilClientIniFile initialisation
if (!$this->initClientIniFile())
{
die("no client");
}
// $ilDB initialisation
$this->initDatabase();
$this->initLog();
// settings
$ilSetting = new ilSetting();
$GLOBALS['ilSetting'] = & $ilSetting;
// init tree
require_once "./Services/Tree/classes/class.ilTree.php";
$tree = new ilTree(ROOT_FOLDER_ID);
$GLOBALS['tree'] =& $tree;
if ((string) $_GET['do'] == "unload") {
include_once './Modules/Scorm2004/classes/class.ilSCORM2004StoreData.php';
}
else $this->persistCMIData();
}

+ Here is the call graph for this function:

static ilInitialisation::initILIAS ( )
static

ilias initialisation

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

References authenticate(), ilContext\doAuthentication(), ilContext\hasHTML(), ilContext\hasUser(), includePhp5Compliance(), ilContext\initClient(), initClient(), initCore(), initLanguage(), initUser(), and ilECSTaskScheduler\start().

Referenced by ilSoapAdministration\getClientInfoXML(), ilSoapAdministration\getInstallationInfoXML(), ilCalendarRemoteAccessHandler\initIlias(), and ilSoapAdministration\initIlias().

{
if (self::$already_initialized)
{
return;
}
self::$already_initialized = true;
global $tree;
{
{
{
}
}
// init after Auth otherwise breaks CAS
// language may depend on user setting
$tree->initLangCode();
{
include_once('./Services/WebServices/ECS/classes/class.ilECSTaskScheduler.php');
self::initHTML();
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilInitialisation::initIliasIniFile ( )

This method provides a global instance of class ilIniFile for the ilias.ini.php file in variable $ilIliasIniFile.

It initializes a lot of constants accordingly to the settings in the ilias.ini.php file.

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

References $GLOBALS, and $ilIliasIniFile.

{
require_once("./Services/Init/classes/class.ilIniFile.php");
$ilIliasIniFile = new ilIniFile("./ilias.ini.php");
$GLOBALS['ilIliasIniFile'] =& $ilIliasIniFile;
$ilIliasIniFile->read();
// initialize constants
define("ILIAS_DATA_DIR",$ilIliasIniFile->readVariable("clients","datadir"));
define("ILIAS_WEB_DIR",$ilIliasIniFile->readVariable("clients","path"));
define("ILIAS_ABSOLUTE_PATH",$ilIliasIniFile->readVariable('server','absolute_path'));
// logging
define ("ILIAS_LOG_DIR",$ilIliasIniFile->readVariable("log","path"));
define ("ILIAS_LOG_FILE",$ilIliasIniFile->readVariable("log","file"));
define ("ILIAS_LOG_ENABLED",$ilIliasIniFile->readVariable("log","enabled"));
define ("ILIAS_LOG_LEVEL",$ilIliasIniFile->readVariable("log","level"));
$tz = $ilIliasIniFile->readVariable("server","timezone");
if ($tz != "")
{
if (function_exists('date_default_timezone_set'))
{
date_default_timezone_set($tz);
}
}
define ("IL_TIMEZONE", $ilIliasIniFile->readVariable("server","timezone"));
}
static ilInitialisation::initIliasIniFile ( )
staticprotected

This method provides a global instance of class ilIniFile for the ilias.ini.php file in variable $ilIliasIniFile.

It initializes a lot of constants accordingly to the settings in the ilias.ini.php file.

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

References $ilIliasIniFile, and initGlobal().

Referenced by initCore(), and initILIAS().

{
require_once("./Services/Init/classes/class.ilIniFile.php");
$ilIliasIniFile = new ilIniFile("./ilias.ini.php");
$ilIliasIniFile->read();
self::initGlobal('ilIliasIniFile', $ilIliasIniFile);
// initialize constants
define("ILIAS_DATA_DIR",$ilIliasIniFile->readVariable("clients","datadir"));
define("ILIAS_WEB_DIR",$ilIliasIniFile->readVariable("clients","path"));
define("ILIAS_ABSOLUTE_PATH",$ilIliasIniFile->readVariable('server','absolute_path'));
// logging
define ("ILIAS_LOG_DIR",$ilIliasIniFile->readVariable("log","path"));
define ("ILIAS_LOG_FILE",$ilIliasIniFile->readVariable("log","file"));
define ("ILIAS_LOG_ENABLED",$ilIliasIniFile->readVariable("log","enabled"));
define ("ILIAS_LOG_LEVEL",$ilIliasIniFile->readVariable("log","level"));
define ("SLOW_REQUEST_TIME",$ilIliasIniFile->readVariable("log","slow_request_time"));
// read path + command for third party tools from ilias.ini
define ("PATH_TO_CONVERT",$ilIliasIniFile->readVariable("tools","convert"));
define ("PATH_TO_FFMPEG",$ilIliasIniFile->readVariable("tools","ffmpeg"));
define ("PATH_TO_ZIP",$ilIliasIniFile->readVariable("tools","zip"));
define ("PATH_TO_MKISOFS",$ilIliasIniFile->readVariable("tools","mkisofs"));
define ("PATH_TO_UNZIP",$ilIliasIniFile->readVariable("tools","unzip"));
define ("PATH_TO_GHOSTSCRIPT",$ilIliasIniFile->readVariable("tools","ghostscript"));
define ("PATH_TO_JAVA",$ilIliasIniFile->readVariable("tools","java"));
define ("PATH_TO_HTMLDOC",$ilIliasIniFile->readVariable("tools","htmldoc"));
define ("URL_TO_LATEX",$ilIliasIniFile->readVariable("tools","latex"));
define ("PATH_TO_FOP",$ilIliasIniFile->readVariable("tools","fop"));
// read virus scanner settings
switch ($ilIliasIniFile->readVariable("tools", "vscantype"))
{
case "sophos":
define("IL_VIRUS_SCANNER", "Sophos");
define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
break;
case "antivir":
define("IL_VIRUS_SCANNER", "AntiVir");
define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
break;
case "clamav":
define("IL_VIRUS_SCANNER", "ClamAV");
define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
break;
default:
define("IL_VIRUS_SCANNER", "None");
break;
}
$tz = $ilIliasIniFile->readVariable("server","timezone");
if ($tz != "")
{
if (function_exists('date_default_timezone_set'))
{
date_default_timezone_set($tz);
}
}
define ("IL_TIMEZONE", $ilIliasIniFile->readVariable("server","timezone"));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilInitialisation::initLanguage ( )
staticprotected

$lng initialisation

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

References $_GET, $_POST, $ilSetting, $ilUser, $lng, ilSession\get(), ilLanguage\getInstalledLanguages(), initGlobal(), ilSession\set(), and ilUtil\stripSlashes().

Referenced by initILIAS().

{
global $ilUser, $ilSetting, $rbacsystem;
if (!ilSession::get("lang"))
{
if ($_GET['lang'])
{
$_GET['lang'] = $_GET['lang'];
}
else
{
if (is_object($ilUser))
{
$_GET['lang'] = $ilUser->getPref('language');
}
}
}
if (isset($_POST['change_lang_to']) && $_POST['change_lang_to'] != "")
{
$_GET['lang'] = ilUtil::stripSlashes($_POST['change_lang_to']);
}
// prefer personal setting when coming from login screen
// Added check for ilUser->getId > 0 because it is 0 when the language is changed and the terms of service should be displayes (Helmut Schottm��ller, 2006-10-14)
if (is_object($ilUser) && $ilUser->getId() != ANONYMOUS_USER_ID && $ilUser->getId() > 0)
{
ilSession::set('lang', $ilUser->getPref('language'));
}
ilSession::set('lang', (isset($_GET['lang']) && $_GET['lang']) ? $_GET['lang'] : ilSession::get('lang'));
// check whether lang selection is valid
require_once "./Services/Language/classes/class.ilLanguage.php";
if (!in_array(ilSession::get('lang'), $langs))
{
if (is_object($ilSetting) && $ilSetting->get('language') != '')
{
ilSession::set('lang', $ilSetting->get('language'));
}
else
{
ilSession::set('lang', $langs[0]);
}
}
$_GET['lang'] = ilSession::get('lang');
$lng = new ilLanguage(ilSession::get('lang'));
if(is_object($rbacsystem))
{
$rbacsystem->initMemberView();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilInitialisation::initLocale ( )
staticprotected

Init Locale.

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

References $GLOBALS, and $ilSetting.

Referenced by initClient().

{
global $ilSetting;
if (trim($ilSetting->get("locale") != ""))
{
$larr = explode(",", trim($ilSetting->get("locale")));
$ls = array();
$first = $larr[0];
foreach ($larr as $l)
{
if (trim($l) != "")
{
$ls[] = $l;
}
}
if (count($ls) > 0)
{
setlocale(LC_ALL, $ls);
if (class_exists("Collator"))
{
$GLOBALS["ilCollator"] = new Collator($first);
}
}
}
}

+ Here is the caller graph for this function:

ilInitialisation::initLog ( )

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

References $GLOBALS, $ilLog, and $log.

{
global $ilLog;
$log = new ilLog(ILIAS_LOG_DIR,ILIAS_LOG_FILE,CLIENT_ID,ILIAS_LOG_ENABLED,ILIAS_LOG_LEVEL);
$GLOBALS['log'] = $log;
$ilLog = $log;
$GLOBALS['ilLog'] = $ilLog;
}
static ilInitialisation::initLog ( )
staticprotected

Init log instance.

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

References $log, abortAndDie(), and initGlobal().

Referenced by initClient(), and initILIAS().

{
require_once "./Services/Logging/classes/class.ilLog.php";
try
{
$log = new ilLog(ILIAS_LOG_DIR,ILIAS_LOG_FILE,CLIENT_ID,ILIAS_LOG_ENABLED,ILIAS_LOG_LEVEL);
}
catch(ilLogException $e)
{
self::abortAndDie($e->getMessage());
}
// deprecated
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilInitialisation::initSettings ( )
staticprotected

initialise $ilSettings object and define constants

Used in Soap

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

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

Referenced by initClient().

{
global $ilSetting;
self::initGlobal("ilSetting", "ilSetting",
"Services/Administration/classes/class.ilSetting.php");
// check correct setup
if (!$ilSetting->get("setup_ok"))
{
self::abortAndDie("Setup is not completed. Please run setup routine again.");
}
// set anonymous user & role id and system role id
define ("ANONYMOUS_USER_ID", $ilSetting->get("anonymous_user_id"));
define ("ANONYMOUS_ROLE_ID", $ilSetting->get("anonymous_role_id"));
define ("SYSTEM_USER_ID", $ilSetting->get("system_user_id"));
define ("SYSTEM_ROLE_ID", $ilSetting->get("system_role_id"));
define ("USER_FOLDER_ID", 7);
// recovery folder
define ("RECOVERY_FOLDER_ID", $ilSetting->get("recovery_folder_id"));
// installation id
define ("IL_INST_ID", $ilSetting->get("inst_id",0));
// define default suffix replacements
define ("SUFFIX_REPL_DEFAULT", "php,php3,php4,inc,lang,phtml,htaccess");
define ("SUFFIX_REPL_ADDITIONAL", $ilSetting->get("suffix_repl_additional"));
{
}
// payment setting
require_once('Services/Payment/classes/class.ilPaymentSettings.php');
define('IS_PAYMENT_ENABLED', ilPaymentSettings::_isPaymentEnabled());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilInitialisation::initStyle ( )
staticprotected

provide $styleDefinition object

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

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

{
global $styleDefinition, $ilPluginAdmin;
// load style definitions
self::initGlobal("styleDefinition", "ilStyleDefinition",
"./Services/Style/classes/class.ilStyleDefinition.php");
// add user interface hook for style initialisation
$pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
foreach ($pl_names as $pl)
{
$ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
$gui_class = $ui_plugin->getUIClassInstance();
$gui_class->modifyGUI("Services/Init", "init_style", array("styleDefinition" => $styleDefinition));
}
$styleDefinition->startParsing();
}

+ Here is the call graph for this function:

static ilInitialisation::initUser ( )
staticprotected

Init user / authentification (level 2)

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

References $_GET, $_POST, $_SESSION, $ilUser, ilSession\_destroy(), ilAuthUtils\_initAuth(), initAccessHandling(), initGlobal(), ilSession\SESSION_CLOSE_LOGIN, ilSession\set(), and ilContext\usesHTTP().

Referenced by initILIAS().

{
global $ilias, $ilAuth, $ilUser;
{
// allow login by submitting user data
// in query string when DEVMODE is enabled
if( DEVMODE
&& isset($_GET['username']) && strlen($_GET['username'])
&& isset($_GET['password']) && strlen($_GET['password'])
){
$_POST['username'] = $_GET['username'];
$_POST['password'] = $_GET['password'];
}
}
// $ilAuth
require_once "Auth/Auth.php";
require_once "./Services/AuthShibboleth/classes/class.ilShibboleth.php";
include_once("./Services/Authentication/classes/class.ilAuthUtils.php");
$ilias->auth = $ilAuth;
// $ilUser
self::initGlobal("ilUser", "ilObjUser",
"./Services/User/classes/class.ilObjUser.php");
$ilias->account =& $ilUser;
// force login
if ((isset($_GET["cmd"]) && $_GET["cmd"] == "force_login"))
{
$ilAuth->logout();
// we need to do this for the session statistics
// could we use session_destroy() instead?
// [this is done after every $ilAuth->logout() call elsewhere]
// :TODO: keep session because of cart content?
if(!isset($_GET['forceShoppingCartRedirect']))
{
$_SESSION = array();
}
else
{
ilSession::set("AccountId", "");
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilInitialisation::persistCMIData ( )

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

References $_GET, $ilDB, $ilLog, $ilUser, $lm_set, $packageId, and ilUtil\yn2tf().

Referenced by initILIAS().

{
global $ilLog, $ilDB, $ilUser;
$packageId=(int)$_GET['package_id'];
$lm_set = $ilDB->queryF('SELECT default_lesson_mode, interactions, objectives, comments FROM sahs_lm WHERE id = %s',
array('integer'),array($packageId));
while($lm_rec = $ilDB->fetchAssoc($lm_set))
{
$defaultLessonMode=($lm_rec["default_lesson_mode"]);
$interactions=(ilUtil::yn2tf($lm_rec["interactions"]));
$objectives=(ilUtil::yn2tf($lm_rec["objectives"]));
$comments=(ilUtil::yn2tf($lm_rec["comments"]));
}
$data = file_get_contents('php://input');
$ilUser->setId($data->p);
include_once './Modules/Scorm2004/classes/class.ilSCORM2004StoreData.php';
$defaultLessonMode, $comments,
$interactions, $objectives,$data);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilInitialisation::redirect (   $a_target,
  $a_message_id,
  $a_message_static 
)
staticprotected

Redirects to target url if context supports it.

Parameters
string$a_target
string$a_message_id
array$a_message_details

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

References abortAndDie(), ilContext\hasHTML(), ilContext\supportsRedirects(), translateMessage(), and ilContext\usesHTTP().

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

{
// #12739
if(defined("ILIAS_HTTP_PATH") &&
!stristr($a_target, ILIAS_HTTP_PATH))
{
$a_target = ILIAS_HTTP_PATH."/".$a_target;
}
{
ilUtil::redirect($a_target);
}
else
{
$message = self::translateMessage($a_message_id, $a_message_static);
// user-directed linked message
{
$link = self::translateMessage("init_error_redirect_click",
array("en" => 'Please click to continue.',
"de" => 'Bitte klicken um fortzufahren.'));
$mess = $message.
'<br /><a href="'.$a_target.'">'.$link.'</a>';
}
// plain text
else
{
// not much we can do here
$mess = $message;
if(!trim($mess))
{
$mess = self::translateMessage("init_error_redirect_info",
array("en" => 'Redirect not supported by context.',
"de" => 'Weiterleitungen werden durch Kontext nicht unterstützt.')).
' ('.$a_target.')';
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilInitialisation::removeUnsafeCharacters ( )

Remove unsafe characters from GET.

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

References $_GET.

{
// Remove unsafe characters from GET parameters.
// We do not need this characters in any case, so it is
// feasible to filter them everytime. POST parameters
// need attention through ilUtil::stripSlashes() and similar functions)
if (is_array($_GET))
{
foreach($_GET as $k => $v)
{
// \r\n used for IMAP MX Injection
// ' used for SQL Injection
$_GET[$k] = str_replace(array("\x00", "\n", "\r", "\\", "'", '"', "\x1a"), "", $v);
// this one is for XSS of any kind
$_GET[$k] = strip_tags($_GET[$k]);
}
}
}
static ilInitialisation::removeUnsafeCharacters ( )
staticprotected

Remove unsafe characters from GET.

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

References $_GET.

Referenced by initCore(), and initILIAS().

{
// Remove unsafe characters from GET parameters.
// We do not need this characters in any case, so it is
// feasible to filter them everytime. POST parameters
// need attention through ilUtil::stripSlashes() and similar functions)
if (is_array($_GET))
{
foreach($_GET as $k => $v)
{
// \r\n used for IMAP MX Injection
// ' used for SQL Injection
$_GET[$k] = str_replace(array("\x00", "\n", "\r", "\\", "'", '"', "\x1a"), "", $v);
// this one is for XSS of any kind
$_GET[$k] = strip_tags($_GET[$k]);
}
}
}

+ Here is the caller graph for this function:

ilInitialisation::requireCommonIncludes ( )

get common include code files

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

References $GLOBALS, and $ilBench.

{
global $ilBench;
// get pear
require_once("include/inc.get_pear.php");
require_once("include/inc.check_pear.php");
//include class.util first to start StopWatch
require_once "./Services/Utilities/classes/class.ilUtil.php";
require_once "./Services/Utilities/classes/class.ilBenchmark.php";
$ilBench = new ilBenchmark();
$GLOBALS['ilBench'] = $ilBench;
// Major PEAR Includes
require_once "PEAR.php";
//require_once "DB.php";
// require_once "Auth/Auth.php";
//include classes and function libraries
require_once "./Services/Database/classes/class.ilDB.php";
// require_once "classes/class.ilias.php";
// require_once './Services/User/classes/class.ilObjUser.php';
require_once "./Services/Logging/classes/class.ilLog.php";
// require_once "classes/class.ilObjectDataCache.php";
require_once "./Services/Init/classes/class.ilErrorHandling.php";
require_once "./Services/Administration/classes/class.ilSetting.php";
}
static ilInitialisation::requireCommonIncludes ( )
staticprotected

get common include code files

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

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

Referenced by initCore(), and initILIAS().

{
// pear
require_once("include/inc.get_pear.php");
require_once("include/inc.check_pear.php");
require_once "PEAR.php";
// ilTemplate
{
// HTML_Template_IT support
@include_once "HTML/Template/ITX.php"; // new implementation
if (class_exists("HTML_Template_ITX"))
{
include_once "./Services/UICore/classes/class.ilTemplateHTMLITX.php";
}
else
{
include_once "HTML/ITX.php"; // old implementation
include_once "./Services/UICore/classes/class.ilTemplateITX.php";
}
require_once "./Services/UICore/classes/class.ilTemplate.php";
}
// really always required?
require_once "./Services/Utilities/classes/class.ilUtil.php";
require_once "./Services/Utilities/classes/class.ilFormat.php";
require_once "./Services/Calendar/classes/class.ilDatePresentation.php";
require_once "include/inc.ilias_version.php";
self::initGlobal("ilBench", "ilBenchmark", "./Services/Utilities/classes/class.ilBenchmark.php");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilInitialisation::setCookieParams ( )
staticprotected

set session cookie params for path, domain, etc.

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

References $GLOBALS, $ilSetting, ilAuthFactory\CONTEXT_HTTP, ilAuthFactory\getContext(), ilHTTPS\getInstance(), and IL_COOKIE_PATH.

Referenced by initClient().

{
global $ilSetting;
include_once 'Services/Authentication/classes/class.ilAuthFactory.php';
{
$cookie_path = '/';
}
elseif ($GLOBALS['COOKIE_PATH'])
{
// use a predefined cookie path from WebAccessChecker
$cookie_path = $GLOBALS['COOKIE_PATH'];
}
else
{
$cookie_path = dirname( $_SERVER['PHP_SELF'] );
}
/* if ilias is called directly within the docroot $cookie_path
is set to '/' expecting on servers running under windows..
here it is set to '\'.
in both cases a further '/' won't be appended due to the following regex
*/
$cookie_path .= (!preg_match("/[\/|\\\\]$/", $cookie_path)) ? "/" : "";
if($cookie_path == "\\") $cookie_path = '/';
include_once './Services/Http/classes/class.ilHTTPS.php';
$cookie_secure = !$ilSetting->get('https', 0) && ilHTTPS::getInstance()->isDetected();
define('IL_COOKIE_EXPIRE',0);
define('IL_COOKIE_PATH',$cookie_path);
define('IL_COOKIE_DOMAIN','');
define('IL_COOKIE_SECURE', $cookie_secure); // Default Value
// session_set_cookie_params() supports 5th parameter
// only for php version 5.2.0 and above
if( version_compare(PHP_VERSION, '5.2.0', '>=') )
{
// PHP version >= 5.2.0
define('IL_COOKIE_HTTPONLY',true); // Default Value
session_set_cookie_params(
IL_COOKIE_EXPIRE, IL_COOKIE_PATH, IL_COOKIE_DOMAIN, IL_COOKIE_SECURE, IL_COOKIE_HTTPONLY
);
}
else
{
// PHP version < 5.2.0
session_set_cookie_params(
IL_COOKIE_EXPIRE, IL_COOKIE_PATH, IL_COOKIE_DOMAIN, IL_COOKIE_SECURE
);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilInitialisation::setSessionHandler ( )
static

set session handler to db

Used in Soap/CAS

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

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

Referenced by goToPublicSection(), initClient(), and CASClient\renameSession().

{
if(ini_get('session.save_handler') != 'user')
{
ini_set("session.save_handler", "user");
}
require_once "Services/Authentication/classes/class.ilSessionDBHandler.php";
$db_session_handler = new ilSessionDBHandler();
if (!$db_session_handler->setSaveHandler())
{
self::abortAndDie("Please turn off Safe mode OR set session.save_handler to \"user\" in your php.ini");
}
// Do not accept external session ids
if (!ilSession::_exists(session_id()) && !defined('IL_PHPUNIT_TEST'))
{
session_regenerate_id();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilInitialisation::showingLoginForm (   $a_current_script)
staticprotected

Is current view the login form?

Returns
boolean

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

References $_REQUEST.

{
if($a_current_script == "login.php")
{
return true;
}
if($_REQUEST["baseClass"] == "ilStartUpGUI" &&
self::getCurrentCmd() == "showLogin")
{
return true;
}
return false;
}
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 1433 of file class.ilInitialisation.php.

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

Referenced by handleMaintenanceMode(), and redirect().

{
global $ilDB, $lng, $ilSetting, $ilClientIniFile, $ilUser;
// current language
if(!$lng)
{
$lang = "en";
if($ilUser)
{
$lang = $ilUser->getLanguage();
}
else if($_REQUEST["lang"])
{
$lang = (string)$_REQUEST["lang"];
}
else if($ilSetting)
{
$lang = $ilSetting->get("language");
}
else if($ilClientIniFile)
{
$lang = $ilClientIniFile->readVariable("language", "default");
}
}
else
{
$lang = $lng->getLangKey();
}
$message = "";
if($ilDB && $a_message_id)
{
if(!$lng)
{
require_once "./Services/Language/classes/class.ilLanguage.php";
$lng = new ilLanguage($lang);
}
$lng->loadLanguageModule("init");
$message = $lng->txt($a_message_id);
}
else if(is_array($a_message_static))
{
if(!isset($a_message_static[$lang]))
{
$lang = "en";
}
$message = $a_message_static[$lang];
}
return utf8_decode($message);
}

+ Here is the caller graph for this function:

Field Documentation

ilInitialisation::$already_initialized
staticprotected

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


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