ILIAS  Release_4_1_x_branch Revision 61804
 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.
 returnBeforeAuth ($a_flag=null)
 requireCommonIncludes ()
 get common include code files
 includePhp5Compliance ()
 This is a hack for CAS authentication.
 initIliasIniFile ()
 This method provides a global instance of class ilIniFile for the ilias.ini.php file in variable $ilIliasIniFile.
 buildHTTPPath ()
 builds http path
 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.
 handleMaintenanceMode ()
 handle maintenance mode
 initDatabase ()
 initialise database object $ilDB
 initEventHandling ()
 initialise event handler ilAppEventHandler
 setSessionHandler ()
 set session handler to db
 setCookieParams ()
 set session cookie params for path, domain, etc.
 initSettings ()
 initialise $ilSettings object and define constants
 determineScriptAndUpDir ()
 determine current script and path to main ILIAS directory
 initStyle ()
 provide $styleDefinition object
 handleStyle ()
 set skin and style via $_GET parameters "skin" and "style"
 initUserAccount ()
 initLocale ()
 Init Locale.
 checkUserClientIP ()
 checkUserAgreement ()
 goToPublicSection ()
 go to public section
 goToLogin ($a_auth_stat="")
 go to login
 initLanguage ()
 $lng initialisation
 initAccessHandling ()
 $ilAccess and $rbac...
 initFeed ()
 Initialisation for feed.php.
 initLog ()
 initILIASObject ()

Data Fields

 $script = ""

Private Attributes

 $return_before_auth = false

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 37892 2012-10-26 11:25:35Z bheyser

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

Member Function Documentation

ilInitialisation::buildHTTPPath ( )

builds http path

this is also used by other classes now, e.g. in ilSoapAuthenticationCAS.php

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

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

Referenced by initSettings().

{
include_once '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::checkUserAgreement ( )

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

References $_GET, $_POST, $ilAuth, and ilUtil\redirect().

{
global $ilUser, $ilAuth;
// are we currently in user agreement acceptance?
$in_user_agreement = false;
if (strtolower($_GET["cmdClass"]) == "ilstartupgui" &&
(strtolower($_GET["cmd"]) == "getacceptance" ||
(is_array($_POST["cmd"]) &&
key($_POST["cmd"]) == "getAcceptance")))
{
$in_user_agreement = true;
}
// check wether user has accepted the user agreement
// echo "-".$script;
if (!$ilUser->hasAcceptedUserAgreement() &&
$ilAuth->getAuth() &&
!$in_user_agreement &&
$ilUser->getId() != ANONYMOUS_USER_ID &&
$ilUser->checkTimeLimit())
{
if($ilAuth->supportsRedirects())
{
ilUtil::redirect("ilias.php?baseClass=ilStartUpGUI&cmdClass=ilstartupgui&target=".$_GET["target"]."&cmd=getAcceptance");
}
}
}

+ Here is the call graph for this function:

ilInitialisation::checkUserClientIP ( )

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

References $ilAuth, $ilLog, and ilUtil\redirect().

{
global $ilUser, $ilLog, $ilAuth, $ilias;
// check client ip
$clientip = $ilUser->getClientIP();
if (trim($clientip) != "")
{
$clientip = preg_replace("/[^0-9.?*,:]+/","",$clientip);
$clientip = str_replace(".","\\.",$clientip);
$clientip = str_replace(Array("?","*",","), Array("[0-9]","[0-9]*","|"), $clientip);
if (!preg_match("/^".$clientip."$/", $_SERVER["REMOTE_ADDR"]))
{
$ilLog ->logError(1,
$ilias->account->getLogin().":".$_SERVER["REMOTE_ADDR"].":".$message);
$ilAuth->logout();
@session_destroy();
ilUtil::redirect("login.php?wrong_ip=true");
}
}
}

+ Here is the call graph for this function:

ilInitialisation::determineClient ( )

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

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

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

Referenced by initFeed().

{
// check whether ini file object exists
if (!is_object($ilIliasIniFile))
{
die ("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);
//echo "set cookie";
}
//echo "-".$_COOKIE["ilClientId"]."-";
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:

ilInitialisation::determineScriptAndUpDir ( )

determine current script and path to main ILIAS directory

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

{
$this->script = substr(strrchr($_SERVER["PHP_SELF"],"/"),1);
$dirname = dirname($_SERVER["PHP_SELF"]);
$ilurl = @parse_url(ILIAS_HTTP_PATH);
if (!$ilurl["path"])
{
$ilurl["path"] = "/";
}
$subdir = substr(strstr($dirname,$ilurl["path"]),strlen($ilurl["path"]));
$updir = "";
if ($subdir)
{
$num_subdirs = substr_count($subdir,"/");
for ($i=1;$i<=$num_subdirs;$i++)
{
$updir .= "../";
}
}
$this->updir = $updir;
}
ilInitialisation::goToLogin (   $a_auth_stat = "")

go to login

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

References $_COOKIE, $_GET, $script, and exit.

Referenced by goToPublicSection().

{
global $PHP_SELF;
session_unset();
session_destroy();
$add = "";
if ($_GET["soap_pw"] != "")
{
$add = "&soap_pw=".$_GET["soap_pw"]."&ext_uid=".$_GET["ext_uid"];
}
$script = $this->updir."login.php?target=".$_GET["target"]."&client_id=".$_COOKIE["ilClientId"].
"&auth_stat=".$a_auth_stat.$add;
// todo do it better, if JS disabled
// + this is, when session "ends", so
// we should try to prevent some information about current
// location
//
// check whether we are currently doing a goto call
if (is_int(strpos($PHP_SELF, "goto.php")) && $_GET["soap_pw"] == "" &&
$_GET["reloadpublic"] != "1")
{
$script = $this->updir."goto.php?target=".$_GET["target"]."&client_id=".CLIENT_ID.
"&reloadpublic=1";
}
echo "<script language=\"Javascript\">\ntop.location.href = \"".$script."\";\n</script>\n".
'Please click <a href="'.$script.'">here</a> if you are not redirected automatically.';
}

+ Here is the caller graph for this function:

ilInitialisation::goToPublicSection ( )

go to public section

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

References $_GET, $_POST, $ilAuth, $script, ilStartUpGUI\_checkGoto(), ilAuthUtils\_initAuth(), exit, goToLogin(), initUserAccount(), and setSessionHandler().

{
global $ilAuth;
// logout and end previous session
$ilAuth->logout();
session_unset();
session_destroy();
// new session and login as anonymous
session_start();
$_POST["username"] = "anonymous";
$_POST["password"] = "anonymous";
$oldSid = session_id();
$ilAuth->start();
if(IS_PAYMENT_ENABLED)
{
$newSid = session_id();
include_once './Services/Payment/classes/class.ilPaymentShoppingCart.php';
ilPaymentShoppingCart::_migrateShoppingCart($oldSid, $newSid);
}
if (ANONYMOUS_USER_ID == "")
{
die ("Public Section enabled, but no Anonymous user found.");
}
if (!$ilAuth->getAuth())
{
die("ANONYMOUS user with the object_id ".ANONYMOUS_USER_ID." not found!");
}
// if target given, try to go there
if ($_GET["target"] != "")
{
$this->initUserAccount();
// target is accessible -> goto target
include_once("Services/Init/classes/class.ilStartUpGUI.php");
{
// Disabled: GET parameter is kept, since no redirect. smeyer
// additional parameter capturing for survey access codes
/*
$survey_parameter = "";
if (array_key_exists("accesscode", $_GET))
{
$survey_parameter = "&accesscode=" . $_GET["accesscode"];
}
*/
// Disabled redirect for public section
return true;
#ilUtil::redirect(ILIAS_HTTP_PATH.
# "/goto.php?target=".$_GET["target"].$survey_parameter);
}
else // target is not accessible -> login
{
$this->goToLogin($_GET['auth_stat']);
}
}
$_GET["ref_id"] = ROOT_FOLDER_ID;
$_GET["cmd"] = "frameset";
$jump_script = "repository.php";
$script = $this->updir.$jump_script."?reloadpublic=1&cmd=".$_GET["cmd"]."&ref_id=".$_GET["ref_id"];
// todo do it better, if JS disabled
//echo "<script language=\"Javascript\">\ntop.location.href = \"".$script."\";\n</script>\n";
echo "<script language=\"Javascript\">\ntop.location.href = \"".$script."\";\n</script>\n".
'Please click <a href="'.$script.'">here</a> if you are not redirected automatically.';
}

+ Here is the call graph for this function:

ilInitialisation::handleMaintenanceMode ( )

handle maintenance mode

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

References ilUtil\redirect().

Referenced by initFeed().

{
global $ilClientIniFile;
if (!$ilClientIniFile->readVariable("client","access"))
{
if (is_file("./maintenance.html"))
{
ilUtil::redirect("./maintenance.html");
}
else
{
// to do: include standard template here
die('<br /><p style="text-align:center;">The server is not '.
'available due to maintenance. We apologise for any inconvenience.</p>');
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilInitialisation::handleStyle ( )

set skin and style via $_GET parameters "skin" and "style"

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

References $_GET, $_SESSION, and ilObjStyleSettings\_lookupActivatedStyle().

{
global $styleDefinition;
if (isset($_GET['skin']) && isset($_GET['style']))
{
include_once("./Services/Style/classes/class.ilObjStyleSettings.php");
if ($styleDefinition->styleExists($_GET['skin'], $_GET['style']) &&
{
$_SESSION['skin'] = $_GET['skin'];
$_SESSION['style'] = $_GET['style'];
}
}
if (isset($_SESSION['skin']) && isset($_SESSION['style']))
{
include_once("./Services/Style/classes/class.ilObjStyleSettings.php");
if ($styleDefinition->styleExists($_SESSION['skin'], $_SESSION['style']) &&
{
$ilias->account->skin = $_SESSION['skin'];
$ilias->account->prefs['style'] = $_SESSION['style'];
}
}
}

+ Here is the call graph for this function:

ilInitialisation::includePhp5Compliance ( )

This is a hack for CAS authentication.

Since the phpCAS lib ships with its own compliance functions.

Returns

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

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

{
// php5 downward complaince to php 4 dom xml and clone method
if (version_compare(PHP_VERSION,'5','>='))
{
{
require_once("include/inc.xml5compliance.php");
}
require_once("include/inc.xsl5compliance.php");
require_once("include/inc.php4compliance.php");
}
else
{
require_once("include/inc.php5compliance.php");
}
}

+ Here is the call graph for this function:

ilInitialisation::initAccessHandling ( )

$ilAccess and $rbac...

initialisation

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

References $GLOBALS, $ilBench, and ilRbacSystem\getInstance().

{
global $ilBench, $rbacsystem, $rbacadmin, $rbacreview;
$ilBench->start("Core", "HeaderInclude_initRBAC");
$rbacreview = new ilRbacReview();
$GLOBALS['rbacreview'] =& $rbacreview;
$rbacsystem = ilRbacSystem::getInstance();
$GLOBALS['rbacsystem'] =& $rbacsystem;
$rbacadmin = new ilRbacAdmin();
$GLOBALS['rbacadmin'] =& $rbacadmin;
$ilAccess = new ilAccessHandler();
$GLOBALS["ilAccess"] =& $ilAccess;
$ilBench->stop("Core", "HeaderInclude_initRBAC");
}

+ Here is the call 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 377 of file class.ilInitialisation.php.

References $GLOBALS, ILIAS_ABSOLUTE_PATH, and ILIAS_WEB_DIR.

Referenced by initFeed().

{
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("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 != "")
{
return false;
}
// 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'));
define ("SYSTEM_MAIL_ADDRESS",$ilClientIniFile->readVariable('system','MAIL_SENT_ADDRESS')); // Change SS
define ("MAIL_REPLY_WARNING",$ilClientIniFile->readVariable('system','MAIL_REPLY_WARNING')); // Change SS
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 caller graph for this function:

ilInitialisation::initDatabase ( )

initialise database object $ilDB

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

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

Referenced by initFeed().

{
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:

+ Here is the caller graph for this function:

ilInitialisation::initEventHandling ( )

initialise event handler ilAppEventHandler

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

References $GLOBALS.

Referenced by initFeed().

{
global $ilAppEventHandler;
// build dsn of database connection and connect
require_once("./Services/EventHandling/classes/class.ilAppEventHandler.php");
$ilAppEventHandler = new ilAppEventHandler();
$GLOBALS['ilAppEventHandler'] =& $ilAppEventHandler;
}

+ Here is the caller graph for this function:

ilInitialisation::initFeed ( )

Initialisation for feed.php.

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

References $_COOKIE, $GLOBALS, $ilBench, $ilCtrl, $ilDB, $ilErr, $ilIliasIniFile, $ilLog, $ilSetting, $lng, determineClient(), exit, handleMaintenanceMode(), initClientIniFile(), initDatabase(), initEventHandling(), initIliasIniFile(), initSettings(), PEAR_ERROR_CALLBACK, removeUnsafeCharacters(), requireCommonIncludes(), and ilUtil\setCookie().

{
global $ilDB, $ilUser, $ilLog, $ilErr, $ilClientIniFile, $ilIliasIniFile,
$ilSetting, $ilias, $https, $ilObjDataCache,
$ilLog, $objDefinition, $lng, $ilCtrl, $ilBrowser, $ilHelp,
$ilTabs, $ilMainMenu, $rbacsystem, $ilNavigationHistory;
// remove unsafe characters
// include common code files
global $ilBench;
// $ilAppEventHandler initialisation
// set error handler (to do: check preconditions for error handler to work)
$ilBench->start("Core", "HeaderInclude_GetErrorHandler");
$ilErr = new ilErrorHandling();
$GLOBALS['ilErr'] =& $ilErr;
$ilErr->setErrorHandling(PEAR_ERROR_CALLBACK,array($ilErr,'errorHandler'));
$ilBench->stop("Core", "HeaderInclude_GetErrorHandler");
// prepare file access to work with safe mode (has been done in class ilias before)
umask(0117);
// $ilIliasIniFile initialisation
$this->initIliasIniFile();
// CLIENT_ID determination
$this->determineClient();
// $ilClientIniFile initialisation
if (!$this->initClientIniFile())
{
$c = $_COOKIE["ilClientId"];
ilUtil::setCookie("ilClientId", $ilIliasIniFile->readVariable("clients","default"));
echo ("Client $c does not exist. Please reload this page to return to the default client.");
}
// maintenance mode
// $ilDB initialisation
$this->initDatabase();
// init plugin admin class
include_once("./Services/Component/classes/class.ilPluginAdmin.php");
$ilPluginAdmin = new ilPluginAdmin();
$GLOBALS['ilPluginAdmin'] = $ilPluginAdmin;
// $ilObjDataCache initialisation
$ilObjDataCache = new ilObjectDataCache();
$GLOBALS['ilObjDataCache'] =& $ilObjDataCache;
// init settings
$this->initSettings();
// init tree
$tree = new ilTree(ROOT_FOLDER_ID);
$GLOBALS['tree'] =& $tree;
// init language
$lng = new ilLanguage($ilClientIniFile->readVariable("language","default"));
$GLOBALS['lng'] =& $lng;
}

+ Here is the call 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 192 of file class.ilInitialisation.php.

References $GLOBALS, and $ilIliasIniFile.

Referenced by initFeed().

{
require_once("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"));
// read path + command for third party tools from ilias.ini
define ("PATH_TO_CONVERT",$ilIliasIniFile->readVariable("tools","convert"));
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_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"));
//$this->buildHTTPPath();
}

+ Here is the caller graph for this function:

ilInitialisation::initILIASObject ( )

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

References $GLOBALS, and $ilBench.

{
global $ilias, $ilBench;
$ilBench->start("Core", "HeaderInclude_GetILIASObject");
$ilias = new ILIAS();
$GLOBALS['ilias'] =& $ilias;
$ilBench->stop("Core", "HeaderInclude_GetILIASObject");
//var_dump($_SESSION);
}
ilInitialisation::initLanguage ( )

$lng initialisation

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

References $_GET, $_POST, $_SESSION, $GLOBALS, $ilBench, $ilSetting, $lng, ilLanguage\getInstalledLanguages(), and ilUtil\stripSlashes().

{
global $ilBench, $lng, $ilUser, $ilSetting;
//init language
$ilBench->start("Core", "HeaderInclude_initLanguage");
if (!isset($_SESSION['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']);
}
$_SESSION['lang'] = (isset($_GET['lang']) && $_GET['lang']) ? $_GET['lang'] : $_SESSION['lang'];
// 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 user agreement should be displayes (Helmut Schottm��ller, 2006-10-14)
if (is_object($ilUser) && $ilUser->getId() != ANONYMOUS_USER_ID && $ilUser->getId() > 0)
{
$_SESSION['lang'] = $ilUser->getPref("language");
}
// check whether lang selection is valid
if (!in_array($_SESSION['lang'], $langs))
{
if (is_object($ilSetting) && $ilSetting->get("language") != "")
{
$_SESSION['lang'] = $ilSetting->get("language");
}
else
{
$_SESSION['lang'] = $langs[0];
}
}
$_GET['lang'] = $_SESSION['lang'];
$lng = new ilLanguage($_SESSION['lang']);
$GLOBALS['lng'] =& $lng;
$ilBench->stop("Core", "HeaderInclude_initLanguage");
// TODO: another location
global $rbacsystem;
if(is_object($rbacsystem))
{
$rbacsystem->initMemberView();
}
}

+ Here is the call graph for this function:

ilInitialisation::initLocale ( )

Init Locale.

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

References $GLOBALS, and $ilSetting.

{
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);
}
}
}
}
ilInitialisation::initLog ( )

Definition at line 1607 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;
}
ilInitialisation::initSettings ( )

initialise $ilSettings object and define constants

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

References $GLOBALS, $ilSetting, ilGeneralSettings\_isPaymentEnabled(), and buildHTTPPath().

Referenced by initFeed().

{
global $ilSetting;
require_once("Services/Administration/classes/class.ilSetting.php");
$ilSetting = new ilSetting();
$GLOBALS['ilSetting'] =& $ilSetting;
// 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"));
$this->buildHTTPPath();
// payment setting
require_once('Services/Payment/classes/class.ilGeneralSettings.php');
define('IS_PAYMENT_ENABLED', ilGeneralSettings::_isPaymentEnabled());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilInitialisation::initStyle ( )

provide $styleDefinition object

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

References $GLOBALS, and $ilBench.

{
global $ilBench, $styleDefinition;
// load style definitions
$ilBench->start("Core", "HeaderInclude_getStyleDefinitions");
$styleDefinition = new ilStyleDefinition();
$GLOBALS['styleDefinition'] =& $styleDefinition;
$styleDefinition->startParsing();
$ilBench->stop("Core", "HeaderInclude_getStyleDefinitions");
}
ilInitialisation::initUserAccount ( )

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

References $_SESSION, $ilAuth, and $ilLog.

Referenced by goToPublicSection().

{
global $ilUser, $ilLog, $ilAuth;
//get user id
if (empty($_SESSION["AccountId"]))
{
$uid = $ilUser->checkUserId();
$_SESSION["AccountId"] = $uid;
if ($uid > 0)
{
$ilUser->setId($uid);
}
// assigned roles are stored in $_SESSION["RoleId"]
// DISABLED smeyer 20070510
#$rbacreview = new ilRbacReview();
#$GLOBALS['rbacreview'] =& $rbacreview;
#$_SESSION["RoleId"] = $rbacreview->assignedRoles($_SESSION["AccountId"]);
} // TODO: do we need 'else' here?
else
{
// init user
$ilUser->setId($_SESSION["AccountId"]);
}
// load account data of current user
$ilUser->read();
}

+ Here is the caller graph for this function:

ilInitialisation::removeUnsafeCharacters ( )

Remove unsafe characters from GET.

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

References $_GET.

Referenced by initFeed().

{
// 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 61 of file class.ilInitialisation.php.

References $GLOBALS, $ilBench, and ilUtil\StopWatch().

Referenced by initFeed().

{
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 "classes/class.ilBenchmark.php";
$ilBench = new ilBenchmark();
$GLOBALS['ilBench'] = $ilBench;
// BEGIN Usability: Measure response time until footer is displayed on form
// The stop statement is in class.ilTemplate.php function addILIASfooter()
$ilBench->start("Core", "ElapsedTimeUntilFooter");
// END Usability: Measure response time until footer is displayed on form
$ilBench->start("Core", "HeaderInclude");
// start the StopWatch
$GLOBALS['t_pagestart'] = ilUtil::StopWatch();
$ilBench->start("Core", "HeaderInclude_IncludeFiles");
//echo ":".class_exists("HTML_Template_ITX").":";
// Major PEAR Includes
require_once "PEAR.php";
//require_once "DB.php";
require_once "Auth/Auth.php";
// HTML_Template_IT support
// (location changed with 4.3.2 & higher)
/* @include_once "HTML/ITX.php"; // old implementation
if (!class_exists("IntegratedTemplateExtension"))
{
include_once "HTML/Template/ITX.php";
include_once "classes/class.ilTemplateHTMLITX.php";
}
else
{
include_once "classes/class.ilTemplateITX.php";
}*/
@include_once "HTML/Template/ITX.php"; // new implementation
if (class_exists("HTML_Template_ITX"))
{
include_once "classes/class.ilTemplateHTMLITX.php";
}
else
{
include_once "HTML/ITX.php"; // old implementation
include_once "classes/class.ilTemplateITX.php";
}
require_once "classes/class.ilTemplate.php";
//include classes and function libraries
require_once "include/inc.db_session_handler.php";
require_once "./Services/Database/classes/class.ilDB.php";
require_once "./Services/AuthShibboleth/classes/class.ilShibboleth.php";
require_once "classes/class.ilias.php";
require_once './Services/User/classes/class.ilObjUser.php';
require_once "classes/class.ilFormat.php";
require_once "./Services/Calendar/classes/class.ilDatePresentation.php";
require_once "classes/class.ilSaxParser.php";
require_once "./Services/Object/classes/class.ilObjectDefinition.php";
require_once "./Services/Style/classes/class.ilStyleDefinition.php";
require_once "./Services/Tree/classes/class.ilTree.php";
require_once "./Services/Language/classes/class.ilLanguage.php";
require_once "./Services/Logging/classes/class.ilLog.php";
require_once "Services/Mail/classes/class.ilMailbox.php";
require_once "classes/class.ilCtrl2.php";
require_once "classes/class.ilConditionHandler.php";
require_once "classes/class.ilBrowser.php";
require_once "classes/class.ilFrameTargetInfo.php";
require_once "Services/Navigation/classes/class.ilNavigationHistory.php";
require_once "Services/Help/classes/class.ilHelp.php";
require_once "include/inc.ilias_version.php";
//include role based access control system
require_once "./Services/AccessControl/classes/class.ilAccessHandler.php";
require_once "./Services/AccessControl/classes/class.ilRbacAdmin.php";
require_once "./Services/AccessControl/classes/class.ilRbacSystem.php";
require_once "./Services/AccessControl/classes/class.ilRbacReview.php";
// include object_data cache
require_once "classes/class.ilObjectDataCache.php";
require_once 'Services/Tracking/classes/class.ilOnlineTracking.php';
//include LocatorGUI
require_once "./Services/Locator/classes/class.ilLocatorGUI.php";
// include error_handling
require_once "classes/class.ilErrorHandling.php";
$ilBench->stop("Core", "HeaderInclude_IncludeFiles");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilInitialisation::returnBeforeAuth (   $a_flag = null)

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

References $return_before_auth.

{
if(null === $a_flag)
{
}
$this->return_before_auth = $a_flag;
return $this;
}
ilInitialisation::setCookieParams ( )

set session cookie params for path, domain, etc.

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

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

{
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 = '/';
$cookie_domain = $_SERVER['SERVER_NAME'];
define('IL_COOKIE_EXPIRE',0);
define('IL_COOKIE_PATH',$cookie_path);
define('IL_COOKIE_DOMAIN','');
define('IL_COOKIE_SECURE',false); // 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',false); // 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:

ilInitialisation::setSessionHandler ( )

set session handler to db

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

References $ilErr, and db_set_save_handler().

Referenced by goToPublicSection().

{
global $ilErr;
// set session handler
if(ini_get('session.save_handler') != 'user')
{
ini_set("session.save_handler", "user");
}
{
die("Please turn off Safe mode OR set session.save_handler to \"user\" in your php.ini");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilInitialisation::$return_before_auth = false
private

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

Referenced by returnBeforeAuth().

ilInitialisation::$script = ""

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

Referenced by goToLogin(), and goToPublicSection().


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