TYPO3 API  SVNRelease
index_ts.php
Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
00006 *  All rights reserved
00007 *
00008 *  This script is part of the TYPO3 project. The TYPO3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *  A copy is found in the textfile GPL.txt and important notices to the license
00017 *  from the author is found in LICENSE.txt distributed with these scripts.
00018 *
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
00027 /**
00028  * This is the MAIN DOCUMENT of the TypoScript driven standard front-end (from the "cms" extension)
00029  * Basically put this is the "index.php" script which all requests for TYPO3 delivered pages goes to in the frontend (the website)
00030  * 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.
00031  * All the real data processing goes on in the "tslib/" classes which this script will include and use as needed.
00032  *
00033  * $Id: index_ts.php 10369 2011-02-02 08:45:26Z lolli $
00034  * Revised for TYPO3 3.6 June/2003 by Kasper Skårhøj
00035  *
00036  * @author  Kasper Skårhøj <kasperYYYY@typo3.com>
00037  * @package TYPO3
00038  * @subpackage tslib
00039  */
00040 
00041 // *******************************
00042 // Checking PHP version
00043 // *******************************
00044 if (version_compare(phpversion(), '5.2', '<'))  die ('TYPO3 requires PHP 5.2.0 or higher.');
00045 
00046 // *******************************
00047 // Set error reporting
00048 // *******************************
00049 if (defined('E_DEPRECATED')) {
00050     error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
00051 } else {
00052     error_reporting(E_ALL ^ E_NOTICE);
00053 }
00054 
00055 
00056 // ******************
00057 // Constants defined
00058 // ******************
00059 $TYPO3_MISC['microtime_start'] = microtime(true);
00060 define('TYPO3_OS', stristr(PHP_OS,'win')&&!stristr(PHP_OS,'darwin')?'WIN':'');
00061 define('TYPO3_MODE','FE');
00062 
00063 if(!defined('PATH_thisScript')) {
00064     define('PATH_thisScript', str_replace('//', '/', str_replace('\\', '/',
00065         (PHP_SAPI == 'fpm-fcgi' || PHP_SAPI == 'cgi' || PHP_SAPI == 'isapi' || PHP_SAPI == 'cgi-fcgi') &&
00066         ($_SERVER['ORIG_PATH_TRANSLATED'] ? $_SERVER['ORIG_PATH_TRANSLATED'] : $_SERVER['PATH_TRANSLATED']) ?
00067         ($_SERVER['ORIG_PATH_TRANSLATED'] ? $_SERVER['ORIG_PATH_TRANSLATED'] : $_SERVER['PATH_TRANSLATED']) :
00068         ($_SERVER['ORIG_SCRIPT_FILENAME'] ? $_SERVER['ORIG_SCRIPT_FILENAME'] : $_SERVER['SCRIPT_FILENAME']))));
00069 }
00070 
00071 if (!defined('PATH_site'))          define('PATH_site', dirname(PATH_thisScript).'/');
00072 if (!defined('PATH_t3lib'))         define('PATH_t3lib', PATH_site.'t3lib/');
00073 
00074 define('TYPO3_mainDir', 'typo3/');      // This is the directory of the backend administration for the sites of this TYPO3 installation.
00075 define('PATH_typo3', PATH_site.TYPO3_mainDir);
00076 define('PATH_typo3conf', PATH_site.'typo3conf/');
00077 
00078 if (!defined('PATH_tslib')) {
00079     if (@is_dir(PATH_site.TYPO3_mainDir.'sysext/cms/tslib/')) {
00080         define('PATH_tslib', PATH_site.TYPO3_mainDir.'sysext/cms/tslib/');
00081     } elseif (@is_dir(PATH_site.'tslib/')) {
00082         define('PATH_tslib', PATH_site.'tslib/');
00083     }
00084 }
00085 
00086 if (!@is_dir(PATH_typo3conf))   die('Cannot find configuration. This file is probably executed from the wrong location.');
00087 
00088 // *********************
00089 // Unset variable(s) in global scope (fixes #13959)
00090 // *********************
00091 unset($error);
00092 
00093 // *********************
00094 // Prevent any output until AJAX/compression is initialized to stop
00095 // AJAX/compression data corruption
00096 // *********************
00097 ob_start();
00098 
00099 // *********************
00100 // Timetracking started
00101 // *********************
00102 if ($_COOKIE['be_typo_user']) {
00103     require_once(PATH_t3lib.'class.t3lib_timetrack.php');
00104     $TT = new t3lib_timeTrack;
00105 } else {
00106     require_once(PATH_t3lib.'class.t3lib_timetracknull.php');
00107     $TT = new t3lib_timeTrackNull;
00108 }
00109 
00110 $TT->start();
00111 $TT->push('','Script start');
00112 
00113 
00114 // *********************
00115 // Mandatory libraries included
00116 // *********************
00117 $TT->push('Include class t3lib_db, t3lib_div, t3lib_extmgm','');
00118     require_once(PATH_t3lib.'class.t3lib_div.php');
00119     require_once(PATH_t3lib.'class.t3lib_extmgm.php');
00120 $TT->pull();
00121 
00122 
00123 
00124 // **********************
00125 // Include configuration
00126 // **********************
00127 $TT->push('Include config files','');
00128 require(PATH_t3lib.'config_default.php');
00129 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.
00130 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.');
00131 
00132 if (!defined('PATH_tslib')) {
00133     define('PATH_tslib', t3lib_extMgm::extPath('cms').'tslib/');
00134 }
00135 
00136 
00137 
00138 
00139 // *********************
00140 // Error & Exception handling
00141 // *********************
00142 if ($TYPO3_CONF_VARS['SC_OPTIONS']['errors']['exceptionHandler'] !== '') {
00143     $TT->push('Register Exceptionhandler', '');
00144     if ($TYPO3_CONF_VARS['SYS']['errorHandler'] !== '') {
00145             // register an error handler for the given errorHandlerErrors
00146         $errorHandler = t3lib_div::makeInstance($TYPO3_CONF_VARS['SYS']['errorHandler'], $TYPO3_CONF_VARS['SYS']['errorHandlerErrors']);
00147             // set errors which will be converted in an exception
00148         $errorHandler->setExceptionalErrors($TYPO3_CONF_VARS['SC_OPTIONS']['errors']['exceptionalErrors']);
00149     }
00150     $exceptionHandler = t3lib_div::makeInstance($TYPO3_CONF_VARS['SC_OPTIONS']['errors']['exceptionHandler']);
00151     $TT->pull();
00152 }
00153 
00154 $TYPO3_DB = t3lib_div::makeInstance('t3lib_DB');
00155 $TYPO3_DB->debugOutput = $TYPO3_CONF_VARS['SYS']['sqlDebug'];
00156 
00157 $CLIENT = t3lib_div::clientInfo();              // Set to the browser: net / msie if 4+ browsers
00158 $TT->pull();
00159 
00160 
00161 // *******************************
00162 // Checking environment
00163 // *******************************
00164 if (isset($_POST['GLOBALS']) || isset($_GET['GLOBALS']))    die('You cannot set the GLOBALS-array from outside the script.');
00165 if (!get_magic_quotes_gpc())    {
00166     $TT->push('Add slashes to GET/POST arrays','');
00167     t3lib_div::addSlashesOnArray($_GET);
00168     t3lib_div::addSlashesOnArray($_POST);
00169     $HTTP_GET_VARS = $_GET;
00170     $HTTP_POST_VARS = $_POST;
00171     $TT->pull();
00172 }
00173 
00174 
00175 // Hook to preprocess the current request:
00176 if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'])) {
00177     foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'] as $hookFunction) {
00178         $hookParameters = array();
00179         t3lib_div::callUserFunction($hookFunction, $hookParameters, $hookParameters);
00180     }
00181     unset($hookFunction);
00182     unset($hookParameters);
00183 }
00184 
00185 
00186 // *********************
00187 // Look for extension ID which will launch alternative output engine
00188 // *********************
00189 if ($temp_extId = t3lib_div::_GP('eID'))    {
00190     if ($classPath = t3lib_div::getFileAbsFileName($TYPO3_CONF_VARS['FE']['eID_include'][$temp_extId])) {
00191         // Remove any output produced until now
00192         ob_clean();
00193 
00194         require($classPath);
00195     }
00196     exit;
00197 }
00198 
00199 
00200 // ***********************************
00201 // Create $TSFE object (TSFE = TypoScript Front End)
00202 // Connecting to database
00203 // ***********************************
00204 $TSFE = t3lib_div::makeInstance('tslib_fe',
00205     $TYPO3_CONF_VARS,
00206     t3lib_div::_GP('id'),
00207     t3lib_div::_GP('type'),
00208     t3lib_div::_GP('no_cache'),
00209     t3lib_div::_GP('cHash'),
00210     t3lib_div::_GP('jumpurl'),
00211     t3lib_div::_GP('MP'),
00212     t3lib_div::_GP('RDCT')
00213 );
00214 /** @var $TSFE tslib_fe */
00215 
00216 if($TYPO3_CONF_VARS['FE']['pageUnavailable_force'] &&
00217     !t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'), $TYPO3_CONF_VARS['SYS']['devIPmask'])) {
00218     $TSFE->pageUnavailableAndExit('This page is temporarily unavailable.');
00219 }
00220 
00221 
00222 $TSFE->connectToDB();
00223 
00224     // In case of a keyword-authenticated preview, re-initialize the TSFE object:
00225 if ($temp_previewConfig = $TSFE->ADMCMD_preview())  {
00226     $TSFE = t3lib_div::makeInstance('tslib_fe',
00227         $TYPO3_CONF_VARS,
00228         t3lib_div::_GP('id'),
00229         t3lib_div::_GP('type'),
00230         t3lib_div::_GP('no_cache'),
00231         t3lib_div::_GP('cHash'),
00232         t3lib_div::_GP('jumpurl'),
00233         t3lib_div::_GP('MP'),
00234         t3lib_div::_GP('RDCT')
00235     );
00236     $TSFE->ADMCMD_preview_postInit($temp_previewConfig);
00237 }
00238 
00239 if ($TSFE->RDCT)    {$TSFE->sendRedirect();}
00240 
00241 
00242 // *******************
00243 // Output compression
00244 // *******************
00245 // Remove any output produced until now
00246 ob_clean();
00247 if ($TYPO3_CONF_VARS['FE']['compressionLevel'] && extension_loaded('zlib')) {
00248     if (t3lib_div::testInt($TYPO3_CONF_VARS['FE']['compressionLevel'])) {
00249         // Prevent errors if ini_set() is unavailable (safe mode)
00250         @ini_set('zlib.output_compression_level', $TYPO3_CONF_VARS['FE']['compressionLevel']);
00251     }
00252     ob_start(array(t3lib_div::makeInstance('tslib_fecompression'), 'compressionOutputHandler'));
00253 }
00254 
00255 // *********
00256 // FE_USER
00257 // *********
00258 $TT->push('Front End user initialized','');
00259     /* @var $TSFE tslib_fe */
00260     $TSFE->initFEuser();
00261 $TT->pull();
00262 
00263 // ****************
00264 // PRE BE_USER HOOK
00265 // ****************
00266 if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/index_ts.php']['preBeUser'])) {
00267     foreach($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/index_ts.php']['preBeUser'] as $_funcRef) {
00268         $_params = array();
00269         t3lib_div::callUserFunction($_funcRef, $_params , $_params);
00270     }
00271 }
00272 
00273 
00274 // *********
00275 // BE_USER
00276 // *********
00277 $BE_USER = NULL;
00278 /** @var $BE_USER t3lib_tsfeBeUserAuth */
00279 if ($_COOKIE['be_typo_user']) {     // If the backend cookie is set, we proceed and checks if a backend user is logged in.
00280     $TYPO3_MISC['microtime_BE_USER_start'] = microtime(true);
00281     $TT->push('Back End user initialized','');
00282 
00283             // the value this->formfield_status is set to empty in order to disable login-attempts to the backend account through this script
00284         $BE_USER = t3lib_div::makeInstance('t3lib_tsfeBeUserAuth'); // New backend user object
00285         $BE_USER->OS = TYPO3_OS;
00286         $BE_USER->lockIP = $TYPO3_CONF_VARS['BE']['lockIP'];
00287         $BE_USER->start();          // Object is initialized
00288         $BE_USER->unpack_uc('');
00289         if ($BE_USER->user['uid'])  {
00290             $BE_USER->fetchGroupData();
00291             $TSFE->beUserLogin = 1;
00292         }
00293             // Unset the user initialization.
00294         if (!$BE_USER->checkLockToIP() || !$BE_USER->checkBackendAccessSettingsFromInitPhp() || !$BE_USER->user['uid']) {
00295             $BE_USER = NULL;
00296             $TSFE->beUserLogin=0;
00297         }
00298     $TT->pull();
00299     $TYPO3_MISC['microtime_BE_USER_end'] = microtime(true);
00300 } elseif ($TSFE->ADMCMD_preview_BEUSER_uid) {
00301 
00302         // the value this->formfield_status is set to empty in order to disable login-attempts to the backend account through this script
00303     $BE_USER = t3lib_div::makeInstance('t3lib_tsfeBeUserAuth'); // New backend user object
00304     $BE_USER->userTS_dontGetCached = 1;
00305     $BE_USER->OS = TYPO3_OS;
00306     $BE_USER->setBeUserByUid($TSFE->ADMCMD_preview_BEUSER_uid);
00307     $BE_USER->unpack_uc('');
00308     if ($BE_USER->user['uid'])  {
00309         $BE_USER->fetchGroupData();
00310         $TSFE->beUserLogin = 1;
00311     } else {
00312         $BE_USER = NULL;
00313         $TSFE->beUserLogin = 0;
00314     }
00315 }
00316 
00317 // ********************
00318 // Workspace preview:
00319 // ********************
00320 $TSFE->workspacePreviewInit();
00321 
00322 
00323 // *****************************************
00324 // Process the ID, type and other parameters
00325 // After this point we have an array, $page in TSFE, which is the page-record of the current page, $id
00326 // *****************************************
00327 $TT->push('Process ID','');
00328         // Initialize admin panel since simulation settings are required here:
00329     if ($TSFE->beUserLogin) {
00330         $BE_USER->initializeAdminPanel();
00331     }
00332 
00333     $TSFE->checkAlternativeIdMethods();
00334     $TSFE->clear_preview();
00335     $TSFE->determineId();
00336 
00337         // Now, if there is a backend user logged in and he has NO access to this page, then re-evaluate the id shown!
00338     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!
00339 
00340             // Remove user
00341         unset($BE_USER);
00342         $TSFE->beUserLogin = 0;
00343 
00344             // Re-evaluate the page-id.
00345         $TSFE->checkAlternativeIdMethods();
00346         $TSFE->clear_preview();
00347         $TSFE->determineId();
00348     }
00349     $TSFE->makeCacheHash();
00350 $TT->pull();
00351 
00352 // *****************************************
00353 // Admin Panel & Frontend editing
00354 // *****************************************
00355 if ($TSFE->beUserLogin) {
00356         // if a BE User is present load, the sprite manager for frontend-editing
00357     $spriteManager = t3lib_div::makeInstance('t3lib_SpriteManager', FALSE);
00358     $spriteManager->loadCacheFile();
00359 
00360     $BE_USER->initializeFrontendEdit();
00361     if ($BE_USER->adminPanel instanceof tslib_AdminPanel) {
00362         $LANG = t3lib_div::makeInstance('language');
00363         $LANG->init($BE_USER->uc['lang']);
00364     }
00365     if ($BE_USER->frontendEdit instanceof t3lib_frontendedit) {
00366         $BE_USER->frontendEdit->initConfigOptions();
00367     }
00368 }
00369 
00370 // *******************************************
00371 // Get compressed $TCA-Array();
00372 // After this, we should now have a valid $TCA, though minimized
00373 // *******************************************
00374 $TSFE->getCompressedTCarray();
00375 
00376 
00377 // ********************************
00378 // Starts the template
00379 // *******************************
00380 $TT->push('Start Template','');
00381     $TSFE->initTemplate();
00382 $TT->pull();
00383 
00384 
00385 // ********************************
00386 // Get from cache
00387 // *******************************
00388 $TT->push('Get Page from cache','');
00389     $TSFE->getFromCache();
00390 $TT->pull();
00391 
00392 
00393 // ******************************************************
00394 // Get config if not already gotten
00395 // After this, we should have a valid config-array ready
00396 // ******************************************************
00397 $TSFE->getConfigArray();
00398 
00399 // ********************************
00400 // Convert POST data to internal "renderCharset" if different from the metaCharset
00401 // *******************************
00402 $TSFE->convPOSTCharset();
00403 
00404 
00405 // *******************************************
00406 // Setting language and locale
00407 // *******************************************
00408 $TT->push('Setting language and locale','');
00409     $TSFE->settingLanguage();
00410     $TSFE->settingLocale();
00411 $TT->pull();
00412 
00413 
00414 // ********************************
00415 // Check JumpUrl
00416 // *******************************
00417 $TSFE->setExternalJumpUrl();
00418 $TSFE->checkJumpUrlReferer();
00419 
00420 
00421 // ********************************
00422 // Check Submission of data.
00423 // This is done at this point, because we need the config values
00424 // *******************************
00425 switch($TSFE->checkDataSubmission())    {
00426     case 'email':
00427         $TSFE->sendFormmail();
00428     break;
00429     case 'fe_tce':
00430         $TSFE->includeTCA();
00431         $TT->push('fe_tce','');
00432         $TSFE->fe_tce();
00433         $TT->pull();
00434     break;
00435 }
00436 
00437 
00438 // ********************************
00439 // Generate page
00440 // *******************************
00441 $TSFE->setUrlIdToken();
00442 
00443 $TT->push('Page generation','');
00444     if ($TSFE->isGeneratePage()) {
00445         $TSFE->generatePage_preProcessing();
00446         $temp_theScript=$TSFE->generatePage_whichScript();
00447 
00448         if ($temp_theScript) {
00449             include($temp_theScript);
00450         } else {
00451             include(PATH_tslib.'pagegen.php');
00452         }
00453         $TSFE->generatePage_postProcessing();
00454     } elseif ($TSFE->isINTincScript()) {
00455         include(PATH_tslib.'pagegen.php');
00456     }
00457 $TT->pull();
00458 
00459 
00460 // ********************************
00461 // $TSFE->config['INTincScript']
00462 // *******************************
00463 if ($TSFE->isINTincScript())        {
00464     $TT->push('Non-cached objects','');
00465         $TSFE->INTincScript();
00466     $TT->pull();
00467 }
00468 
00469 // ***************
00470 // Output content
00471 // ***************
00472 $sendTSFEContent = false;
00473 if ($TSFE->isOutputting())  {
00474     $TT->push('Print Content','');
00475     $TSFE->processOutput();
00476 
00477     // ***************************************
00478     // Outputs content / Includes EXT scripts
00479     // ***************************************
00480     if ($TSFE->isEXTincScript())    {
00481         $TT->push('External PHP-script','');
00482                 // Important global variables here are $EXTiS_*, they must not be overridden in include-scripts!!!
00483             $EXTiS_config = $TSFE->config['EXTincScript'];
00484             $EXTiS_splitC = explode('<!--EXT_SCRIPT.',$TSFE->content);  // Splits content with the key
00485 
00486                 // Special feature: Include libraries
00487             foreach ($EXTiS_config as $EXTiS_cPart) {
00488                 if (isset($EXTiS_cPart['conf']['includeLibs']) && $EXTiS_cPart['conf']['includeLibs']) {
00489                     $EXTiS_resourceList = t3lib_div::trimExplode(',',$EXTiS_cPart['conf']['includeLibs'], true);
00490                     $TSFE->includeLibraries($EXTiS_resourceList);
00491                 }
00492             }
00493 
00494             foreach ($EXTiS_splitC as $EXTiS_c => $EXTiS_cPart) {
00495                 if (substr($EXTiS_cPart,32,3)=='-->')   {   // If the split had a comment-end after 32 characters it's probably a split-string
00496                     $EXTiS_key = 'EXT_SCRIPT.'.substr($EXTiS_cPart,0,32);
00497                     if (is_array($EXTiS_config[$EXTiS_key]))    {
00498                         $REC = $EXTiS_config[$EXTiS_key]['data'];
00499                         $CONF = $EXTiS_config[$EXTiS_key]['conf'];
00500                         $content = '';
00501                         include($EXTiS_config[$EXTiS_key]['file']);
00502                         echo $content;  // The script MAY return content in $content or the script may just output the result directly!
00503                     }
00504                     echo substr($EXTiS_cPart,35);
00505                 } else {
00506                     echo ($c?'<!--EXT_SCRIPT.':'').$EXTiS_cPart;
00507                 }
00508             }
00509 
00510         $TT->pull();
00511     } else {
00512         $sendTSFEContent = true;
00513     }
00514     $TT->pull();
00515 }
00516 
00517 
00518 // ********************************
00519 // Store session data for fe_users
00520 // ********************************
00521 $TSFE->storeSessionData();
00522 
00523 
00524 // ***********
00525 // Statistics
00526 // ***********
00527 $TYPO3_MISC['microtime_end'] = microtime(true);
00528 $TSFE->setParseTime();
00529 if ($TSFE->isOutputting() && (!empty($TSFE->TYPO3_CONF_VARS['FE']['debug']) || !empty($TSFE->config['config']['debug']))) {
00530     $TSFE->content .=  LF . '<!-- Parsetime: ' . $TSFE->scriptParseTime . 'ms -->';
00531 }
00532 $TSFE->statistics();
00533 
00534 
00535 // ***************
00536 // Check JumpUrl
00537 // ***************
00538 $TSFE->jumpurl();
00539 
00540 
00541 // *************
00542 // Preview info
00543 // *************
00544 $TSFE->previewInfo();
00545 
00546 
00547 // ******************
00548 // Publishing static
00549 // ******************
00550 if (is_object($BE_USER) && ($BE_USER->adminPanel instanceof tslib_AdminPanel)) {
00551     if ($BE_USER->adminPanel->isAdminModuleEnabled('publish') && $BE_USER->adminPanel->getExtPublishList()) {
00552         include_once(PATH_tslib.'publish.php');
00553     }
00554 }
00555 
00556 
00557 // ******************
00558 // Hook for end-of-frontend
00559 // ******************
00560 $TSFE->hook_eofe();
00561 
00562 
00563 // ********************
00564 // Finish timetracking
00565 // ********************
00566 $TT->pull();
00567 
00568 
00569 // ******************
00570 // beLoginLinkIPList
00571 // ******************
00572 echo $TSFE->beLoginLinkIPList();
00573 
00574 
00575 // *************
00576 // Admin panel
00577 // *************
00578 if (is_object($BE_USER) && $BE_USER->isAdminPanelVisible() && $TSFE->beUserLogin) {
00579     $TSFE->content = str_ireplace('</head>',  $BE_USER->adminPanel->getAdminPanelHeaderData() . '</head>', $TSFE->content);
00580     $TSFE->content = str_ireplace('</body>',  $BE_USER->displayAdminPanel() . '</body>', $TSFE->content);
00581 }
00582 
00583 if ($sendTSFEContent) {
00584     echo $TSFE->content;
00585 }
00586 
00587 // *************
00588 // Debugging Output
00589 // *************
00590 if(isset($error) && is_object($error) && @is_callable(array($error,'debugOutput'))) {
00591     $error->debugOutput();
00592 }
00593 if (TYPO3_DLOG) {
00594     t3lib_div::devLog('END of FRONTEND session', 'cms', 0, array('_FLUSH' => TRUE));
00595 }
00596 
00597 ?>