• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Services/Init/classes/class.ilInitialisation.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2006 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00039 class ilInitialisation
00040 {
00041 
00045         function removeUnsafeCharacters()
00046         {
00047                 // Remove unsafe characters from GET parameters.
00048                 // We do not need this characters in any case, so it is
00049                 // feasible to filter them everytime. POST parameters
00050                 // need attention through ilUtil::stripSlashes() and similar functions)
00051                 if (is_array($_GET))
00052                 {
00053                         foreach($_GET as $k => $v)
00054                         {
00055                                 // \r\n used for IMAP MX Injection
00056                                 // ' used for SQL Injection
00057                                 $_GET[$k] = str_replace(array("\x00", "\n", "\r", "\\", "'", '"', "\x1a"), "", $v);
00058 
00059                                 // this one is for XSS of any kind
00060                                 $_GET[$k] = strip_tags($_GET[$k]);
00061                         }
00062                 }
00063         }
00064 
00068         function requireCommonIncludes()
00069         {
00070                 global $ilBench;
00071 
00072                 // get pear
00073                 require_once("include/inc.get_pear.php");
00074                 require_once("include/inc.check_pear.php");
00075 
00076                 //include class.util first to start StopWatch
00077                 require_once "./Services/Utilities/classes/class.ilUtil.php";
00078                 require_once "classes/class.ilBenchmark.php";
00079                 $ilBench =& new ilBenchmark();
00080                 $GLOBALS['ilBench'] =& $ilBench;
00081 
00082                 $ilBench->start("Core", "HeaderInclude");
00083 
00084                 // start the StopWatch
00085                 $GLOBALS['t_pagestart'] = ilUtil::StopWatch();
00086 
00087                 $ilBench->start("Core", "HeaderInclude_IncludeFiles");
00088 //echo ":".class_exists("HTML_Template_ITX").":";
00089                 // Major PEAR Includes
00090                 require_once "PEAR.php";
00091                 require_once "DB.php";
00092                 require_once "Auth/Auth.php";
00093 
00094                 // HTML_Template_IT support
00095                 // (location changed with 4.3.2 & higher)
00096 /*              @include_once "HTML/ITX.php";           // old implementation
00097                 if (!class_exists("IntegratedTemplateExtension"))
00098                 {
00099                         include_once "HTML/Template/ITX.php";
00100                         include_once "classes/class.ilTemplateHTMLITX.php";
00101                 }
00102                 else
00103                 {
00104                         include_once "classes/class.ilTemplateITX.php";
00105                 }*/
00106                 
00107                 @include_once "HTML/Template/ITX.php";          // new implementation
00108                 if (class_exists("HTML_Template_ITX"))
00109                 {
00110                         include_once "classes/class.ilTemplateHTMLITX.php";
00111                 }
00112                 else
00113                 {
00114                         include_once "HTML/ITX.php";            // old implementation
00115                         include_once "classes/class.ilTemplateITX.php";
00116                 }
00117                 
00118                 require_once "classes/class.ilTemplate.php";
00119 
00120                 //include classes and function libraries
00121                 require_once "include/inc.db_session_handler.php";
00122                 require_once "classes/class.ilDBx.php";
00123                 require_once "./Services/AuthShibboleth/classes/class.ilShibboleth.php";
00124                 require_once "classes/class.ilias.php";
00125                 require_once './Services/User/classes/class.ilObjUser.php';
00126                 require_once "classes/class.ilFormat.php";
00127                 require_once "classes/class.ilSaxParser.php";
00128                 require_once "classes/class.ilObjectDefinition.php";
00129                 require_once "classes/class.ilStyleDefinition.php";
00130                 require_once "./Services/Tree/classes/class.ilTree.php";
00131                 require_once "./Services/Language/classes/class.ilLanguage.php";
00132                 require_once "./Services/Logging/classes/class.ilLog.php";
00133                 require_once "Services/Mail/classes/class.ilMailbox.php";
00134                 require_once "classes/class.ilCtrl.php";
00135                 require_once "classes/class.ilConditionHandler.php";
00136                 require_once "classes/class.ilBrowser.php";
00137                 require_once "classes/class.ilFrameTargetInfo.php";
00138                 require_once "Services/Navigation/classes/class.ilNavigationHistory.php";
00139                 require_once "Services/Help/classes/class.ilHelp.php";
00140                 require_once "include/inc.ilias_version.php";
00141 
00142                 //include role based access control system
00143                 require_once "./Services/AccessControl/classes/class.ilAccessHandler.php";
00144                 require_once "./Services/AccessControl/classes/class.ilRbacAdmin.php";
00145                 require_once "./Services/AccessControl/classes/class.ilRbacSystem.php";
00146                 require_once "./Services/AccessControl/classes/class.ilRbacReview.php";
00147 
00148                 // include object_data cache
00149                 require_once "classes/class.ilObjectDataCache.php";
00150                 require_once 'Services/Tracking/classes/class.ilOnlineTracking.php';
00151 
00152                 // ### AA 03.10.29 added new LocatorGUI class ###
00153                 //include LocatorGUI
00154                 require_once "classes/class.ilLocatorGUI.php";
00155 
00156                 // include error_handling
00157                 require_once "classes/class.ilErrorHandling.php";
00158 
00159                 // php5 downward complaince to php 4 dom xml and clone method
00160                 if (version_compare(PHP_VERSION,'5','>='))
00161                 {
00162                         require_once("include/inc.xml5compliance.php");
00163                         //require_once("Services/CAS/phpcas/source/CAS/domxml-php4-php5.php");
00164 
00165                         require_once("include/inc.xsl5compliance.php");
00166                         require_once("include/inc.php4compliance.php");
00167                 }
00168                 else
00169                 {
00170                         require_once("include/inc.php5compliance.php");
00171                 }
00172 
00173                 $ilBench->stop("Core", "HeaderInclude_IncludeFiles");
00174         }
00175 
00183         function initIliasIniFile()
00184         {
00185                 global $ilIliasIniFile;
00186 
00187                 require_once("classes/class.ilIniFile.php");
00188                 $ilIliasIniFile = new ilIniFile("./ilias.ini.php");
00189                 $GLOBALS['ilIliasIniFile'] =& $ilIliasIniFile;
00190                 $ilIliasIniFile->read();
00191 
00192                 // initialize constants
00193                 define("ILIAS_DATA_DIR",$ilIliasIniFile->readVariable("clients","datadir"));
00194                 define("ILIAS_WEB_DIR",$ilIliasIniFile->readVariable("clients","path"));
00195                 define("ILIAS_ABSOLUTE_PATH",$ilIliasIniFile->readVariable('server','absolute_path'));
00196 
00197                 // logging
00198                 define ("ILIAS_LOG_DIR",$ilIliasIniFile->readVariable("log","path"));
00199                 define ("ILIAS_LOG_FILE",$ilIliasIniFile->readVariable("log","file"));
00200                 define ("ILIAS_LOG_ENABLED",$ilIliasIniFile->readVariable("log","enabled"));
00201                 define ("ILIAS_LOG_LEVEL",$ilIliasIniFile->readVariable("log","level"));
00202 
00203                 // read path + command for third party tools from ilias.ini
00204                 define ("PATH_TO_CONVERT",$ilIliasIniFile->readVariable("tools","convert"));
00205                 define ("PATH_TO_ZIP",$ilIliasIniFile->readVariable("tools","zip"));
00206                 define ("PATH_TO_UNZIP",$ilIliasIniFile->readVariable("tools","unzip"));
00207                 define ("PATH_TO_JAVA",$ilIliasIniFile->readVariable("tools","java"));
00208                 define ("PATH_TO_HTMLDOC",$ilIliasIniFile->readVariable("tools","htmldoc"));
00209                 define ("URL_TO_LATEX",$ilIliasIniFile->readVariable("tools","latex"));
00210                 define ("PATH_TO_FOP",$ilIliasIniFile->readVariable("tools","fop"));
00211 
00212                 // read virus scanner settings
00213                 switch ($ilIliasIniFile->readVariable("tools", "vscantype"))
00214                 {
00215                         case "sophos":
00216                                 define("IL_VIRUS_SCANNER", "Sophos");
00217                                 define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
00218                                 define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
00219                                 break;
00220 
00221                         case "antivir":
00222                                 define("IL_VIRUS_SCANNER", "AntiVir");
00223                                 define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
00224                                 define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
00225                                 break;
00226 
00227                         case "clamav":
00228                                 define("IL_VIRUS_SCANNER", "ClamAV");
00229                                 define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
00230                                 define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
00231                                 break;
00232 
00233                         default:
00234                                 define("IL_VIRUS_SCANNER", "None");
00235                                 break;
00236                 }
00237 
00238                 //$this->buildHTTPPath();
00239         }
00240 
00247         function buildHTTPPath()
00248         {
00249                 include_once 'classes/class.ilHTTPS.php';
00250                 $https = new ilHTTPS();
00251 
00252                 if($https->isDetected())
00253                 {
00254                         $protocol = 'https://';
00255                 }
00256                 else
00257                 {
00258                         $protocol = 'http://';
00259                 }
00260                 $host = $_SERVER['HTTP_HOST'];
00261 
00262                 $rq_uri = $_SERVER['REQUEST_URI'];
00263 
00264                 // security fix: this failed, if the URI contained "?" and following "/"
00265                 // -> we remove everything after "?"
00266                 if (is_int($pos = strpos($rq_uri, "?")))
00267                 {
00268                         $rq_uri = substr($rq_uri, 0, $pos);
00269                 }
00270 
00271                 if(!defined('ILIAS_MODULE'))
00272                 {
00273                         $path = pathinfo($rq_uri);
00274                         if(!$path['extension'])
00275                         {
00276                                 $uri = $rq_uri;
00277                         }
00278                         else
00279                         {
00280                                 $uri = dirname($rq_uri);
00281                         }
00282                 }
00283                 else
00284                 {
00285                         // if in module remove module name from HTTP_PATH
00286                         $path = dirname($rq_uri);
00287 
00288                         // dirname cuts the last directory from a directory path e.g content/classes return content
00289 
00290                         $module = ilUtil::removeTrailingPathSeparators(ILIAS_MODULE);
00291 
00292                         $dirs = explode('/',$module);
00293                         $uri = $path;
00294                         foreach($dirs as $dir)
00295                         {
00296                                 $uri = dirname($uri);
00297                         }
00298                 }
00299                 
00300                 return define('ILIAS_HTTP_PATH',ilUtil::removeTrailingPathSeparators($protocol.$host.$uri));
00301         }
00302 
00303 
00308         function determineClient()
00309         {
00310                 global $ilIliasIniFile;
00311 
00312                 // check whether ini file object exists
00313                 if (!is_object($ilIliasIniFile))
00314                 {
00315                         die ("Fatal Error: ilInitialisation::determineClient called without initialisation of ILIAS ini file object.");
00316                 }
00317 
00318                 // set to default client if empty
00319                 if ($_GET["client_id"] != "")
00320                 {
00321                         setcookie("ilClientId", $_GET["client_id"]);
00322                         $_COOKIE["ilClientId"] = $_GET["client_id"];
00323                 }
00324                 else if (!$_COOKIE["ilClientId"])
00325                 {
00326                         // to do: ilias ini raus nehmen
00327                         $client_id = $ilIliasIniFile->readVariable("clients","default");
00328                         setcookie("ilClientId", $client_id);
00329                         $_COOKIE["ilClientId"] = $client_id;
00330 //echo "set cookie";
00331                 }
00332 //echo "-".$_COOKIE["ilClientId"]."-";
00333                 define ("CLIENT_ID", $_COOKIE["ilClientId"]);
00334         }
00335 
00348         function initClientIniFile()
00349         {
00350                 global $ilClientIniFile;
00351 
00352                 // check whether ILIAS_WEB_DIR is set.
00353                 if (ILIAS_WEB_DIR == "")
00354                 {
00355                         die ("Fatal Error: ilInitialisation::initClientIniFile called without ILIAS_WEB_DIR.");
00356                 }
00357 
00358                 // check whether CLIENT_ID is set.
00359                 if (CLIENT_ID == "")
00360                 {
00361                         die ("Fatal Error: ilInitialisation::initClientIniFile called without CLIENT_ID.");
00362                 }
00363 
00364                 $ini_file = "./".ILIAS_WEB_DIR."/".CLIENT_ID."/client.ini.php";
00365 
00366                 // get settings from ini file
00367                 require_once("classes/class.ilIniFile.php");
00368                 $ilClientIniFile = new ilIniFile($ini_file);
00369                 $GLOBALS['ilClientIniFile'] =& $ilClientIniFile;
00370                 $ilClientIniFile->read();
00371 
00372                 // if no ini-file found switch to setup routine
00373                 if ($ilClientIniFile->ERROR != "")
00374                 {
00375                         return false;
00376                 }
00377 
00378                 // set constants
00379                 define ("DEBUG",$ilClientIniFile->readVariable("system","DEBUG"));
00380                 define ("DEVMODE",$ilClientIniFile->readVariable("system","DEVMODE"));
00381                 define ("ROOT_FOLDER_ID",$ilClientIniFile->readVariable('system','ROOT_FOLDER_ID'));
00382                 define ("SYSTEM_FOLDER_ID",$ilClientIniFile->readVariable('system','SYSTEM_FOLDER_ID'));
00383                 define ("ROLE_FOLDER_ID",$ilClientIniFile->readVariable('system','ROLE_FOLDER_ID'));
00384                 define ("MAIL_SETTINGS_ID",$ilClientIniFile->readVariable('system','MAIL_SETTINGS_ID'));
00385 
00386                 define ("SYSTEM_MAIL_ADDRESS",$ilClientIniFile->readVariable('system','MAIL_SENT_ADDRESS')); // Change SS
00387                 define ("MAIL_REPLY_WARNING",$ilClientIniFile->readVariable('system','MAIL_REPLY_WARNING')); // Change SS
00388 
00389                 define ("MAXLENGTH_OBJ_TITLE",125);#$ilClientIniFile->readVariable('system','MAXLENGTH_OBJ_TITLE'));
00390                 define ("MAXLENGTH_OBJ_DESC",$ilClientIniFile->readVariable('system','MAXLENGTH_OBJ_DESC'));
00391 
00392                 define ("CLIENT_DATA_DIR",ILIAS_DATA_DIR."/".CLIENT_ID);
00393                 define ("CLIENT_WEB_DIR",ILIAS_ABSOLUTE_PATH."/".ILIAS_WEB_DIR."/".CLIENT_ID);
00394                 define ("CLIENT_NAME",$ilClientIniFile->readVariable('client','name')); // Change SS
00395 
00396                 // build dsn of database connection and connect
00397                 define ("IL_DSN", $ilClientIniFile->readVariable("db","type").
00398                                          "://".$ilClientIniFile->readVariable("db", "user").
00399                                          ":".$ilClientIniFile->readVariable("db", "pass").
00400                                          "@".$ilClientIniFile->readVariable("db", "host").
00401                                          "/".$ilClientIniFile->readVariable("db", "name"));
00402 
00403                 return true;
00404         }
00405 
00409         function handleMaintenanceMode()
00410         {
00411                 global $ilClientIniFile;
00412 
00413                 if (!$ilClientIniFile->readVariable("client","access"))
00414                 {
00415                         if (is_file("./maintenance.html"))
00416                         {
00417                                 ilUtil::redirect("./maintenance.html");
00418                         }
00419                         else
00420                         {
00421                                 // to do: include standard template here
00422                                 die('<br /><p style="text-align:center;">The server is not '.
00423                                         'available due to maintenance. We apologise for any inconvenience.</p>');
00424                         }
00425                 }
00426         }
00427 
00433         function initDatabase()
00434         {
00435                 global $ilDB;
00436 
00437                 // check whether ILIAS_WEB_DIR is set.
00438                 if (IL_DSN == "")
00439                 {
00440                         die ("Fatal Error: ilInitialisation::initDatabase called without IL_DSN.");
00441                 }
00442 
00443                 // build dsn of database connection and connect
00444                 require_once("classes/class.ilDBx.php");
00445                 $ilDB = new ilDBx(IL_DSN);
00446                 $GLOBALS['ilDB'] =& $ilDB;
00447         }
00448 
00452         function initEventHandling()
00453         {
00454                 global $ilAppEventHandler;
00455 
00456                 // build dsn of database connection and connect
00457                 require_once("./Services/EventHandling/classes/class.ilAppEventHandler.php");
00458                 $ilAppEventHandler = new ilAppEventHandler();
00459                 $GLOBALS['ilAppEventHandler'] =& $ilAppEventHandler;
00460         }
00461 
00465         function setSessionHandler()
00466         {
00467                 global $ilErr;
00468 
00469                 // set session handler
00470                 if(ini_get('session.save_handler') != 'user')
00471                 {
00472                         ini_set("session.save_handler", "user");
00473                 }
00474                 if (!db_set_save_handler())
00475                 {
00476                         die("Please turn off Safe mode OR set session.save_handler to \"user\" in your php.ini");
00477                 }
00478 
00479         }
00480 
00484         function initSettings()
00485         {
00486                 global $ilSetting;
00487 
00488                 require_once("Services/Administration/classes/class.ilSetting.php");
00489                 $ilSetting = new ilSetting();
00490                 $GLOBALS['ilSetting'] =& $ilSetting;
00491 
00492                 // set anonymous user & role id and system role id
00493                 define ("ANONYMOUS_USER_ID", $ilSetting->get("anonymous_user_id"));
00494                 define ("ANONYMOUS_ROLE_ID", $ilSetting->get("anonymous_role_id"));
00495                 define ("SYSTEM_USER_ID", $ilSetting->get("system_user_id"));
00496                 define ("SYSTEM_ROLE_ID", $ilSetting->get("system_role_id"));
00497 
00498                 // recovery folder
00499                 define ("RECOVERY_FOLDER_ID", $ilSetting->get("recovery_folder_id"));
00500 
00501                 // installation id
00502                 define ("IL_INST_ID", $ilSetting->get("inst_id",0));
00503 
00504                 // define default suffix replacements
00505                 define ("SUFFIX_REPL_DEFAULT", "php,php3,php4,inc,lang,phtml,htaccess");
00506                 define ("SUFFIX_REPL_ADDITIONAL", $ilSetting->get("suffix_repl_additional"));
00507 
00508                 $this->buildHTTPPath();
00509         }
00510 
00511 
00515         function determineScriptAndUpDir()
00516         {
00517                 $this->script = substr(strrchr($_SERVER["PHP_SELF"],"/"),1);
00518                 $dirname = dirname($_SERVER["PHP_SELF"]);
00519                 $ilurl = @parse_url(ILIAS_HTTP_PATH);
00520                 $subdir = substr(strstr($dirname,$ilurl["path"]),strlen($ilurl["path"]));
00521                 $updir = "";
00522 
00523                 if ($subdir)
00524                 {
00525                         $num_subdirs = substr_count($subdir,"/");
00526 
00527                         for ($i=1;$i<=$num_subdirs;$i++)
00528                         {
00529                                 $updir .= "../";
00530                         }
00531                 }
00532                 $this->updir = $updir;
00533         }
00534 
00538         function initStyle()
00539         {
00540                 global $ilBench, $styleDefinition;
00541 
00542                 // load style definitions
00543                 $ilBench->start("Core", "HeaderInclude_getStyleDefinitions");
00544                 $styleDefinition = new ilStyleDefinition();
00545                 $GLOBALS['styleDefinition'] =& $styleDefinition;
00546                 $styleDefinition->startParsing();
00547                 $ilBench->stop("Core", "HeaderInclude_getStyleDefinitions");
00548         }
00549 
00550 
00554         function handleStyle()
00555         {
00556                 global $styleDefinition;
00557 
00558                 if ($_GET['skin']  && $_GET['style'])
00559                 {
00560                         include_once("classes/class.ilObjStyleSettings.php");
00561                         if ($styleDefinition->styleExists($_GET['skin'], $_GET['style']) &&
00562                                 ilObjStyleSettings::_lookupActivatedStyle($_GET['skin'], $_GET['style']))
00563                         {
00564                                 $_SESSION['skin'] = $_GET['skin'];
00565                                 $_SESSION['style'] = $_GET['style'];
00566                         }
00567                 }
00568                 if ($_SESSION['skin'] && $_SESSION['style'])
00569                 {
00570                         include_once("classes/class.ilObjStyleSettings.php");
00571                         if ($styleDefinition->styleExists($_SESSION['skin'], $_SESSION['style']) &&
00572                                 ilObjStyleSettings::_lookupActivatedStyle($_SESSION['skin'], $_SESSION['style']))
00573                         {
00574                                 $ilias->account->skin = $_SESSION['skin'];
00575                                 $ilias->account->prefs['style'] = $_SESSION['style'];
00576                         }
00577                 }
00578         }
00579 
00580         function initUserAccount()
00581         {
00582                 global $ilUser, $ilLog, $ilAuth;
00583 
00584                 //get user id
00585                 if (empty($_SESSION["AccountId"]))
00586                 {
00587                         $_SESSION["AccountId"] = $ilUser->checkUserId();
00588 
00589                         // assigned roles are stored in $_SESSION["RoleId"]
00590                         // DISABLED smeyer 20070510
00591                         #$rbacreview = new ilRbacReview();
00592                         #$GLOBALS['rbacreview'] =& $rbacreview;
00593                         #$_SESSION["RoleId"] = $rbacreview->assignedRoles($_SESSION["AccountId"]);
00594                 } // TODO: do we need 'else' here?
00595                 else
00596                 {
00597                         // init user
00598                         $ilUser->setId($_SESSION["AccountId"]);
00599                 }
00600 
00601                 // load account data of current user
00602                 $ilUser->read();
00603         }
00604 
00605         function checkUserClientIP()
00606         {
00607                 global $ilUser, $ilLog, $ilAuth, $ilias;
00608 
00609                 // check client ip
00610                 $clientip = $ilUser->getClientIP();
00611                 if (trim($clientip) != "" and $clientip != $_SERVER["REMOTE_ADDR"])
00612                 {
00613                         $ilLog ->logError(1,
00614                                 $ilias->account->getLogin().":".$_SERVER["REMOTE_ADDR"].":".$message);
00615                         $ilAuth->logout();
00616                         @session_destroy();
00617                         ilUtil::redirect("login.php?wrong_ip=true");
00618                 }
00619         }
00620 
00621         function checkUserAgreement()
00622         {
00623                 global $ilUser, $ilAuth;
00624 
00625                 // are we currently in user agreement acceptance?
00626                 $in_user_agreement = false;
00627                 if (strtolower($_GET["cmdClass"]) == "ilstartupgui" &&
00628                         (strtolower($_GET["cmd"]) == "getacceptance" ||
00629                         (is_array($_POST["cmd"]) &&
00630                         key($_POST["cmd"]) == "getAcceptance")))
00631                 {
00632                         $in_user_agreement = true;
00633                 }
00634 
00635                 // check wether user has accepted the user agreement
00636                 //      echo "-".$script;
00637                 if (!$ilUser->hasAcceptedUserAgreement() &&
00638                         $ilAuth->getAuth() &&
00639                         !$in_user_agreement &&
00640                         $ilUser->getId() != ANONYMOUS_USER_ID)
00641                 {
00642                         ilUtil::redirect("ilias.php?baseClass=ilStartUpGUI&cmdClass=ilstartupgui&target=".$_GET["target"]."&cmd=getAcceptance");
00643                 }
00644         }
00645 
00646 
00650         function goToPublicSection()
00651         {
00652                 global $ilAuth;
00653 
00654                 // logout and end previous session
00655                 $ilAuth->logout();
00656                 session_unset();
00657                 session_destroy();
00658 
00659                 // new session and login as anonymous
00660                 $this->setSessionHandler();
00661                 session_start();
00662                 $_POST["username"] = "anonymous";
00663                 $_POST["password"] = "anonymous";
00664                 ilAuthUtils::_initAuth();
00665                 $ilAuth->start();
00666 
00667                 if (ANONYMOUS_USER_ID == "")
00668                 {
00669                         die ("Public Section enabled, but no Anonymous user found.");
00670                 }
00671                 if (!$ilAuth->getAuth())
00672                 {
00673                         die("ANONYMOUS user with the object_id ".ANONYMOUS_USER_ID." not found!");
00674                 }
00675 
00676                 // if target given, try to go there
00677                 if ($_GET["target"] != "")
00678                 {
00679                         $this->initUserAccount();
00680 
00681                         // target is accessible -> goto target
00682                         include_once("Services/Init/classes/class.ilStartUpGUI.php");
00683                         if      (ilStartUpGUI::_checkGoto($_GET["target"]))
00684                         {
00685                                 // Disabled: GET parameter is kept, since no redirect. smeyer
00686                                 // additional parameter capturing for survey access codes
00687                                 /*
00688                                 $survey_parameter = "";
00689                                 if (array_key_exists("accesscode", $_GET))
00690                                 {
00691                                         $survey_parameter = "&accesscode=" . $_GET["accesscode"];
00692                                 }
00693                                 */
00694                                 // Disabled redirect for public section
00695                                 return true;
00696                                 #ilUtil::redirect(ILIAS_HTTP_PATH.
00697                                 #       "/goto.php?target=".$_GET["target"].$survey_parameter);
00698                         }
00699                         else    // target is not accessible -> login
00700                         {
00701                                 $this->goToLogin();
00702                         }
00703                 }
00704 
00705                 $_GET["ref_id"] = ROOT_FOLDER_ID;
00706 
00707                 $_GET["cmd"] = "frameset";
00708                 $jump_script = "repository.php";
00709                 
00710                 $script = $this->updir.$jump_script."?reloadpublic=1&cmd=".$_GET["cmd"]."&ref_id=".$_GET["ref_id"];
00711 
00712                 // todo do it better, if JS disabled
00713                 //echo "<script language=\"Javascript\">\ntop.location.href = \"".$script."\";\n</script>\n";
00714                 echo "<script language=\"Javascript\">\ntop.location.href = \"".$script."\";\n</script>\n".
00715                         'Please click <a href="'.$script.'">here</a> if you are not redirected automatically.';
00716                 exit;
00717         }
00718 
00719 
00723         function goToLogin($a_auth_stat = "")
00724         {
00725                 global $PHP_SELF;
00726 
00727                 session_unset();
00728                 session_destroy();
00729 
00730                 $add = "";
00731                 if ($_GET["soap_pw"] != "")
00732                 {
00733                         $add = "&soap_pw=".$_GET["soap_pw"]."&ext_uid=".$_GET["ext_uid"];
00734                 }
00735 
00736                 $script = $this->updir."login.php?target=".$_GET["target"]."&client_id=".$_COOKIE["ilClientId"].
00737                         "&auth_stat=".$a_auth_stat.$add;
00738 
00739                 // todo do it better, if JS disabled
00740                 // + this is, when session "ends", so
00741                 // we should try to prevent some information about current
00742                 // location
00743                 //
00744                 // check whether we are currently doing a goto call
00745                 if (is_int(strpos($PHP_SELF, "goto.php")) && $_GET["soap_pw"] == "" &&
00746                         $_GET["reloadpublic"] != "1")
00747                 {
00748                         $script = $this->updir."goto.php?target=".$_GET["target"]."&client_id=".CLIENT_ID.
00749                                 "&reloadpublic=1";
00750                 }
00751 
00752                 echo "<script language=\"Javascript\">\ntop.location.href = \"".$script."\";\n</script>\n".
00753                         'Please click <a href="'.$script.'">here</a> if you are not redirected automatically.';
00754 
00755                 exit;
00756 
00757         }
00758 
00762         function initLanguage()
00763         {
00764                 global $ilBench, $lng, $ilUser, $ilSetting;
00765                 
00766                 //init language
00767                 $ilBench->start("Core", "HeaderInclude_initLanguage");
00768 
00769                 if (is_null($_SESSION['lang']))
00770                 {
00771                         if ($_GET["lang"])
00772                         {
00773                                 $_GET["lang"] = $_GET["lang"];
00774                         }
00775                         else
00776                         {
00777                                 if (is_object($ilUser))
00778                                 {
00779                                         $_GET["lang"] = $ilUser->getPref("language");
00780                                 }
00781                         }
00782                 }
00783 
00784                 if ($_POST['change_lang_to'] != "")
00785                 {
00786                         $_GET['lang'] = ilUtil::stripSlashes($_POST['change_lang_to']);
00787                 }
00788 
00789                 $_SESSION['lang'] = ($_GET['lang']) ? $_GET['lang'] : $_SESSION['lang'];
00790 
00791                 // prefer personal setting when coming from login screen
00792                 // 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)
00793                 if (is_object($ilUser) && $ilUser->getId() != ANONYMOUS_USER_ID && $ilUser->getId() > 0)
00794                 {
00795                         $_SESSION['lang'] = $ilUser->getPref("language");
00796                 }
00797 
00798                 // check whether lang selection is valid
00799                 $langs = ilLanguage::getInstalledLanguages();
00800                 if (!in_array($_SESSION['lang'], $langs))
00801                 {
00802                         if (is_object($ilSetting) && $ilSetting->get("language") != "")
00803                         {
00804                                 $_SESSION['lang'] = $ilSetting->get("language");
00805                         }
00806                         else
00807                         {
00808                                 $_SESSION['lang'] = $langs[0];
00809                         }
00810                 }
00811                 $_GET['lang'] = $_SESSION['lang'];
00812                 
00813                 $lng = new ilLanguage($_SESSION['lang']);
00814                 $GLOBALS['lng'] =& $lng;
00815                 $ilBench->stop("Core", "HeaderInclude_initLanguage");
00816 
00817         }
00818 
00822         function initAccessHandling()
00823         {
00824                 global $ilBench, $rbacsystem, $rbacadmin, $rbacreview;
00825 
00826                 $ilBench->start("Core", "HeaderInclude_initRBAC");
00827                 $rbacsystem = new ilRbacSystem();
00828                 $GLOBALS['rbacsystem'] =& $rbacsystem;
00829                 $rbacadmin = new ilRbacAdmin();
00830                 $GLOBALS['rbacadmin'] =& $rbacadmin;
00831                 $rbacreview = new ilRbacReview();
00832                 $GLOBALS['rbacreview'] =& $rbacreview;
00833                 $ilAccess =& new ilAccessHandler();
00834                 $GLOBALS["ilAccess"] =& $ilAccess;
00835                 $ilBench->stop("Core", "HeaderInclude_initRBAC");
00836         }
00837 
00838 
00843         function initILIAS($context = "web")
00844         {
00845                 global $ilDB, $ilUser, $ilLog, $ilErr, $ilClientIniFile, $ilIliasIniFile,
00846                         $ilSetting, $ilias, $https, $ilObjDataCache,
00847                         $ilLog, $objDefinition, $lng, $ilCtrl, $ilBrowser, $ilHelp,
00848                         $ilTabs, $ilMainMenu, $rbacsystem, $ilNavigationHistory;
00849 
00850                 // remove unsafe characters
00851                 $this->removeUnsafeCharacters();
00852 
00853                 // include common code files
00854                 $this->requireCommonIncludes();
00855                 global $ilBench;
00856 
00857                 // set error handler (to do: check preconditions for error handler to work)
00858                 $ilBench->start("Core", "HeaderInclude_GetErrorHandler");
00859                 $ilErr = new ilErrorHandling();
00860                 $GLOBALS['ilErr'] =& $ilErr;
00861                 $ilErr->setErrorHandling(PEAR_ERROR_CALLBACK,array($ilErr,'errorHandler'));
00862                 $ilBench->stop("Core", "HeaderInclude_GetErrorHandler");
00863 
00864 
00865                 // prepare file access to work with safe mode (has been done in class ilias before)
00866                 umask(0117);
00867 
00868 
00869                 // $ilIliasIniFile initialisation
00870                 $this->initIliasIniFile();
00871 
00872 
00873                 // CLIENT_ID determination
00874                 $this->determineClient();
00875 
00876                 // $ilAppEventHandler initialisation
00877                 $this->initEventHandling();
00878 
00879                 // $ilClientIniFile initialisation
00880                 if (!$this->initClientIniFile())
00881                 {
00882                         $c = $_COOKIE["ilClientId"];
00883                         setcookie("ilClientId", $ilIliasIniFile->readVariable("clients","default"));
00884                         $_COOKIE["ilClientId"] = $ilIliasIniFile->readVariable("clients","default");
00885                         if (CLIENT_ID != "" && CLIENT_ID != $ilIliasIniFile->readVariable("clients","default"))
00886                         {
00887                                 ilUtil::redirect("index.php?client_id=".$ilIliasIniFile->readVariable("clients","default"));
00888                         }
00889                         else
00890                         {
00891                                 echo ("Client $c does not exist. ".'Please <a href="./index.php">click here</a> to return to the default client.');
00892                         }
00893                         exit;
00894                         //ilUtil::redirect("./setup/setup.php");        // to do: this could fail in subdirectories
00895                                                                                                         // this is also source of a bug (see mantis)
00896                 }
00897 
00898 
00899                 // maintenance mode
00900                 $this->handleMaintenanceMode();
00901 
00902                 // $ilDB initialisation
00903                 $this->initDatabase();
00904 
00905                 // set session handler
00906                 $this->setSessionHandler();
00907 
00908                 // $ilSetting initialisation
00909                 $this->initSettings();
00910 
00911 
00912                 // $ilLog initialisation
00913                 $this->initLog();
00914 
00915                 // $https initialisation
00916                 require_once './classes/class.ilHTTPS.php';
00917                 $https =& new ilHTTPS();
00918                 $GLOBALS['https'] =& $https;
00919                 $https->enableSecureCookies();
00920                 $https->checkPort();
00921 
00922                 // $ilAuth initialisation
00923                 include_once("./Services/Authentication/classes/class.ilAuthUtils.php");
00924                 ilAuthUtils::_initAuth();
00925                 global $ilAuth;
00926 
00927                 // Do not accept external session ids
00928                 if (!db_session_exists(session_id()))
00929                 {
00930                         $_GET["PHPSESSID"] == "";
00931                         session_regenerate_id();
00932                 }
00933 
00934                 // $ilias initialisation
00935                         global $ilias, $ilBench;
00936                 $ilBench->start("Core", "HeaderInclude_GetILIASObject");
00937                 $ilias = & new ILIAS();
00938                 $GLOBALS['ilias'] =& $ilias;
00939                 $ilBench->stop("Core", "HeaderInclude_GetILIASObject");
00940 
00941                 // test: trace function calls in debug mode
00942                 if (DEVMODE)
00943                 {
00944                         if (function_exists("xdebug_start_trace"))
00945                         {
00946                                 //xdebug_start_trace("/tmp/test.txt");
00947                         }
00948                 }
00949 
00950                 // $ilObjDataCache initialisation
00951                 $ilObjDataCache = new ilObjectDataCache();
00952                 $GLOBALS['ilObjDataCache'] =& $ilObjDataCache;
00953 
00954                 // workaround: load old post variables if error handler 'message' was called
00955                 if ($_SESSION["message"])
00956                 {
00957                         $_POST = $_SESSION["post_vars"];
00958                 }
00959 
00960 
00961                 // put debugging functions here
00962                 require_once "include/inc.debug.php";
00963 
00964 
00965                 // $objDefinition initialisation
00966                 $ilBench->start("Core", "HeaderInclude_getObjectDefinitions");
00967                 $objDefinition = new ilObjectDefinition();
00968                 $GLOBALS['objDefinition'] =& $objDefinition;
00969                 $objDefinition->startParsing();
00970                 $ilBench->stop("Core", "HeaderInclude_getObjectDefinitions");
00971 
00972                 // $ilAccess and $rbac... initialisation
00973                 $this->initAccessHandling();
00974 
00975                 // init tree
00976                 $tree = new ilTree(ROOT_FOLDER_ID);
00977                 $GLOBALS['tree'] =& $tree;
00978 
00979                 // authenticate & start session
00980                 PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($ilErr, "errorHandler"));
00981                 $ilBench->start("Core", "HeaderInclude_Authentication");
00982 //var_dump($_SESSION);
00983                 $ilAuth->start();
00984 //var_dump($_SESSION);
00985                 $ilias->setAuthError($ilErr->getLastError());
00986                 $ilBench->stop("Core", "HeaderInclude_Authentication");
00987 
00988                 // workaround: force login
00989                 if ($_GET["cmd"] == "force_login" || $this->script == "login.php")
00990                 {
00991                         $ilAuth->logout();
00992                         $_SESSION["AccountId"] = "";
00993                         $ilAuth->start();
00994                         $ilias->setAuthError($ilErr->getLastError());
00995                 }
00996 
00997                 // check correct setup
00998                 if (!$ilias->getSetting("setup_ok"))
00999                 {
01000                         die("Setup is not completed. Please run setup routine again.");
01001                 }
01002 
01003                 // $ilUser initialisation (1)
01004                 $ilBench->start("Core", "HeaderInclude_getCurrentUser");
01005                 $ilUser = new ilObjUser();
01006                 $ilias->account =& $ilUser;
01007                 $GLOBALS['ilUser'] =& $ilUser;
01008                 $ilBench->stop("Core", "HeaderInclude_getCurrentUser");
01009 
01010 
01011                 // $ilCtrl initialisation
01012                 $ilCtrl = new ilCtrl();
01013                 $GLOBALS['ilCtrl'] =& $ilCtrl;
01014 
01015                 // determin current script and up-path to main directory
01016                 // (sets $this->script and $this->updir)
01017                 $this->determineScriptAndUpDir();
01018 
01019                 // $styleDefinition initialisation and style handling for login and co.
01020                 $this->initStyle();
01021                 if (in_array($this->script,
01022                         array("login.php", "register.php", "view_usr_agreement.php"))
01023                         || $_GET["baseClass"] == "ilStartUpGUI")
01024                 {
01025                         $this->handleStyle();
01026                 }
01027 
01028 
01029                 // handle ILIAS 2 imported users:
01030                 // check ilias 2 password, if authentication failed
01031                 // only if AUTH_LOCAL
01032 //echo "A";
01033                 if (AUTH_CURRENT == AUTH_LOCAL && !$ilAuth->getAuth() && $this->script == "login.php" && $_POST["username"] != "")
01034                 {
01035                         if (ilObjUser::_lookupHasIlias2Password(ilUtil::stripSlashes($_POST["username"])))
01036                         {
01037                                 if (ilObjUser::_switchToIlias3Password(
01038                                         ilUtil::stripSlashes($_POST["username"]),
01039                                         ilUtil::stripSlashes($_POST["password"])))
01040                                 {
01041                                         $ilAuth->start();
01042                                         $ilias->setAuthError($ilErr->getLastError());
01043                                         ilUtil::redirect("index.php");
01044                                 }
01045                         }
01046                 }
01047 
01048 //echo $_POST; exit;
01049                 //
01050                 // SUCCESSFUL AUTHENTICATION
01051                 //
01052 //echo "<br>B-".$ilAuth->getAuth()."-".$ilAuth->_sessionName."-";
01053 //var_dump ($session[_authsession]);
01054                 if ($ilAuth->getAuth() && $ilias->account->isCurrentUserActive())
01055                 {
01056 //echo "C"; exit;
01057                         $ilBench->start("Core", "HeaderInclude_getCurrentUserAccountData");
01058 //var_dump($_SESSION);
01059                         // get user data
01060                         $this->initUserAccount();
01061 //var_dump($_SESSION);
01062                         // check client IP of user
01063                         $this->checkUserClientIP();
01064 
01065                         // check user agreement
01066                         $this->checkUserAgreement();
01067 
01068                         // update last_login date once the user logged in
01069                         if ($this->script == "login.php" ||
01070                                 $_GET["baseClass"] == "ilStartUpGUI")
01071                         {
01072                                 $ilUser->refreshLogin();
01073                         }
01074 
01075                         // set hits per page for all lists using table module
01076                         $_GET['limit'] = $_SESSION['tbl_limit'] = (int) $ilUser->getPref('hits_per_page');
01077 
01078                         // the next line makes it impossible to save the offset somehow in a session for
01079                         // a specific table (I tried it for the user administration).
01080                         // its not posssible to distinguish whether it has been set to page 1 (=offset = 0)
01081                         // or not set at all (then we want the last offset, e.g. being used from a session var).
01082                         // So I added the wrapping if statement. Seems to work (hopefully).
01083                         // Alex April 14th 2006
01084                         if ($_GET['offset'] != "")                                                      // added April 14th 2006
01085                         {
01086                                 $_GET['offset'] = (int) $_GET['offset'];                // old code
01087                         }
01088 
01089                         $ilBench->stop("Core", "HeaderInclude_getCurrentUserAccountData");
01090                 }
01091                 elseif (
01092                                         $this->script != "login.php"
01093                                         and $this->script != "shib_login.php"
01094                                         and $this->script != "error.php"
01095                                         and $this->script != "index.php"
01096                                         and $this->script != "view_usr_agreement.php"
01097                                         and $this->script != "register.php"
01098                                         and $this->script != "chat.php"
01099                                         and $this->script != "pwassist.php"
01100                                 )
01101                 {
01102                         //
01103                         // AUTHENTICATION FAILED
01104                         //
01105 
01106                         // authentication failed due to inactive user?
01107                         if ($ilAuth->getAuth() && !$ilUser->isCurrentUserActive())
01108                         {
01109                                 $inactive = true;
01110                         }
01111 
01112                         // jump to public section (to do: is this always the indended
01113                         // behaviour, login could be another possibility (including
01114                         // message)
01115 //echo "-".$_GET["baseClass"]."-";
01116                         if ($_GET["baseClass"] != "ilStartUpGUI")
01117                         {
01118                                 // $lng initialisation
01119                                 $this->initLanguage();
01120 
01121                                 if ($ilSetting->get("pub_section") &&
01122                                         ($ilAuth->getStatus() == "" || $ilAuth->getStatus() == AUTH_EXPIRED ||
01123                                                 $ilAuth->getStatus() == AUTH_IDLED) &&
01124                                         $_GET["reloadpublic"] != "1")
01125                                 {
01126                                         $this->goToPublicSection();
01127                                 }
01128                                 else
01129                                 {
01130                                         if ($context == "web")
01131                                         {
01132                                                 // normal access by webinterface
01133                                                 $this->goToLogin($ilAuth->getStatus());
01134                                                 exit;
01135                                         } else {
01136                                                 // called by soapAuthenticationLdap
01137                                                 return;
01138                                         }
01139                                         
01140                                 }
01141                                 // we should not get here => public section needs no redirect smeyer
01142                                 // exit;
01143                         }
01144                 }
01145 
01146                 //
01147                 // SUCCESSFUL AUTHENTICATED or NON-AUTH-AREA (Login, Registration, ...)
01148                 //
01149 
01150                 // $lng initialisation
01151                 $this->initLanguage();
01152 
01153                 // store user language in tree
01154                 $GLOBALS['tree']->initLangCode();
01155 
01156                 // instantiate main template
01157                 $tpl = new ilTemplate("tpl.main.html", true, true);
01158                 $GLOBALS['tpl'] =& $tpl;
01159 
01160 
01161                 // ### AA 03.10.29 added new LocatorGUI class ###
01162                 // when locator data array does not exist, initialise
01163                 if ( !isset($_SESSION["locator_level"]) )
01164                 {
01165                         $_SESSION["locator_data"] = array();
01166                         $_SESSION["locator_level"] = -1;
01167                 }
01168                 // initialise global ilias_locator object
01169                 $ilias_locator = new ilLocatorGUI();                    // deprecated
01170                 $ilLocator = new ilLocatorGUI();
01171                 $GLOBALS['ilias_locator'] =& $ilias_locator;    // deprecated
01172                 $GLOBALS['ilLocator'] =& $ilLocator;
01173 
01174                 // load style definitions
01175                 $ilBench->start("Core", "HeaderInclude_getStyleDefinitions");
01176                 $styleDefinition = new ilStyleDefinition();
01177                 $GLOBALS['styleDefinition'] =& $styleDefinition;
01178                 $styleDefinition->startParsing();
01179                 $ilBench->stop("Core", "HeaderInclude_getStyleDefinitions");
01180 
01181                 // load style sheet depending on user's settings
01182                 $location_stylesheet = ilUtil::getStyleSheetLocation();
01183                 $tpl->setVariable("LOCATION_STYLESHEET",$location_stylesheet);
01184 
01185                 // Init Navigation History
01186                 $ilNavigationHistory = new ilNavigationHistory();
01187                 $GLOBALS['ilNavigationHistory'] =& $ilNavigationHistory;
01188 
01189                 // init infopanel
01190 
01191                 // provide global browser information
01192                 $ilBrowser = new ilBrowser();
01193                 $GLOBALS['ilBrowser'] =& $ilBrowser;
01194 
01195                 // provide global help object
01196                 $ilHelp = new ilHelp();
01197                 $GLOBALS['ilHelp'] =& $ilHelp;
01198 
01199                 // main tabs gui
01200                 include_once 'classes/class.ilTabsGUI.php';
01201                 $ilTabs = new ilTabsGUI();
01202                 $GLOBALS['ilTabs'] =& $ilTabs;
01203 
01204                 // main menu
01205                 include_once 'classes/class.ilMainMenuGUI.php';
01206                 $ilMainMenu = new ilMainMenuGUI("_top");
01207                 $GLOBALS['ilMainMenu'] =& $ilMainMenu;
01208 
01209                 // Store online time of user
01210                 ilOnlineTracking::_updateAccess($ilUser->getId());
01211 
01212                 $ilBench->stop("Core", "HeaderInclude");
01213                 $ilBench->save();
01214 
01215         }
01216 
01220         function initFeed()
01221         {
01222                 global $ilDB, $ilUser, $ilLog, $ilErr, $ilClientIniFile, $ilIliasIniFile,
01223                         $ilSetting, $ilias, $https, $ilObjDataCache,
01224                         $ilLog, $objDefinition, $lng, $ilCtrl, $ilBrowser, $ilHelp,
01225                         $ilTabs, $ilMainMenu, $rbacsystem, $ilNavigationHistory;
01226 
01227                 // remove unsafe characters
01228                 $this->removeUnsafeCharacters();
01229 
01230                 // include common code files
01231                 $this->requireCommonIncludes();
01232                 global $ilBench;
01233 
01234                 // $ilAppEventHandler initialisation
01235                 $this->initEventHandling();
01236 
01237                 // set error handler (to do: check preconditions for error handler to work)
01238                 $ilBench->start("Core", "HeaderInclude_GetErrorHandler");
01239                 $ilErr = new ilErrorHandling();
01240                 $GLOBALS['ilErr'] =& $ilErr;
01241                 $ilErr->setErrorHandling(PEAR_ERROR_CALLBACK,array($ilErr,'errorHandler'));
01242                 $ilBench->stop("Core", "HeaderInclude_GetErrorHandler");
01243 
01244                 // prepare file access to work with safe mode (has been done in class ilias before)
01245                 umask(0117);
01246 
01247                 // $ilIliasIniFile initialisation
01248                 $this->initIliasIniFile();
01249 
01250                 // CLIENT_ID determination
01251                 $this->determineClient();
01252 
01253                 // $ilClientIniFile initialisation
01254                 if (!$this->initClientIniFile())
01255                 {
01256                         $c = $_COOKIE["ilClientId"];
01257                         setcookie("ilClientId", $ilIliasIniFile->readVariable("clients","default"));
01258                         $_COOKIE["ilClientId"] = $ilIliasIniFile->readVariable("clients","default");
01259                         echo ("Client $c does not exist. Please reload this page to return to the default client.");
01260                         exit;
01261                 }
01262 
01263                 // maintenance mode
01264                 $this->handleMaintenanceMode();
01265 
01266                 // $ilDB initialisation
01267                 $this->initDatabase();
01268 
01269                 // $ilObjDataCache initialisation
01270                 $ilObjDataCache = new ilObjectDataCache();
01271                 $GLOBALS['ilObjDataCache'] =& $ilObjDataCache;
01272 
01273                 // init settings
01274                 $this->initSettings();
01275 
01276                 // init tree
01277                 $tree = new ilTree(ROOT_FOLDER_ID);
01278                 $GLOBALS['tree'] =& $tree;
01279 
01280                 // init language
01281                 $lng = new ilLanguage($ilClientIniFile->readVariable("language","default"));
01282                 $GLOBALS['lng'] =& $lng;
01283 
01284         }
01285 
01286         function initLog() {
01287                 global $ilLog;
01288                 $log = new ilLog(ILIAS_LOG_DIR,ILIAS_LOG_FILE,CLIENT_ID,ILIAS_LOG_ENABLED,ILIAS_LOG_LEVEL);
01289                 $GLOBALS['log'] =& $log;
01290                 $ilLog =& $log;
01291                 $GLOBALS['ilLog'] =& $ilLog;
01292         }
01293 
01294         function initILIASObject() {
01295                 global $ilias, $ilBench;
01296                 $ilBench->start("Core", "HeaderInclude_GetILIASObject");
01297                 $ilias = & new ILIAS();
01298                 $GLOBALS['ilias'] =& $ilias;
01299                 $ilBench->stop("Core", "HeaderInclude_GetILIASObject");
01300 //var_dump($_SESSION);
01301         }
01302 }
01303 ?>

Generated on Fri Dec 13 2013 17:56:57 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1