Index: typo3/sysext/cms/tslib/index_ts.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP <+>\n * @package TYPO3\n * @subpackage tslib\n */\n\n// *******************************\n// Checking PHP version\n// *******************************\nif (version_compare(phpversion(), '5.3', '<'))\tdie ('TYPO3 requires PHP 5.3.0 or higher.');\n\n// *******************************\n// Set error reporting\n// *******************************\nerror_reporting(E_ALL & ~(E_STRICT | E_NOTICE | E_DEPRECATED));\n\n\n// ******************\n// Constants defined\n// ******************\n$TYPO3_MISC['microtime_start'] = microtime(TRUE);\ndefine('TYPO3_OS', stristr(PHP_OS,'win')&&!stristr(PHP_OS,'darwin')?'WIN':'');\ndefine('TYPO3_MODE','FE');\n\nif(!defined('PATH_thisScript')) {\n\tdefine('PATH_thisScript', str_replace('//', '/', str_replace('\\\\', '/',\n\t\t(PHP_SAPI == 'fpm-fcgi' || PHP_SAPI == 'cgi' || PHP_SAPI == 'isapi' || PHP_SAPI == 'cgi-fcgi') &&\n\t\t($_SERVER['ORIG_PATH_TRANSLATED'] ? $_SERVER['ORIG_PATH_TRANSLATED'] : $_SERVER['PATH_TRANSLATED']) ?\n\t\t($_SERVER['ORIG_PATH_TRANSLATED'] ? $_SERVER['ORIG_PATH_TRANSLATED'] : $_SERVER['PATH_TRANSLATED']) :\n\t\t($_SERVER['ORIG_SCRIPT_FILENAME'] ? $_SERVER['ORIG_SCRIPT_FILENAME'] : $_SERVER['SCRIPT_FILENAME']))));\n}\n\nif (!defined('PATH_site')) \t\t\tdefine('PATH_site', dirname(PATH_thisScript).'/');\nif (!defined('PATH_t3lib')) \t\tdefine('PATH_t3lib', PATH_site.'t3lib/');\n\ndefine('TYPO3_mainDir', 'typo3/');\t\t// This is the directory of the backend administration for the sites of this TYPO3 installation.\ndefine('PATH_typo3', PATH_site.TYPO3_mainDir);\ndefine('PATH_typo3conf', PATH_site.'typo3conf/');\n\nif (!defined('PATH_tslib')) {\n\tif (@is_dir(PATH_site.TYPO3_mainDir.'sysext/cms/tslib/')) {\n\t\tdefine('PATH_tslib', PATH_site.TYPO3_mainDir.'sysext/cms/tslib/');\n\t} elseif (@is_dir(PATH_site.'tslib/')) {\n\t\tdefine('PATH_tslib', PATH_site.'tslib/');\n\t}\n}\n\nif (!@is_dir(PATH_typo3conf))\tdie('Cannot find configuration. This file is probably executed from the wrong location.');\n\n// *********************\n// Unset variable(s) in global scope (fixes #13959)\n// *********************\nunset($error);\n\n// *********************\n// Prevent any output until AJAX/compression is initialized to stop\n// AJAX/compression data corruption\n// *********************\nob_start();\n\n\n// *********************\n// Mandatory libraries included\n// *********************\nrequire_once(PATH_t3lib . 'class.t3lib_div.php');\nrequire_once(PATH_t3lib . 'class.t3lib_extmgm.php');\n\n\n// **********************\n// Include configuration\n// **********************\nrequire(PATH_t3lib.'config_default.php');\nif (!defined ('TYPO3_db')) \tdie ('The configuration file was not included.');\t// 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.\nif (!t3lib_extMgm::isLoaded('cms'))\tdie('Error: The main frontend extension \"cms\" was not loaded. Enable it in the extension manager in the backend.');\n\nif (!defined('PATH_tslib')) {\n\tdefine('PATH_tslib', t3lib_extMgm::extPath('cms').'tslib/');\n}\n\n\n// *********************\n// Timetracking started\n// *********************\nif ($_COOKIE[t3lib_beUserAuth::getCookieName()]) {\n\trequire_once(PATH_t3lib . 'class.t3lib_timetrack.php');\n\t$TT = new t3lib_timeTrack();\n} else {\n\trequire_once(PATH_t3lib . 'class.t3lib_timetracknull.php');\n\t$TT = new t3lib_timeTrackNull();\n}\n$TT->start();\n$TT->push('', 'Script start');\n\n// *********************\n// Error & Exception handling\n// *********************\nif ($TYPO3_CONF_VARS['SC_OPTIONS']['errors']['exceptionHandler'] !== '') {\n\t$TT->push('Register Exceptionhandler', '');\n\tif ($TYPO3_CONF_VARS['SYS']['errorHandler'] !== '') {\n\t\t\t// register an error handler for the given errorHandlerErrors\n\t\t$errorHandler = t3lib_div::makeInstance($TYPO3_CONF_VARS['SYS']['errorHandler'], $TYPO3_CONF_VARS['SYS']['errorHandlerErrors']);\n\t\t\t// set errors which will be converted in an exception\n\t\t$errorHandler->setExceptionalErrors($TYPO3_CONF_VARS['SC_OPTIONS']['errors']['exceptionalErrors']);\n\t}\n\t$exceptionHandler = t3lib_div::makeInstance($TYPO3_CONF_VARS['SC_OPTIONS']['errors']['exceptionHandler']);\n\t$TT->pull();\n}\n\n$TYPO3_DB = t3lib_div::makeInstance('t3lib_DB');\n$TYPO3_DB->debugOutput = $TYPO3_CONF_VARS['SYS']['sqlDebug'];\n\n$CLIENT = t3lib_div::clientInfo();\t\t\t\t// Set to the browser: net / msie if 4+ browsers\n$TT->pull();\n\n// *******************************\n// Checking environment\n// *******************************\nif (isset($_POST['GLOBALS']) || isset($_GET['GLOBALS'])) {\n\tthrow new Exception('You cannot set the GLOBALS-array from outside the script.', 1294585200);\n}\nif (!get_magic_quotes_gpc())\t{\n\t$TT->push('Add slashes to GET/POST arrays','');\n\tt3lib_div::addSlashesOnArray($_GET);\n\tt3lib_div::addSlashesOnArray($_POST);\n\t$HTTP_GET_VARS = $_GET;\n\t$HTTP_POST_VARS = $_POST;\n\t$TT->pull();\n}\n\n\n// Hook to preprocess the current request:\nif (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'])) {\n\tforeach ($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'] as $hookFunction) {\n\t\t$hookParameters = array();\n\t\tt3lib_div::callUserFunction($hookFunction, $hookParameters, $hookParameters);\n\t}\n\tunset($hookFunction);\n\tunset($hookParameters);\n}\n\n\n// *********************\n// Look for extension ID which will launch alternative output engine\n// *********************\nif ($temp_extId = t3lib_div::_GP('eID'))\t{\n\tif ($classPath = t3lib_div::getFileAbsFileName($TYPO3_CONF_VARS['FE']['eID_include'][$temp_extId]))\t{\n\t\t// Remove any output produced until now\n\t\tob_clean();\n\n\t\trequire($classPath);\n\t}\n\texit;\n}\n\n\n// ***********************************\n// Create $TSFE object (TSFE = TypoScript Front End)\n// Connecting to database\n// ***********************************\n$TSFE = t3lib_div::makeInstance('tslib_fe',\n\t$TYPO3_CONF_VARS,\n\tt3lib_div::_GP('id'),\n\tt3lib_div::_GP('type'),\n\tt3lib_div::_GP('no_cache'),\n\tt3lib_div::_GP('cHash'),\n\tt3lib_div::_GP('jumpurl'),\n\tt3lib_div::_GP('MP'),\n\tt3lib_div::_GP('RDCT')\n);\n/** @var $TSFE tslib_fe */\n\nif($TYPO3_CONF_VARS['FE']['pageUnavailable_force'] &&\n\t!t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'), $TYPO3_CONF_VARS['SYS']['devIPmask'])) {\n\t$TSFE->pageUnavailableAndExit('This page is temporarily unavailable.');\n}\n\n\n$TSFE->connectToDB();\n\n$TSFE->sendRedirect();\n\n\n// *******************\n// Output compression\n// *******************\n// Remove any output produced until now\nob_clean();\nif ($TYPO3_CONF_VARS['FE']['compressionLevel'] && extension_loaded('zlib'))\t{\n\tif (t3lib_utility_Math::canBeInterpretedAsInteger($TYPO3_CONF_VARS['FE']['compressionLevel'])) {\n\t\t// Prevent errors if ini_set() is unavailable (safe mode)\n\t\t@ini_set('zlib.output_compression_level', $TYPO3_CONF_VARS['FE']['compressionLevel']);\n\t}\n\tob_start(array(t3lib_div::makeInstance('tslib_fecompression'), 'compressionOutputHandler'));\n}\n\n// *********\n// FE_USER\n// *********\n$TT->push('Front End user initialized','');\n\t/* @var $TSFE tslib_fe */\n\t$TSFE->initFEuser();\n$TT->pull();\n\n\n// *********\n// BE_USER\n// *********\n/** @var $BE_USER t3lib_tsfeBeUserAuth */\n$BE_USER = $TSFE->initializeBackendUser();\n\n\n// ********************\n// Workspace preview:\n// ********************\n$TSFE->workspacePreviewInit();\n\n\n// *****************************************\n// Process the ID, type and other parameters\n// After this point we have an array, $page in TSFE, which is the page-record of the current page, $id\n// *****************************************\n$TT->push('Process ID','');\n\t\t// Initialize admin panel since simulation settings are required here:\n\tif ($TSFE->isBackendUserLoggedIn()) {\n\t\t$BE_USER->initializeAdminPanel();\n\t}\n\n\t$TSFE->checkAlternativeIdMethods();\n\t$TSFE->clear_preview();\n\t$TSFE->determineId();\n\n\t\t// Now, if there is a backend user logged in and he has NO access to this page, then re-evaluate the id shown!\n\tif ($TSFE->isBackendUserLoggedIn() && (!$BE_USER->extPageReadAccess($TSFE->page) || t3lib_div::_GP('ADMCMD_noBeUser')))\t{\t// t3lib_div::_GP('ADMCMD_noBeUser') is placed here because workspacePreviewInit() might need to know if a backend user is logged in!\n\n\t\t\t// Remove user\n\t\tunset($BE_USER);\n\t\t$TSFE->beUserLogin = 0;\n\n\t\t\t// Re-evaluate the page-id.\n\t\t$TSFE->checkAlternativeIdMethods();\n\t\t$TSFE->clear_preview();\n\t\t$TSFE->determineId();\n\t}\n\t$TSFE->makeCacheHash();\n$TT->pull();\n\n// *****************************************\n// Admin Panel & Frontend editing\n// *****************************************\nif ($TSFE->isBackendUserLoggedIn()) {\n\t\t// if a BE User is present load, the sprite manager for frontend-editing\n\t$spriteManager = t3lib_div::makeInstance('t3lib_SpriteManager', FALSE);\n\t$spriteManager->loadCacheFile();\n\n\t$BE_USER->initializeFrontendEdit();\n \tif ($BE_USER->adminPanel instanceof tslib_AdminPanel) {\n\t\t$LANG = t3lib_div::makeInstance('language');\n\t\t$LANG->init($BE_USER->uc['lang']);\n \t}\n\tif ($BE_USER->frontendEdit instanceof t3lib_frontendedit) {\n\t\t$BE_USER->frontendEdit->initConfigOptions();\n\t}\n}\n\n// *******************************************\n// Get compressed $TCA-Array();\n// After this, we should now have a valid $TCA, though minimized\n// *******************************************\n$TSFE->getCompressedTCarray();\n\n\n// ********************************\n// Starts the template\n// *******************************\n$TT->push('Start Template','');\n\t$TSFE->initTemplate();\n$TT->pull();\n\n\n// ********************************\n// Get from cache\n// *******************************\n$TT->push('Get Page from cache','');\n\t$TSFE->getFromCache();\n$TT->pull();\n\n\n// ******************************************************\n// Get config if not already gotten\n// After this, we should have a valid config-array ready\n// ******************************************************\n$TSFE->getConfigArray();\n\n// ********************************\n// Convert POST data to internal \"renderCharset\" if different from the metaCharset\n// *******************************\n$TSFE->convPOSTCharset();\n\n\n// *******************************************\n// Setting language and locale\n// *******************************************\n$TT->push('Setting language and locale','');\n\t$TSFE->settingLanguage();\n\t$TSFE->settingLocale();\n$TT->pull();\n\n\n// ********************************\n// Check JumpUrl\n// *******************************\n$TSFE->setExternalJumpUrl();\n$TSFE->checkJumpUrlReferer();\n\n\n// ********************************\n// Check Submission of data.\n// This is done at this point, because we need the config values\n// *******************************\nswitch($TSFE->checkDataSubmission())\t{\n\tcase 'email':\n\t\t$TSFE->sendFormmail();\n\tbreak;\n\tcase 'fe_tce':\n\t\t$TSFE->includeTCA();\n\t\t$TT->push('fe_tce','');\n\t\t$TSFE->fe_tce();\n\t\t$TT->pull();\n\tbreak;\n}\n\n\n// *******************************\n// Check for shortcut page and redirect\n// *******************************\n$TSFE->checkPageForShortcutRedirect();\n\n\n// ********************************\n// Generate page\n// *******************************\n$TSFE->setUrlIdToken();\n\n$TT->push('Page generation','');\n\tif ($TSFE->isGeneratePage()) {\n\t\t$TSFE->generatePage_preProcessing();\n\t\t$temp_theScript=$TSFE->generatePage_whichScript();\n\n\t\tif ($temp_theScript) {\n\t\t\tinclude($temp_theScript);\n\t\t} else {\n\t\t\tinclude(PATH_tslib.'pagegen.php');\n\t\t}\n\t\t$TSFE->generatePage_postProcessing();\n\t} elseif ($TSFE->isINTincScript()) {\n\t\tinclude(PATH_tslib.'pagegen.php');\n\t}\n$TT->pull();\n\n\n// ********************************\n// $TSFE->config['INTincScript']\n// *******************************\nif ($TSFE->isINTincScript())\t\t{\n\t$TT->push('Non-cached objects','');\n\t\t$TSFE->INTincScript();\n\t$TT->pull();\n}\n\n// ***************\n// Output content\n// ***************\n$sendTSFEContent = FALSE;\nif ($TSFE->isOutputting())\t{\n\t$TT->push('Print Content','');\n\t$TSFE->processOutput();\n\n\t// ***************************************\n\t// Outputs content / Includes EXT scripts\n\t// ***************************************\n\tif ($TSFE->isEXTincScript())\t{\n\t\t$TT->push('External PHP-script','');\n\t\t\t\t// Important global variables here are $EXTiS_*, they must not be overridden in include-scripts!!!\n\t\t\t$EXTiS_config = $TSFE->config['EXTincScript'];\n\t\t\t$EXTiS_splitC = explode('')\t{\t// If the split had a comment-end after 32 characters it's probably a split-string\n\t\t\t\t\t$EXTiS_key = 'EXT_SCRIPT.'.substr($EXTiS_cPart,0,32);\n\t\t\t\t\tif (is_array($EXTiS_config[$EXTiS_key]))\t{\n\t\t\t\t\t\t$REC = $EXTiS_config[$EXTiS_key]['data'];\n\t\t\t\t\t\t$CONF = $EXTiS_config[$EXTiS_key]['conf'];\n\t\t\t\t\t\t$content = '';\n\t\t\t\t\t\tinclude($EXTiS_config[$EXTiS_key]['file']);\n\t\t\t\t\t\techo $content;\t// The script MAY return content in $content or the script may just output the result directly!\n\t\t\t\t\t}\n\t\t\t\t\techo substr($EXTiS_cPart,35);\n\t\t\t\t} else {\n\t\t\t\t\techo ($c?'';\n}\n$TSFE->statistics();\n\n\n// ***************\n// Check JumpUrl\n// ***************\n$TSFE->jumpurl();\n\n\n// *************\n// Preview info\n// *************\n$TSFE->previewInfo();\n\n\n// ******************\n// Hook for end-of-frontend\n// ******************\n$TSFE->hook_eofe();\n\n\n// ********************\n// Finish timetracking\n// ********************\n$TT->pull();\n\n// ******************\n// Check memory usage\n// ******************\nt3lib_utility_Monitor::peakMemoryUsage();\n\n// ******************\n// beLoginLinkIPList\n// ******************\necho $TSFE->beLoginLinkIPList();\n\n\n// *************\n// Admin panel\n// *************\nif (is_object($BE_USER) && $BE_USER->isAdminPanelVisible() && $TSFE->isBackendUserLoggedIn()) {\n\t$TSFE->content = str_ireplace('', $BE_USER->adminPanel->getAdminPanelHeaderData() . '', $TSFE->content);\n\t$TSFE->content = str_ireplace('', $BE_USER->displayAdminPanel() . '', $TSFE->content);\n}\n\nif ($sendTSFEContent) {\n\techo $TSFE->content;\n}\n\n// *************\n// Debugging Output\n// *************\nif(isset($error) && is_object($error) && @is_callable(array($error,'debugOutput'))) {\n\t$error->debugOutput();\n}\nif (TYPO3_DLOG) {\n\tt3lib_div::devLog('END of FRONTEND session', 'cms', 0, array('_FLUSH' => TRUE));\n}\n\n?> =================================================================== --- typo3/sysext/cms/tslib/index_ts.php (revision 5ef47cd74fdb8a9693618d396080dacb517588b7) +++ typo3/sysext/cms/tslib/index_ts.php (revision ) @@ -503,9 +503,11 @@ // ************* // Admin panel // ************* -if (is_object($BE_USER) && $BE_USER->isAdminPanelVisible() && $TSFE->isBackendUserLoggedIn()) { +if (is_object($BE_USER) && method_exists($BE_USER, 'isAdminPanelVisible')) { + if($BE_USER->isAdminPanelVisible() && $TSFE->beUserLogin) { - $TSFE->content = str_ireplace('', $BE_USER->adminPanel->getAdminPanelHeaderData() . '', $TSFE->content); - $TSFE->content = str_ireplace('', $BE_USER->displayAdminPanel() . '', $TSFE->content); + $TSFE->content = str_ireplace('', $BE_USER->adminPanel->getAdminPanelHeaderData() . '', $TSFE->content); + $TSFE->content = str_ireplace('', $BE_USER->displayAdminPanel() . '', $TSFE->content); + } } if ($sendTSFEContent) { \ No newline at end of file