CGL fixes
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / tslib / index_ts.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2008 Kasper Skaarhoj (kasperYYYY@typo3.com)
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 * A copy is found in the textfile GPL.txt and important notices to the license
17 * from the author is found in LICENSE.txt distributed with these scripts.
18 *
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27 /**
28 * This is the MAIN DOCUMENT of the TypoScript driven standard front-end (from the "cms" extension)
29 * Basically put this is the "index.php" script which all requests for TYPO3 delivered pages goes to in the frontend (the website)
30 * The script configures constants, includes libraries and does a little logic here and there in order to instantiate the right classes to create the webpage.
31 * All the real data processing goes on in the "tslib/" classes which this script will include and use as needed.
32 *
33 * $Id$
34 * Revised for TYPO3 3.6 June/2003 by Kasper Skaarhoj
35 *
36 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
37 * @package TYPO3
38 * @subpackage tslib
39 */
40
41 // *******************************
42 // Checking PHP version
43 // *******************************
44 if (version_compare(phpversion(), '5.1', '<')) die ('TYPO3 requires PHP 5.1.0 or higher.');
45
46 // *******************************
47 // Set error reporting
48 // *******************************
49 error_reporting (E_ALL ^ E_NOTICE);
50
51
52 // ******************
53 // Constants defined
54 // ******************
55 $TYPO3_MISC['microtime_start'] = microtime();
56 define('TYPO3_OS', stristr(PHP_OS,'win')&&!stristr(PHP_OS,'darwin')?'WIN':'');
57 define('TYPO3_MODE','FE');
58
59 if (!defined('PATH_thisScript')) define('PATH_thisScript',str_replace('//','/', str_replace('\\','/', (php_sapi_name()=='cgi'||php_sapi_name()=='isapi' ||php_sapi_name()=='cgi-fcgi')&&($_SERVER['ORIG_PATH_TRANSLATED']?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED'])? ($_SERVER['ORIG_PATH_TRANSLATED']?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED']):($_SERVER['ORIG_SCRIPT_FILENAME']?$_SERVER['ORIG_SCRIPT_FILENAME']:$_SERVER['SCRIPT_FILENAME']))));
60 if (!defined('PATH_site')) define('PATH_site', dirname(PATH_thisScript).'/');
61 if (!defined('PATH_t3lib')) define('PATH_t3lib', PATH_site.'t3lib/');
62
63 define('TYPO3_mainDir', 'typo3/'); // This is the directory of the backend administration for the sites of this TYPO3 installation.
64 define('PATH_typo3', PATH_site.TYPO3_mainDir);
65 define('PATH_typo3conf', PATH_site.'typo3conf/');
66
67 if (!defined('PATH_tslib')) {
68 if (@is_dir(PATH_site.TYPO3_mainDir.'sysext/cms/tslib/')) {
69 define('PATH_tslib', PATH_site.TYPO3_mainDir.'sysext/cms/tslib/');
70 } elseif (@is_dir(PATH_site.'tslib/')) {
71 define('PATH_tslib', PATH_site.'tslib/');
72 }
73 }
74
75 if (!@is_dir(PATH_typo3conf)) die('Cannot find configuration. This file is probably executed from the wrong location.');
76
77 // *********************
78 // Timetracking started
79 // *********************
80 require_once(PATH_t3lib.'class.t3lib_timetrack.php');
81 $TT = new t3lib_timeTrack;
82 $TT->start();
83 $TT->push('','Script start');
84
85
86 // *********************
87 // Mandatory libraries included
88 // *********************
89 $TT->push('Include class t3lib_db, t3lib_div, t3lib_extmgm','');
90 require_once(PATH_t3lib.'class.t3lib_div.php');
91 require_once(PATH_t3lib.'class.t3lib_extmgm.php');
92 $TT->pull();
93
94
95
96 // **********************
97 // Include configuration
98 // **********************
99 $TT->push('Include config files','');
100 require(PATH_t3lib.'config_default.php');
101 if (!defined ('TYPO3_db')) die ('The configuration file was not included.'); // the name of the TYPO3 database is stored in this constant. Here the inclusion of the config-file is verified by checking if this var is set.
102 if (!t3lib_extMgm::isLoaded('cms')) die('<strong>Error:</strong> The main frontend extension "cms" was not loaded. Enable it in the extension manager in the backend.');
103
104 if (!defined('PATH_tslib')) {
105 define('PATH_tslib', t3lib_extMgm::extPath('cms').'tslib/');
106 }
107
108 require_once(PATH_t3lib.'class.t3lib_db.php');
109 $TYPO3_DB = t3lib_div::makeInstance('t3lib_DB');
110 $TYPO3_DB->debugOutput = $TYPO3_CONF_VARS['SYS']['sqlDebug'];
111
112 $CLIENT = t3lib_div::clientInfo(); // Set to the browser: net / msie if 4+ browsers
113 $TT->pull();
114
115
116 // *******************************
117 // Checking environment
118 // *******************************
119 if (isset($_POST['GLOBALS']) || isset($_GET['GLOBALS'])) die('You cannot set the GLOBALS-array from outside the script.');
120 if (!get_magic_quotes_gpc()) {
121 $TT->push('Add slashes to GET/POST arrays','');
122 t3lib_div::addSlashesOnArray($_GET);
123 t3lib_div::addSlashesOnArray($_POST);
124 $HTTP_GET_VARS = $_GET;
125 $HTTP_POST_VARS = $_POST;
126 $TT->pull();
127 }
128
129
130 // *********************
131 // Look for extension ID which will launch alternative output engine
132 // *********************
133 if ($temp_extId = t3lib_div::_GP('eID')) {
134 if ($classPath = t3lib_div::getFileAbsFileName($TYPO3_CONF_VARS['FE']['eID_include'][$temp_extId])) {
135 require_once(PATH_tslib.'class.tslib_eidtools.php');
136 require($classPath);
137 }
138 exit;
139 }
140
141 // *********************
142 // Libraries included
143 // *********************
144 $TT->push('Include Frontend libraries','');
145 require_once(PATH_tslib.'class.tslib_fe.php');
146 require_once(PATH_t3lib.'class.t3lib_page.php');
147 require_once(PATH_t3lib.'class.t3lib_userauth.php');
148 require_once(PATH_tslib.'class.tslib_feuserauth.php');
149 require_once(PATH_t3lib.'class.t3lib_tstemplate.php');
150 require_once(PATH_t3lib.'class.t3lib_cs.php');
151 $TT->pull();
152
153 // ***********************************
154 // Initializing the Caching System
155 // ***********************************
156
157 $TT->push('Initializing the Caching System','');
158 // TODO implement autoloading so that we only require stuff we really need
159 require_once(PATH_t3lib . 'cache/class.t3lib_cache_abstractbackend.php');
160 require_once(PATH_t3lib . 'cache/class.t3lib_cache_abstractcache.php');
161 require_once(PATH_t3lib . 'cache/class.t3lib_cache_exception.php');
162 require_once(PATH_t3lib . 'cache/class.t3lib_cache_factory.php');
163 require_once(PATH_t3lib . 'cache/class.t3lib_cache_manager.php');
164 require_once(PATH_t3lib . 'cache/class.t3lib_cache_variablecache.php');
165
166 require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_classalreadyloaded.php');
167 require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_duplicateidentifier.php');
168 require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_invalidbackend.php');
169 require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_invalidcache.php');
170 require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_invaliddata.php');
171 require_once(PATH_t3lib . 'cache/exception/class.t3lib_cache_exception_nosuchcache.php');
172
173 $cacheManager = t3lib_div::makeInstance('t3lib_cache_Manager');
174 $cacheFactoryClass = t3lib_div::makeInstanceClassName('t3lib_cache_Factory');
175 $TYPO3_CACHE = new $cacheFactoryClass($cacheManager);
176 unset($cacheFactoryClass);
177 $TT->pull();
178
179 // ***********************************
180 // Create $TSFE object (TSFE = TypoScript Front End)
181 // Connecting to database
182 // ***********************************
183 $temp_TSFEclassName = t3lib_div::makeInstanceClassName('tslib_fe');
184 $TSFE = new $temp_TSFEclassName(
185 $TYPO3_CONF_VARS,
186 t3lib_div::_GP('id'),
187 t3lib_div::_GP('type'),
188 t3lib_div::_GP('no_cache'),
189 t3lib_div::_GP('cHash'),
190 t3lib_div::_GP('jumpurl'),
191 t3lib_div::_GP('MP'),
192 t3lib_div::_GP('RDCT')
193 );
194
195 if($TYPO3_CONF_VARS['FE']['pageUnavailable_force'] &&
196 !t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'), $TYPO3_CONF_VARS['SYS']['devIPmask'])) {
197 $TSFE->pageUnavailableAndExit('This page is temporarily unavailable.');
198 }
199
200
201 $TSFE->connectToDB();
202
203 // In case of a keyword-authenticated preview, re-initialize the TSFE object:
204 if ($temp_previewConfig = $TSFE->ADMCMD_preview()) {
205 $TSFE = new $temp_TSFEclassName(
206 $TYPO3_CONF_VARS,
207 t3lib_div::_GP('id'),
208 t3lib_div::_GP('type'),
209 t3lib_div::_GP('no_cache'),
210 t3lib_div::_GP('cHash'),
211 t3lib_div::_GP('jumpurl'),
212 t3lib_div::_GP('MP'),
213 t3lib_div::_GP('RDCT')
214 );
215 $TSFE->ADMCMD_preview_postInit($temp_previewConfig);
216 }
217
218 if ($TSFE->RDCT) {$TSFE->sendRedirect();}
219
220
221 // *******************
222 // output compression
223 // *******************
224 if ($TYPO3_CONF_VARS['FE']['compressionLevel']) {
225 ob_start();
226 require_once(PATH_t3lib.'class.gzip_encode.php');
227 }
228
229 // *********
230 // FE_USER
231 // *********
232 $TT->push('Front End user initialized','');
233 /* @var $TSFE tslib_fe */
234 $TSFE->initFEuser();
235 $TT->pull();
236
237 // ****************
238 // PRE BE_USER HOOK
239 // ****************
240 if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/index_ts.php']['preBeUser'])) {
241 foreach($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/index_ts.php']['preBeUser'] as $_funcRef) {
242 $_params = array();
243 t3lib_div::callUserFunction($_funcRef, $_params , $_params);
244 }
245 }
246
247
248 // *********
249 // BE_USER
250 // *********
251 $BE_USER='';
252 if ($_COOKIE['be_typo_user']) { // If the backend cookie is set, we proceed and checks if a backend user is logged in.
253 $TYPO3_MISC['microtime_BE_USER_start'] = microtime();
254 $TT->push('Back End user initialized','');
255 require_once (PATH_t3lib.'class.t3lib_befunc.php');
256 require_once (PATH_t3lib.'class.t3lib_userauthgroup.php');
257 require_once (PATH_t3lib.'class.t3lib_beuserauth.php');
258 require_once (PATH_t3lib.'class.t3lib_tsfebeuserauth.php');
259
260 // the value this->formfield_status is set to empty in order to disable login-attempts to the backend account through this script
261 $BE_USER = t3lib_div::makeInstance('t3lib_tsfeBeUserAuth'); // New backend user object
262 $BE_USER->OS = TYPO3_OS;
263 $BE_USER->lockIP = $TYPO3_CONF_VARS['BE']['lockIP'];
264 $BE_USER->start(); // Object is initialized
265 $BE_USER->unpack_uc('');
266 if ($BE_USER->user['uid']) {
267 $BE_USER->fetchGroupData();
268 $TSFE->beUserLogin = 1;
269 }
270 if ($BE_USER->checkLockToIP() && $BE_USER->checkBackendAccessSettingsFromInitPhp()) {
271 $BE_USER->extInitFeAdmin();
272 } else { // Unset the user initialization.
273 $BE_USER='';
274 $TSFE->beUserLogin=0;
275 }
276 $TT->pull();
277 $TYPO3_MISC['microtime_BE_USER_end'] = microtime();
278 } elseif ($TSFE->ADMCMD_preview_BEUSER_uid) {
279 require_once (PATH_t3lib.'class.t3lib_befunc.php');
280 require_once (PATH_t3lib.'class.t3lib_userauthgroup.php');
281 require_once (PATH_t3lib.'class.t3lib_beuserauth.php');
282 require_once (PATH_t3lib.'class.t3lib_tsfebeuserauth.php');
283
284 // the value this->formfield_status is set to empty in order to disable login-attempts to the backend account through this script
285 $BE_USER = t3lib_div::makeInstance('t3lib_tsfeBeUserAuth'); // New backend user object
286 $BE_USER->userTS_dontGetCached = 1;
287 $BE_USER->OS = TYPO3_OS;
288 $BE_USER->setBeUserByUid($TSFE->ADMCMD_preview_BEUSER_uid);
289 $BE_USER->unpack_uc('');
290 if ($BE_USER->user['uid']) {
291 $BE_USER->fetchGroupData();
292 $TSFE->beUserLogin = 1;
293 } else {
294 $BE_USER = '';
295 $TSFE->beUserLogin = 0;
296 }
297 }
298
299 // ********************
300 // Workspace preview:
301 // ********************
302 $TSFE->workspacePreviewInit();
303
304
305 // *****************************************
306 // Process the ID, type and other parameters
307 // After this point we have an array, $page in TSFE, which is the page-record of the current page, $id
308 // *****************************************
309 $TT->push('Process ID','');
310 $TSFE->checkAlternativeIdMethods();
311 $TSFE->clear_preview();
312 $TSFE->determineId();
313
314 // Now, if there is a backend user logged in and he has NO access to this page, then re-evaluate the id shown!
315 if ($TSFE->beUserLogin && (!$BE_USER->extPageReadAccess($TSFE->page) || t3lib_div::_GP('ADMCMD_noBeUser'))) { // t3lib_div::_GP('ADMCMD_noBeUser') is placed here because workspacePreviewInit() might need to know if a backend user is logged in!
316
317 // Remove user
318 unset($BE_USER);
319 $TSFE->beUserLogin = 0;
320
321 // Re-evaluate the page-id.
322 $TSFE->checkAlternativeIdMethods();
323 $TSFE->clear_preview();
324 $TSFE->determineId();
325 }
326 $TSFE->makeCacheHash();
327 $TT->pull();
328
329
330 // *****************************************
331 // Frontend editing
332 // *****************************************
333 if ($TSFE->beUserLogin && $BE_USER->extAdmEnabled) {
334 require_once(t3lib_extMgm::extPath('lang').'lang.php');
335 $LANG = t3lib_div::makeInstance('language');
336 $LANG->init($BE_USER->uc['lang']);
337
338 $BE_USER->extSaveFeAdminConfig();
339
340 // Setting some values based on the admin panel
341 $TSFE->forceTemplateParsing = $BE_USER->extGetFeAdminValue('tsdebug', 'forceTemplateParsing');
342 $TSFE->displayEditIcons = $BE_USER->extGetFeAdminValue('edit', 'displayIcons');
343 $TSFE->displayFieldEditIcons = $BE_USER->extGetFeAdminValue('edit', 'displayFieldIcons');
344
345 if ($BE_USER->extGetFeAdminValue('tsdebug','displayQueries')) {
346 if ($GLOBALS['TYPO3_DB']->explainOutput == 0) { // do not override if the value is already set in t3lib_db
347 // Enable execution of EXPLAIN SELECT queries
348 $GLOBALS['TYPO3_DB']->explainOutput = 3;
349 }
350 }
351
352 if (t3lib_div::_GP('ADMCMD_editIcons')) {
353 $TSFE->displayFieldEditIcons=1;
354 $BE_USER->uc['TSFE_adminConfig']['edit_editNoPopup']=1;
355 }
356 if (t3lib_div::_GP('ADMCMD_simUser')) {
357 $BE_USER->uc['TSFE_adminConfig']['preview_simulateUserGroup']=intval(t3lib_div::_GP('ADMCMD_simUser'));
358 $BE_USER->ext_forcePreview=1;
359 }
360 if (t3lib_div::_GP('ADMCMD_simTime')) {
361 $BE_USER->uc['TSFE_adminConfig']['preview_simulateDate']=intval(t3lib_div::_GP('ADMCMD_simTime'));
362 $BE_USER->ext_forcePreview=1;
363 }
364
365 // Include classes for editing IF editing module in Admin Panel is open
366 if (($BE_USER->extAdmModuleEnabled('edit') && $BE_USER->extIsAdmMenuOpen('edit')) || $TSFE->displayEditIcons == 1) {
367 $TSFE->includeTCA();
368 if ($BE_USER->extIsEditAction()) {
369 require_once (PATH_t3lib.'class.t3lib_tcemain.php');
370 $BE_USER->extEditAction();
371 }
372 if ($BE_USER->extIsFormShown()) {
373 require_once(PATH_t3lib.'class.t3lib_tceforms.php');
374 require_once(PATH_t3lib.'class.t3lib_iconworks.php');
375 require_once(PATH_t3lib.'class.t3lib_loaddbgroup.php');
376 require_once(PATH_t3lib.'class.t3lib_transferdata.php');
377 }
378 }
379
380 if ($TSFE->forceTemplateParsing || $TSFE->displayEditIcons || $TSFE->displayFieldEditIcons) { $TSFE->set_no_cache(); }
381 }
382
383
384 // *******************************************
385 // Get compressed $TCA-Array();
386 // After this, we should now have a valid $TCA, though minimized
387 // *******************************************
388 $TSFE->getCompressedTCarray();
389
390
391 // ********************************
392 // Starts the template
393 // *******************************
394 $TT->push('Start Template','');
395 $TSFE->initTemplate();
396 $TT->pull();
397
398
399 // ********************************
400 // Get from cache
401 // *******************************
402 $TT->push('Get Page from cache','');
403 $TSFE->getFromCache();
404 $TT->pull();
405
406
407 // ******************************************************
408 // Get config if not already gotten
409 // After this, we should have a valid config-array ready
410 // ******************************************************
411 $TSFE->getConfigArray();
412
413
414 // ********************************
415 // Convert POST data to internal "renderCharset" if different from the metaCharset
416 // *******************************
417 $TSFE->convPOSTCharset();
418
419
420 // *******************************************
421 // Setting language and locale
422 // *******************************************
423 $TT->push('Setting language and locale','');
424 $TSFE->settingLanguage();
425 $TSFE->settingLocale();
426 $TT->pull();
427
428
429 // ********************************
430 // Check JumpUrl
431 // *******************************
432 $TSFE->setExternalJumpUrl();
433 $TSFE->checkJumpUrlReferer();
434
435
436 // ********************************
437 // Check Submission of data.
438 // This is done at this point, because we need the config values
439 // *******************************
440 switch($TSFE->checkDataSubmission()) {
441 case 'email':
442 require_once(PATH_t3lib.'class.t3lib_htmlmail.php');
443 require_once(PATH_t3lib.'class.t3lib_formmail.php');
444 $TSFE->sendFormmail();
445 break;
446 case 'fe_tce':
447 require_once(PATH_tslib.'class.tslib_fetce.php');
448 $TSFE->includeTCA();
449 $TT->push('fe_tce','');
450 $TSFE->fe_tce();
451 $TT->pull();
452 break;
453 }
454
455
456 // ********************************
457 // Generate page
458 // *******************************
459 $TSFE->setUrlIdToken();
460
461 $TT->push('Page generation','');
462 if ($TSFE->doXHTML_cleaning()) {
463 require_once(PATH_t3lib.'class.t3lib_parsehtml.php');
464 }
465 if ($TSFE->isGeneratePage()) {
466 $TSFE->generatePage_preProcessing();
467 $temp_theScript=$TSFE->generatePage_whichScript();
468
469 if ($temp_theScript) {
470 include($temp_theScript);
471 } else {
472 require_once(PATH_tslib.'class.tslib_pagegen.php');
473 include(PATH_tslib.'pagegen.php');
474 }
475 $TSFE->generatePage_postProcessing();
476 } elseif ($TSFE->isINTincScript()) {
477 require_once(PATH_tslib.'class.tslib_pagegen.php');
478 include(PATH_tslib.'pagegen.php');
479 }
480 $TT->pull();
481
482
483 // ********************************
484 // $TSFE->config['INTincScript']
485 // *******************************
486 if ($TSFE->isINTincScript()) {
487 $TT->push('Non-cached objects','');
488 $TSFE->INTincScript();
489 $TT->pull();
490 }
491
492 // ***************
493 // Output content
494 // ***************
495 if ($TSFE->isOutputting()) {
496 $TT->push('Print Content','');
497 $TSFE->processOutput();
498
499 // ***************************************
500 // Outputs content / Includes EXT scripts
501 // ***************************************
502 if ($TSFE->isEXTincScript()) {
503 $TT->push('External PHP-script','');
504 // Important global variables here are $EXTiS_*, they must not be overridden in include-scripts!!!
505 $EXTiS_config = $TSFE->config['EXTincScript'];
506 $EXTiS_splitC = explode('<!--EXT_SCRIPT.',$TSFE->content); // Splits content with the key
507
508 // Special feature: Include libraries
509 reset($EXTiS_config);
510 while(list(,$EXTiS_cPart)=each($EXTiS_config)) {
511 if ($EXTiS_cPart['conf']['includeLibs']) {
512 $EXTiS_resourceList = t3lib_div::trimExplode(',',$EXTiS_cPart['conf']['includeLibs'],1);
513 $TT->setTSlogMessage('Files for inclusion: "'.implode(', ',$EXTiS_resourceList).'"');
514 reset($EXTiS_resourceList);
515 while(list(,$EXTiS_theLib) = each($EXTiS_resourceList)) {
516 $EXTiS_incFile = $TSFE->tmpl->getFileName($EXTiS_theLib);
517 if ($EXTiS_incFile) {
518 require_once($EXTiS_incFile);
519 } else {
520 $TT->setTSlogMessage('Include file "'.$EXTiS_theLib.'" did not exist!',2);
521 }
522 }
523 }
524 }
525
526 reset($EXTiS_splitC);
527 while(list($EXTiS_c,$EXTiS_cPart)=each($EXTiS_splitC)) {
528 if (substr($EXTiS_cPart,32,3)=='-->') { // If the split had a comment-end after 32 characters it's probably a split-string
529 $EXTiS_key = 'EXT_SCRIPT.'.substr($EXTiS_cPart,0,32);
530 if (is_array($EXTiS_config[$EXTiS_key])) {
531 $REC = $EXTiS_config[$EXTiS_key]['data'];
532 $CONF = $EXTiS_config[$EXTiS_key]['conf'];
533 $content = '';
534 include($EXTiS_config[$EXTiS_key]['file']);
535 echo $content; // The script MAY return content in $content or the script may just output the result directly!
536 }
537 echo substr($EXTiS_cPart,35);
538 } else {
539 echo ($c?'<!--EXT_SCRIPT.':'').$EXTiS_cPart;
540 }
541 }
542
543 $TT->pull();
544 } else {
545 echo $TSFE->content;
546 }
547 $TT->pull();
548 }
549
550
551 // ********************************
552 // Store session data for fe_users
553 // ********************************
554 $TSFE->storeSessionData();
555
556
557 // ***********
558 // Statistics
559 // ***********
560 $TYPO3_MISC['microtime_end'] = microtime();
561 $TSFE->setParseTime();
562 if ($TSFE->isOutputting() && ($TSFE->TYPO3_CONF_VARS['FE']['debug'] || $TSFE->config['config']['debug'])) {
563 echo '
564 <!-- Parsetime: '.$TSFE->scriptParseTime.' ms-->';
565 }
566 $TSFE->statistics();
567
568
569 // ***************
570 // Check JumpUrl
571 // ***************
572 $TSFE->jumpurl();
573
574
575 // *************
576 // Preview info
577 // *************
578 $TSFE->previewInfo();
579
580
581 // ******************
582 // Publishing static
583 // ******************
584 if (is_object($BE_USER)) {
585 if ($BE_USER->extAdmModuleEnabled('publish') && $BE_USER->extPublishList) {
586 include_once(PATH_tslib.'publish.php');
587 }
588 }
589
590
591 // ******************
592 // Hook for end-of-frontend
593 // ******************
594 $TSFE->hook_eofe();
595
596
597 // ********************
598 // Finish timetracking
599 // ********************
600 $TT->pull();
601
602
603 // ******************
604 // beLoginLinkIPList
605 // ******************
606 echo $TSFE->beLoginLinkIPList();
607
608
609 // *************
610 // Admin panel
611 // *************
612 if (is_object($BE_USER)
613 && $TSFE->beUserLogin
614 && $TSFE->config['config']['admPanel']
615 && $BE_USER->extAdmEnabled
616 // && $BE_USER->extPageReadAccess($TSFE->page) // This is already done, if there is a BE_USER object at this point!
617 && !$BE_USER->extAdminConfig['hide']) {
618 echo $BE_USER->extPrintFeAdminDialog();
619 }
620
621
622 // *************
623 // Debugging Output
624 // *************
625 if(@is_callable(array($error,'debugOutput'))) {
626 $error->debugOutput();
627 }
628 if (TYPO3_DLOG) t3lib_div::devLog('END of FRONTEND session','',0,array('_FLUSH'=>TRUE));
629
630
631 // *************
632 // Compressions
633 // *************
634 if ($TYPO3_CONF_VARS['FE']['compressionLevel']) {
635 new gzip_encode($TYPO3_CONF_VARS['FE']['compressionLevel'], false, $TYPO3_CONF_VARS['FE']['compressionDebugInfo']);
636 }
637
638 ?>