00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00035
00036 include("include/inc.get_pear.php");
00037
00038
00039 require_once "classes/class.ilUtil.php";
00040 require_once "classes/class.ilBenchmark.php";
00041 $ilBench =& new ilBenchmark();
00042 $GLOBALS['ilBench'] =& $ilBench;
00043 $ilBench->start("Core", "HeaderInclude");
00044
00045
00046 $t_pagestart = ilUtil::StopWatch();
00047
00048 $ilBench->start("Core", "HeaderInclude_IncludeFiles");
00049
00050
00051 require_once "PEAR.php";
00052 require_once "DB.php";
00053 require_once "Auth/Auth.php";
00054
00055
00056
00057
00058
00059 @include_once "HTML/ITX.php";
00060
00061 if (!class_exists("IntegratedTemplateExtension"))
00062 {
00063 include_once "HTML/Template/ITX.php";
00064
00065 include_once "classes/class.ilTemplateHTMLITX.php";
00066 }
00067 else
00068 {
00069
00070 include_once "classes/class.ilTemplateITX.php";
00071 }
00072 require_once "classes/class.ilTemplate.php";
00073
00074
00075 require_once "include/inc.db_session_handler.php";
00076 require_once "classes/class.ilIniFile.php";
00077 require_once "classes/class.ilDBx.php";
00078 require_once "classes/class.ilias.php";
00079 require_once "classes/class.ilObjUser.php";
00080 require_once "classes/class.ilFormat.php";
00081 require_once "classes/class.ilSaxParser.php";
00082 require_once "classes/class.ilObjectDefinition.php";
00083 require_once "classes/class.ilStyleDefinition.php";
00084 require_once "classes/class.perm.php";
00085 require_once "classes/class.ilTree.php";
00086 require_once "classes/class.ilLanguage.php";
00087 require_once "classes/class.ilLog.php";
00088 require_once "classes/class.ilMailbox.php";
00089 require_once "classes/class.ilCtrl.php";
00090 require_once "classes/class.ilConditionHandler.php";
00091 require_once "classes/class.ilBrowser.php";
00092 require_once "classes/class.ilFrameTargetInfo.php";
00093 require_once "include/inc.ilias_version.php";
00094
00095
00096 require_once "classes/class.ilRbacAdmin.php";
00097 require_once "classes/class.ilRbacSystem.php";
00098 require_once "classes/class.ilRbacReview.php";
00099
00100
00101
00102
00103
00104
00105 require_once "classes/class.ilLocatorGUI.php";
00106
00107
00108 require_once "classes/class.ilErrorHandling.php";
00109
00110 $ilBench->stop("Core", "HeaderInclude_IncludeFiles");
00111
00112 $ilBench->start("Core", "HeaderInclude_GetErrorHandler");
00113 $ilErr = new ilErrorHandling();
00114 $GLOBALS['ilErr'] =& $ilErr;
00115 $ilErr->setErrorHandling(PEAR_ERROR_CALLBACK,array($ilErr,'errorHandler'));
00116 $ilBench->stop("Core", "HeaderInclude_GetErrorHandler");
00117
00118
00119 $ilBench->start("Core", "HeaderInclude_GetILIASObject");
00120 $ilias =& new ILIAS($_COOKIE["ilClientId"]);
00121 $GLOBALS['ilias'] =& $ilias;
00122 $ilBench->stop("Core", "HeaderInclude_GetILIASObject");
00123
00124 require_once './classes/class.ilHTTPS.php';
00125
00126 $https =& new ilHTTPS();
00127 $GLOBALS['https'] =& $https;
00128 $https->checkPort();
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142 if ($_SESSION["message"])
00143 {
00144 $_POST = $_SESSION["post_vars"];
00145 }
00146
00147
00148
00149
00150 include_once "include/inc.debug.php";
00151
00152
00153
00154 $ilBench->start("Core", "HeaderInclude_Authentication");
00155 $ilias->auth->start();
00156 $ilBench->stop("Core", "HeaderInclude_Authentication");
00157
00158
00159 if ($_GET["cmd"] == "force_login")
00160 {
00161 $ilias->auth->logout();
00162 $_SESSION["AccountId"] = "";
00163 $ilias->auth->start();
00164 }
00165
00166
00167 $log = new ilLog(ILIAS_LOG_DIR,ILIAS_LOG_FILE,$ilias->getClientId(),ILIAS_LOG_ENABLED,ILIAS_LOG_LEVEL);
00168 $GLOBALS['log'] =& $log;
00169
00170
00171 $ilBench->start("Core", "HeaderInclude_getObjectDefinitions");
00172 $objDefinition = new ilObjectDefinition();
00173 $GLOBALS['objDefinition'] =& $objDefinition;
00174 $objDefinition->startParsing();
00175 $ilBench->stop("Core", "HeaderInclude_getObjectDefinitions");
00176
00177
00178
00179 $ilBench->start("Core", "HeaderInclude_getCurrentUser");
00180 $ilias->account = new ilObjUser();
00181 $ilBench->stop("Core", "HeaderInclude_getCurrentUser");
00182
00183
00184 $ilUser =& $ilias->account;
00185 $GLOBALS['ilUser'] =& $ilias->account;
00186 $ilCtrl = new ilCtrl();
00187 $GLOBALS['ilCtrl'] =& $ilCtrl;
00188 $ilLog =& $log;
00189 $GLOBALS['ilLog'] =& $ilLog;
00190
00191
00192 $script = substr(strrchr($_SERVER["PHP_SELF"],"/"),1);
00193
00194
00195
00196 if (AUTH_CURRENT == AUTH_LOCAL && !$ilias->auth->getAuth() && $script == "login.php" && $_POST["username"] != "")
00197
00198 {
00199 if (ilObjUser::_lookupHasIlias2Password($_POST["username"]))
00200 {
00201 if (ilObjUser::_switchToIlias3Password($_POST["username"], $_POST["password"]))
00202 {
00203 $ilias->auth->start();
00204 ilUtil::redirect("start.php");
00205 }
00206 }
00207 }
00208
00209 if ($ilias->auth->getAuth() && $ilias->account->isCurrentUserActive())
00210 {
00211 $ilBench->start("Core", "HeaderInclude_getCurrentUserAccountData");
00212
00213
00214 if (empty($_SESSION["AccountId"]))
00215 {
00216 $_SESSION["AccountId"] = $ilias->account->checkUserId();
00217
00218
00219 $rbacreview = new ilRbacReview();
00220 $GLOBALS['rbacreview'] =& $rbacreview;
00221 $_SESSION["RoleId"] = $rbacreview->assignedRoles($_SESSION["AccountId"]);
00222 }
00223 else
00224 {
00225
00226 $ilias->account->setId($_SESSION["AccountId"]);
00227 }
00228
00229
00230 $ilias->account->read();
00231
00232
00233
00234 if (!$ilias->account->hasAcceptedUserAgreement() &&
00235 $script != "view_usr_agreement.php" &&
00236 $script != "login.php" &&
00237 $ilias->account->getId() != ANONYMOUS_USER_ID)
00238 {
00239
00240 ilUtil::redirect("view_usr_agreement.php?cmd=getAcceptance");
00241 }
00242
00243
00244 if ($script == "login.php")
00245 {
00246 $ilias->account->refreshLogin();
00247 }
00248
00249
00250
00251 #_SESSION["tbl_limit"] = ($_SESSION["tbl_limit"]) ? intval($_SESSION["tbl_limit"]) : intval($ilias->account->prefs["hits_per_page"]);
00252 #_GET["limit"] = ($_SESSION["tbl_limit"]) ? ($_SESSION["tbl_limit"]) : intval($ilias->account->prefs["hits_per_page"]);
00253 #_GET["offset"] = intval($_GET["offset"]);
00254 $_GET['limit'] = $_SESSION['tbl_limit'] = (int) $ilUser->getPref('hits_per_page');
00255 $_GET['offset'] = (int) $_GET['offset'];
00256
00257
00258 $ilBench->stop("Core", "HeaderInclude_getCurrentUserAccountData");
00259 }
00260 elseif ($script != "login.php" and $script != "nologin.php" and $script != "index.php"
00261 and $script != "view_usr_agreement.php" and $script!= "register.php" and $script != "chat.php"
00262 and $script != "pwassist.php")
00263 {
00264
00265
00266
00267 $dirname = dirname($_SERVER["PHP_SELF"]);
00268 $ilurl = parse_url(ILIAS_HTTP_PATH);
00269 $subdir = substr(strstr($dirname,$ilurl["path"]),strlen($ilurl["path"]));
00270 $updir = "";
00271
00272 if ($subdir)
00273 {
00274 $num_subdirs = substr_count($subdir,"/");
00275
00276 for ($i=1;$i<=$num_subdirs;$i++)
00277 {
00278 $updir .= "../";
00279 }
00280 }
00281
00282 if ($ilias->auth->getAuth() && !$ilias->account->isCurrentUserActive())
00283 {
00284 $inactive = true;
00285 }
00286
00287 session_unset();
00288 session_destroy();
00289
00290 $return_to = urlencode(substr($_SERVER["REQUEST_URI"],strlen($ilurl["path"])+1));
00291
00292 if (($_GET["inactive"]) || $inactive)
00293 {
00294 ilUtil::redirect($updir."index.php?reload=true&inactive=true&return_to=".$return_to);
00295 }
00296 else
00297 {
00298 ilUtil::redirect($updir."index.php?client_id=".$_GET["client_id"]."&reload=true&return_to=".$return_to);
00299 }
00300 }
00301
00302
00303 $ilBench->start("Core", "HeaderInclude_initLanguage");
00304
00305 if (is_null($_SESSION['lang']))
00306 {
00307 $_GET["lang"] = ($_GET["lang"]) ? $_GET["lang"] : $ilias->account->getPref("language");
00308 }
00309
00310 $_SESSION['lang'] = ($_GET['lang']) ? $_GET['lang'] : $_SESSION['lang'];
00311
00312
00313 if ($script == "login.php")
00314 {
00315 $_SESSION['lang'] = $ilias->account->getPref("language");
00316 }
00317
00318 $lng = new ilLanguage($_SESSION['lang']);
00319 $GLOBALS['lng'] =& $lng;
00320 $ilBench->stop("Core", "HeaderInclude_initLanguage");
00321
00322
00323 $ilBench->start("Core", "HeaderInclude_initRBAC");
00324 $rbacsystem = new ilRbacSystem();
00325 $GLOBALS['rbacsystem'] =& $rbacsystem;
00326 $rbacadmin = new ilRbacAdmin();
00327 $GLOBALS['rbacadmin'] =& $rbacadmin;
00328 $rbacreview = new ilRbacReview();
00329 $GLOBALS['rbacreview'] =& $rbacreview;
00330 $ilBench->stop("Core", "HeaderInclude_initRBAC");
00331
00332
00333
00334
00335
00336
00337 $tree = new ilTree(ROOT_FOLDER_ID);
00338 $GLOBALS['tree'] =& $tree;
00339
00340
00341 $tpl = new ilTemplate("tpl.main.html", true, true);
00342 $GLOBALS['tpl'] =& $tpl;
00343
00344
00345
00346
00347 if ( !isset($_SESSION["locator_level"]) )
00348 {
00349 $_SESSION["locator_data"] = array();
00350 $_SESSION["locator_level"] = -1;
00351 }
00352
00353 $ilias_locator = new ilLocatorGUI();
00354 $GLOBALS['ilias_locator'] =& $ilias_locator;
00355
00356
00357 $ilBench->start("Core", "HeaderInclude_getStyleDefinitions");
00358 $styleDefinition = new ilStyleDefinition();
00359 $GLOBALS['styleDefinition'] =& $styleDefinition;
00360 $styleDefinition->startParsing();
00361 $ilBench->stop("Core", "HeaderInclude_getStyleDefinitions");
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384 $location_stylesheet = ilUtil::getStyleSheetLocation();
00385 $tpl->setVariable("LOCATION_STYLESHEET",$location_stylesheet);
00386 $tpl->setVariable("LOCATION_JAVASCRIPT",dirname($location_stylesheet));
00387
00388
00389 if ($mail_id = ilMailbox::hasNewMail($_SESSION["AccountId"]))
00390 {
00391 $mbox = new ilMailbox($_SESSION["AccountId"]);
00392 $mail =& new ilMail($_SESSION['AccountId']);
00393 if($rbacsystem->checkAccess('mail_visible',$mail->getMailObjectReferenceId()))
00394 {
00395 $folder_id = $mbox->getInboxFolder();
00396
00397 $_SESSION["infopanel"] = array ("link" => "mail_frameset.php?target=".
00398 htmlentities(urlencode("mail_read.php?mobj_id=".$folder_id."&mail_id=".$mail_id)),
00399 "text" => "new_mail"
00400
00401 );
00402 }
00403 }
00404
00405
00406 if (version_compare(PHP_VERSION,'5','>='))
00407 {
00408 require_once("include/inc.xml5compliance.php");
00409 }
00410
00411
00412 if (version_compare(PHP_VERSION,'5','>='))
00413 {
00414 require_once("include/inc.xsl5compliance.php");
00415 }
00416
00417
00418 $ilBrowser = new ilBrowser();
00419 $GLOBALS['ilBrowser'] =& $ilBrowser;
00420
00421 $ilBench->stop("Core", "HeaderInclude");
00422 $ilBench->save();
00423
00424 ?>