00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00192 class tslib_fe {
00193
00194
00195 var $id='';
00196 var $type='';
00197 var $idParts=array();
00198 var $cHash='';
00199 var $no_cache='';
00200 var $rootLine='';
00201 var $page='';
00202 var $contentPid=0;
00203 var $sys_page='';
00204 var $jumpurl='';
00205 var $pageNotFound=0;
00206 var $domainStartPage=0;
00207 var $MP='';
00208 var $RDCT='';
00209 var $page_cache_reg1=0;
00210 var $siteScript='';
00211
00212
00213 var $fe_user='';
00214 var $loginUser='';
00215 var $gr_list='';
00216 var $beUserLogin='';
00217
00218
00219 var $fePreview='';
00220 var $showHiddenPage='';
00221 var $showHiddenRecords='';
00222 var $simUserGroup='0';
00223 var $versionPreviewMap=array();
00224
00225
00226 var $TYPO3_CONF_VARS=array();
00227 var $config='';
00228 var $TCAcachedExtras=array();
00229
00230
00231 var $tmpl='';
00232 var $cacheTimeOutDefault='';
00233 var $cacheContentFlag='';
00234 var $all='';
00235 var $sPre='';
00236 var $pSetup='';
00237 var $newHash='';
00238 var $getMethodUrlIdToken='';
00239 var $noCacheBeforePageGen='';
00240 var $tempContent='';
00241 var $forceTemplateParsing='';
00242 var $cHash_array=array();
00243 var $hash_base='';
00244 var $pagesTSconfig='';
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255 var $defaultBodyTag='<body bgcolor="#FFFFFF">';
00256 var $additionalHeaderData=array();
00257 var $additionalJavaScript=array();
00258 var $additionalCSS=array();
00259 var $JSeventFuncCalls = array(
00260 'onmousemove' => array(),
00261 'onmouseup' => array(),
00262 'onload' => array(),
00263 );
00264 var $JSCode='';
00265 var $JSImgCode='';
00266 var $divSection='';
00267
00268
00269 var $debug='';
00270 var $intTarget='';
00271 var $extTarget='';
00272 var $MP_defaults=array();
00273 var $spamProtectEmailAddresses=0;
00274 var $absRefPrefix='';
00275 var $absRefPrefix_force=0;
00276 var $compensateFieldWidth='';
00277 var $lockFilePath='';
00278 var $ATagParams='';
00279 var $sWordRegEx='';
00280 var $sWordList='';
00281 var $linkVars='';
00282 var $excludeCHashVars='';
00283 var $displayEditIcons='';
00284 var $displayFieldEditIcons='';
00285 var $sys_language_uid=0;
00286 var $sys_language_mode='';
00287 var $sys_language_content=0;
00288 var $sys_language_contentOL=0;
00289 var $sys_language_isocode = '';
00290
00291
00292 var $applicationData=Array();
00293 var $register=Array();
00294 var $registerStack=Array();
00295 var $cObjectDepthCounter = 50;
00296 var $recordRegister = Array();
00297 var $currentRecord = '';
00298 var $accessKey =array();
00299 var $imagesOnPage=array();
00300 var $lastImageInfo=array();
00301 var $uniqueCounter=0;
00302 var $uniqueString='';
00303 var $indexedDocTitle='';
00304 var $altPageTitle='';
00305 var $pEncAllowedParamNames=array();
00306 var $baseUrl='';
00307 var $anchorPrefix='';
00308
00309
00310 var $cObj ='';
00311
00312
00313 var $content='';
00314
00315
00316 var $clientInfo='';
00317 var $scriptParseTime=0;
00318 var $TCAloaded = 0;
00319
00320
00321 var $csConvObj;
00322 var $defaultCharSet = 'iso-8859-1';
00323 var $renderCharset='';
00324 var $metaCharset='';
00325 var $localeCharset='';
00326
00327
00328 var $lang='';
00329 var $langSplitIndex=0;
00330 var $labelsCharset='';
00331 var $convCharsetToFrom='';
00332 var $LL_labels_cache=array();
00333 var $LL_files_cache=array();
00334
00335
00336
00337
00338
00356 function tslib_fe($TYPO3_CONF_VARS, $id, $type, $no_cache='', $cHash='', $jumpurl='',$MP='',$RDCT='') {
00357
00358
00359 $this->TYPO3_CONF_VARS = $TYPO3_CONF_VARS;
00360 $this->id = $id;
00361 $this->type = $type;
00362 $this->no_cache = $no_cache ? 1 : 0;
00363 $this->cHash = $cHash;
00364 $this->jumpurl = $jumpurl;
00365 $this->MP = $this->TYPO3_CONF_VARS['FE']['enable_mount_pids'] ? $MP : '';
00366 $this->RDCT = $RDCT;
00367 $this->clientInfo = t3lib_div::clientInfo();
00368 $this->uniqueString=md5(microtime());
00369
00370 $this->csConvObj = t3lib_div::makeInstance('t3lib_cs');
00371
00372
00373 if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['tslib_fe-PostProc'])) {
00374 $_params = array('pObj' => &$this);
00375 foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['tslib_fe-PostProc'] as $_funcRef) {
00376 t3lib_div::callUserFunction($_funcRef,$_params,$this);
00377 }
00378 }
00379 }
00380
00387 function connectToMySQL() {
00388 if ($GLOBALS['TYPO3_DB']->sql_pconnect(TYPO3_db_host, TYPO3_db_username, TYPO3_db_password)) {
00389 if (!TYPO3_db) {
00390 $this->printError('No database selected','Database Error');
00391
00392 echo '<script type="text/javascript">
00393
00394 document.location = "'.TYPO3_mainDir.'install/index.php?mode=123&step=1&password=joh316";
00395
00396 </script>';
00397 exit;
00398 } elseif (!$GLOBALS['TYPO3_DB']->sql_select_db(TYPO3_db)) {
00399 $this->printError('Cannot connect to the current database, "'.TYPO3_db.'"','Database Error');
00400 exit;
00401 }
00402 } else {
00403 if (!TYPO3_db) {
00404
00405 echo '<script type="text/javascript">
00406
00407 document.location = "'.TYPO3_mainDir.'install/index.php?mode=123&step=1&password=joh316";
00408
00409 </script>';
00410 exit;
00411 }
00412 $this->printError('The current username, password or host was not accepted when the connection to the database was attempted to be established!','Database Error');
00413 exit;
00414 }
00415 }
00416
00423 function sendRedirect() {
00424 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('params', 'cache_md5params', 'md5hash="'.$GLOBALS['TYPO3_DB']->quoteStr($this->RDCT, 'cache_md5params').'"');
00425 if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
00426 $this->updateMD5paramsRecord($this->RDCT);
00427 header('Location: '.$row['params']);
00428 exit;
00429 }
00430 }
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00461 function initFEuser() {
00462 $this->fe_user = t3lib_div::makeInstance('tslib_feUserAuth');
00463
00464 $this->fe_user->lockIP = $this->TYPO3_CONF_VARS['FE']['lockIP'];
00465 $this->fe_user->lockHashKeyWords = $this->TYPO3_CONF_VARS['FE']['lockHashKeyWords'];
00466 $this->fe_user->checkPid = $this->TYPO3_CONF_VARS['FE']['checkFeUserPid'];
00467 $this->fe_user->checkPid_value = $GLOBALS['TYPO3_DB']->cleanIntList(t3lib_div::_GP('pid'));
00468
00469
00470 if (t3lib_div::_GP('FE_SESSION_KEY')) {
00471 $fe_sParts = explode('-',t3lib_div::_GP('FE_SESSION_KEY'));
00472 if (!strcmp(md5($fe_sParts[0].'/'.$this->TYPO3_CONF_VARS['SYS']['encryptionKey']), $fe_sParts[1])) {
00473 $_COOKIE[$this->fe_user->name]=$fe_sParts[0];
00474 $this->fe_user->forceSetCookie=1;
00475 }
00476 }
00477
00478 if ($this->TYPO3_CONF_VARS['FE']['dontSetCookie']) {
00479 $this->fe_user->dontSetCookie=1;
00480 }
00481
00482 $this->fe_user->start();
00483 $this->fe_user->unpack_uc('');
00484 $this->fe_user->fetchSessionData();
00485 $recs = t3lib_div::_GP('recs');
00486 if (is_array($recs)) {
00487 $this->fe_user->record_registration($recs);
00488 }
00489
00490
00491 if (is_array($this->fe_user->user) && $this->fe_user->user['is_online']<($GLOBALS['EXEC_TIME']-60)) {
00492 $GLOBALS['TYPO3_DB']->exec_UPDATEquery('fe_users', 'uid='.intval($this->fe_user->user['uid']), array('is_online' => $GLOBALS['EXEC_TIME']));
00493 }
00494 }
00495
00501 function initUserGroups() {
00502
00503 $this->fe_user->showHiddenRecords = $this->showHiddenRecords;
00504
00505 $this->fe_user->fetchGroupData();
00506 if (is_array($this->fe_user->user) && count($this->fe_user->groupData['uid'])) {
00507 $this->loginUser=1;
00508 $this->gr_list = '0,-2';
00509 $gr_array = $this->fe_user->groupData['uid'];
00510 } else {
00511 $this->loginUser=0;
00512 $this->gr_list = '0,-1';
00513 $gr_array = $this->fe_user->groupData['uid'];
00514 }
00515
00516
00517
00518
00519 $gr_array = array_unique($gr_array);
00520 sort($gr_array);
00521 if (count($gr_array)) {
00522 $this->gr_list.=','.implode(',',$gr_array);
00523 }
00524
00525 if ($this->fe_user->writeDevLog) t3lib_div::devLog('Valid usergroups for TSFE: '.$this->gr_list, 'tslib_fe');
00526 }
00527
00528
00549 function checkAlternativeIdMethods() {
00550
00551 $this->siteScript = t3lib_div::getIndpEnv('TYPO3_SITE_SCRIPT');
00552
00553
00554 if ($this->siteScript && substr($this->siteScript,0,9)!='index.php') {
00555 $uParts = parse_url($this->siteScript);
00556 $fI = t3lib_div::split_fileref($uParts['path']);
00557
00558 if (!$fI['path'] && $fI['file'] && substr($fI['file'],-5)=='.html') {
00559 $parts = explode('.',$fI['file']);
00560 $pCount = count($parts);
00561 if ($pCount>2) {
00562 $this->type = intval($parts[$pCount-2]);
00563 $this->id = $parts[$pCount-3];
00564 } else {
00565 $this->type = 0;
00566 $this->id = $parts[0];
00567 }
00568 }
00569 }
00570
00571
00572 if (t3lib_div::getIndpEnv('PATH_INFO')) {
00573 $parts=t3lib_div::trimExplode('/',t3lib_div::getIndpEnv('PATH_INFO'),1);
00574 $parts[]='html';
00575 $pCount = count($parts);
00576 if ($pCount>2) {
00577 $this->type = intval($parts[$pCount-2]);
00578 $this->id = $parts[$pCount-3];
00579 } else {
00580 $this->type = 0;
00581 $this->id = $parts[0];
00582 }
00583 $this->absRefPrefix_force=1;
00584 }
00585
00586
00587 if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkAlternativeIdMethods-PostProc'])) {
00588 $_params = array('pObj' => &$this);
00589 foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkAlternativeIdMethods-PostProc'] as $_funcRef) {
00590 t3lib_div::callUserFunction($_funcRef,$_params,$this);
00591 }
00592 }
00593 }
00594
00601 function clear_preview() {
00602 $this->showHiddenPage = 0;
00603 $this->showHiddenRecords = 0;
00604 $GLOBALS['SIM_EXEC_TIME'] = $GLOBALS['EXEC_TIME'];
00605 $this->fePreview = 0;
00606 }
00607
00614 function determineId() {
00615
00616
00617 $this->setIDfromArgV();
00618
00619
00620 $GLOBALS['TT']->push('beUserLogin','');
00621 if ($this->beUserLogin) {
00622 $this->fePreview = $GLOBALS['BE_USER']->extGetFeAdminValue('preview');
00623
00624
00625 if ($this->fePreview) {
00626 $fe_user_OLD_USERGROUP = $this->fe_user->user['usergroup'];
00627
00628 $this->showHiddenPage = $GLOBALS['BE_USER']->extGetFeAdminValue('preview','showHiddenPages');
00629 $this->showHiddenRecords = $GLOBALS['BE_USER']->extGetFeAdminValue('preview','showHiddenRecords');
00630
00631 $simTime = $GLOBALS['BE_USER']->extGetFeAdminValue('preview','simulateDate');
00632 if ($simTime) $GLOBALS['SIM_EXEC_TIME']=$simTime;
00633
00634 $simUserGroup = $GLOBALS['BE_USER']->extGetFeAdminValue('preview','simulateUserGroup');
00635 $this->simUserGroup = $simUserGroup;
00636 if ($simUserGroup) $this->fe_user->user['usergroup']=$simUserGroup;
00637 if (!$simUserGroup && !$simTime && !$this->showHiddenPage && !$this->showHiddenRecords) {
00638 $this->fePreview=0;
00639 }
00640 }
00641
00642
00643
00644 if ($this->id) {
00645 $idQ = t3lib_div::testInt($this->id) ? 'uid="'.intval($this->id).'"' : 'alias="'.$GLOBALS['TYPO3_DB']->quoteStr($this->id, 'pages').'" AND pid>=0';
00646 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('hidden', 'pages', $idQ.' AND hidden AND NOT deleted');
00647 if ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
00648 $this->fePreview = 1;
00649 $this->showHiddenPage = 1;
00650 }
00651
00652
00653 if (!$this->fePreview) {
00654
00655
00656 $temp_sys_page = t3lib_div::makeInstance('t3lib_pageSelect');
00657 $temp_sys_page->init($this->showHiddenPage);
00658
00659
00660 if (!count($temp_sys_page->getRootLine($this->id,$this->MP)) && $temp_sys_page->error_getRootLine_failPid==-1) {
00661
00662
00663 $temp_sys_page->versioningPreview = TRUE;
00664 if (count($temp_sys_page->getRootLine($this->id,$this->MP))) {
00665
00666 $this->fePreview = 1;
00667 #debug('version in rootline...');
00668 }
00669 }
00670 }
00671 }
00672
00673
00674 if (is_array(t3lib_div::_GP('ADMCMD_vPrev'))) {
00675 $this->fePreview = 1;
00676 $this->versionPreviewMap = t3lib_div::_GP('ADMCMD_vPrev');
00677 }
00678
00679 if ($this->fePreview) {
00680 $this->set_no_cache();
00681 }
00682 }
00683 $GLOBALS['TT']->pull();
00684
00685
00686 $this->fetch_the_id();
00687
00688
00689 if ($this->beUserLogin && $this->fePreview) {
00690 if (!$GLOBALS['BE_USER']->doesUserHaveAccess($this->page,1)) {
00691
00692 $this->clear_preview();
00693 $this->fe_user->user['usergroup'] = $fe_user_OLD_USERGROUP;
00694
00695 $this->fetch_the_id();
00696 }
00697 }
00698
00699 $this->id = $this->contentPid = intval($this->id);
00700 $this->type = intval($this->type);
00701
00702
00703
00704 if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['determineId-PostProc'])) {
00705 $_params = array('pObj' => &$this);
00706 foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['determineId-PostProc'] as $_funcRef) {
00707 t3lib_div::callUserFunction($_funcRef,$_params,$this);
00708 }
00709 }
00710 }
00711
00720 function fetch_the_id() {
00721 $GLOBALS['TT']->push('fetch_the_id initialize/','');
00722
00723
00724 $this->sys_page = t3lib_div::makeInstance('t3lib_pageSelect');
00725 $this->sys_page->init($this->showHiddenPage);
00726 $this->sys_page->versioningPreview = $this->fePreview ? TRUE : FALSE;
00727 if ($this->sys_page->versioningPreview) {
00728 $this->sys_page->versionPreviewMap = $this->versionPreviewMap;
00729 #debug($this->sys_page->versionPreviewMap);
00730 }
00731
00732
00733 $this->initUserGroups();
00734
00735
00736 $this->setSysPageWhereClause();
00737
00738
00739 $pParts = explode('.',$this->id);
00740 $this->id = $pParts[0];
00741 if (isset($pParts[1])) {$this->type=$pParts[1];}
00742
00743
00744 $this->idParts = explode(',',$this->id);
00745
00746
00747 list($pgID,$SSD_p)=explode('+',$this->idParts[0],2);
00748 if ($SSD_p) { $this->idPartsAnalyze($SSD_p); }
00749 $this->id = $pgID;
00750
00751
00752 $this->checkAndSetAlias();
00753
00754
00755 $this->id = intval($this->id);
00756 $this->type = intval($this->type);
00757 $GLOBALS['TT']->pull();
00758
00759
00760 $GLOBALS['TT']->push('fetch_the_id domain/','');
00761 $this->domainStartPage = $this->findDomainRecord($this->TYPO3_CONF_VARS['SYS']['recursiveDomainSearch']);
00762 if (!$this->id) {
00763 if ($this->domainStartPage) {
00764 $this->id = $this->domainStartPage;
00765 } else {
00766 $theFirstPage = $this->sys_page->getFirstWebPage($this->id);
00767 if ($theFirstPage) {
00768 $this->id = $theFirstPage['uid'];
00769 } else {
00770 $this->printError('No pages are found on the rootlevel!');
00771 exit;
00772 }
00773 }
00774 }
00775 $GLOBALS['TT']->pull();
00776
00777 $GLOBALS['TT']->push('fetch_the_id rootLine/','');
00778 $requestedId = $this->id;
00779 $this->getPageAndRootlineWithDomain($this->domainStartPage);
00780 $GLOBALS['TT']->pull();
00781
00782 if ($this->pageNotFound && $this->TYPO3_CONF_VARS['FE']['pageNotFound_handling']) {
00783 $pNotFoundMsg = array(
00784 1 => 'ID was not an accessible page',
00785 2 => 'Subsection was found and not accessible',
00786 3 => 'ID was outside the domain',
00787 );
00788 $this->pageNotFoundAndExit($pNotFoundMsg[$this->pageNotFound]);
00789 }
00790
00791
00792 if ($this->page['no_cache']) {
00793 $this->set_no_cache();
00794 }
00795
00796 $this->register['SYS_LASTCHANGED'] = intval($this->page['tstamp']);
00797 }
00798
00812 function getPageAndRootline() {
00813 $this->page = $this->sys_page->getPage($this->id);
00814 if (!count($this->page)) {
00815
00816 $this->pageNotFound=1;
00817 $this->rootLine = $this->sys_page->getRootLine($this->id,$this->MP);
00818 if (count($this->rootLine)) {
00819 $c=count($this->rootLine)-1;
00820 while($c>0) {
00821 $c--;
00822 $this->id=$this->rootLine[$c]['uid'];
00823 $this->page = $this->sys_page->getPage($this->id);
00824 if (count($this->page)){break;}
00825 }
00826 }
00827
00828 if (!count($this->page)) {
00829 if ($this->TYPO3_CONF_VARS['FE']['pageNotFound_handling']) {
00830 $this->pageNotFoundAndExit('The requested page does not exist!');
00831 } else {
00832 $this->printError('The requested page does not exist!');
00833 exit;
00834 }
00835 }
00836 }
00837
00838 if ($this->page['doktype']==4) {
00839 $this->MP = '';
00840 $this->page = $this->getPageShortcut($this->page['shortcut'],$this->page['shortcut_mode'],$this->page['uid']);
00841 $this->id = $this->page['uid'];
00842 }
00843
00844 $this->rootLine = $this->sys_page->getRootLine($this->id,$this->MP);
00845
00846
00847 if (!count($this->rootLine)) {
00848 $this->printError('The requested page didn\'t have a proper connection to the tree-root! <br /><br />('.$this->sys_page->error_getRootLine.')');
00849 exit;
00850 }
00851
00852
00853 if ($this->checkRootlineForIncludeSection()) {
00854 if (!count($this->rootLine)) {
00855 $this->printError('The requested page was not accessible!');
00856 exit;
00857 } else {
00858 $el = reset($this->rootLine);
00859 $this->id = $el['uid'];
00860 $this->page = $this->sys_page->getPage($this->id);
00861 $this->rootLine = $this->sys_page->getRootLine($this->id,$this->MP);
00862 }
00863 }
00864 }
00865
00878 function getPageShortcut($SC,$mode,$thisUid,$itera=20,$pageLog=array()) {
00879 $idArray = t3lib_div::intExplode(',',$SC);
00880
00881
00882 switch($mode) {
00883 case 1:
00884 case 2:
00885 $pageArray = $this->sys_page->getMenu($idArray[0]?$idArray[0]:$thisUid,'*','sorting','AND pages.doktype<199 AND pages.doktype!=6');
00886 $pO = 0;
00887 if ($mode==2 && count($pageArray)) {
00888 $this->make_seed();
00889 $randval = intval(rand(0,count($pageArray)-1));
00890 $pO = $randval;
00891 }
00892 $c = 0;
00893 reset($pageArray);
00894 while(list(,$pV)=each($pageArray)) {
00895 if ($c==$pO) {
00896 $page = $pV;
00897 break;
00898 }
00899 $c++;
00900 }
00901 break;
00902 default:
00903 $page = $this->sys_page->getPage($idArray[0]);
00904 break;
00905 }
00906
00907
00908 if ($page['doktype']==4) {
00909 if (!in_array($page['uid'],$pageLog) && $itera>0) {
00910 $pageLog[] = $page['uid'];
00911 $page = $this->getPageShortcut($page['shortcut'],$page['shortcut_mode'],$page['uid'],$itera-1,$pageLog);
00912 } else {
00913 $pageLog[] = $page['uid'];
00914 $this->printError('Page shortcuts were looping in uids '.implode(',',$pageLog).'...!');
00915 exit;
00916 }
00917 }
00918
00919 return $page;
00920 }
00921
00928 function checkRootlineForIncludeSection() {
00929 $c=count($this->rootLine);
00930 $removeTheRestFlag=0;
00931 for ($a=0;$a<$c;$a++) {
00932 if (!$this->checkPagerecordForIncludeSection($this->rootLine[$a])) {
00933 $removeTheRestFlag=1;
00934 }
00935 if ($this->rootLine[$a]['doktype']==6) {
00936 if ($this->beUserLogin) {
00937 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', 'uid='.intval($this->id).' AND '.$GLOBALS['BE_USER']->getPagePermsClause(1));
00938 list($isPage) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
00939 if (!$isPage) $removeTheRestFlag=1;
00940 } else {
00941 $removeTheRestFlag=1;
00942 }
00943 }
00944 if ($removeTheRestFlag) {
00945 $this->pageNotFound=2;
00946 unset($this->rootLine[$a]);
00947 }
00948 }
00949 return $removeTheRestFlag;
00950 }
00951
00961 function checkEnableFields($row) {
00962 if ((!$row['hidden'] || $this->showHiddenPage)
00963 && $row['starttime']<=$GLOBALS['SIM_EXEC_TIME']
00964 && ($row['endtime']==0 || $row['endtime']>$GLOBALS['SIM_EXEC_TIME'])
00965 && $this->checkPageGroupAccess($row)
00966 ) {
00967 return 1;
00968 }
00969 }
00970
00979 function checkPageGroupAccess($row, $groupList=NULL) {
00980 if(is_null($groupList)) {
00981 $groupList = $this->gr_list;
00982 }
00983 if(!is_array($groupList)) {
00984 $groupList = explode(',', $groupList);
00985 }
00986 $pageGroupList = explode(',', $row['fe_group']);
00987 return count(array_intersect($groupList, $pageGroupList)) > 0;
00988 }
00989
00998 function checkPagerecordForIncludeSection($row) {
00999 return (!$row['extendToSubpages'] || $this->checkEnableFields($row)) ? 1 : 0;
01000 }
01001
01010 function setIDfromArgV() {
01011 if (!$this->id) {
01012 list($theAlias) = explode('&',t3lib_div::getIndpEnv('QUERY_STRING'));
01013 $theAlias = trim($theAlias);
01014 $this->id = $theAlias ? $theAlias : 0;
01015 }
01016 }
01017
01026 function getPageAndRootlineWithDomain($domainStartPage) {
01027 $this->getPageAndRootline();
01028
01029
01030 if ($domainStartPage && is_array($this->rootLine)) {
01031 reset ($this->rootLine);
01032 $idFound = 0;
01033 while(list($key,$val)=each($this->rootLine)) {
01034 if ($val['uid']==$domainStartPage) {
01035 $idFound=1;
01036 break;
01037 }
01038 }
01039 if (!$idFound) {
01040 $this->pageNotFound=3;
01041 $this->id = $domainStartPage;
01042 $this->getPageAndRootline();
01043 }
01044 }
01045 }
01046
01053 function setSysPageWhereClause() {
01054 $this->sys_page->where_hid_del.=' AND doktype<200'.$this->getPagesGroupClause();
01055 }
01056
01063 function getPagesGroupClause() {
01064 return ' AND fe_group IN ('.$this->gr_list.')';
01065 }
01066
01074 function findDomainRecord($recursive=0) {
01075 if ($recursive) {
01076 $host = explode('.',t3lib_div::getIndpEnv('HTTP_HOST'));
01077 while(count($host)) {
01078 $pageUid = $this->sys_page->getDomainStartPage(implode('.',$host),t3lib_div::getIndpEnv('SCRIPT_NAME'),t3lib_div::getIndpEnv('REQUEST_URI'));
01079 if ($pageUid) return $pageUid; else array_shift($host);
01080 }
01081 return $pageUid;
01082 } else {
01083 return $this->sys_page->getDomainStartPage(t3lib_div::getIndpEnv('HTTP_HOST'),t3lib_div::getIndpEnv('SCRIPT_NAME'),t3lib_div::getIndpEnv('REQUEST_URI'));
01084 }
01085 }
01086
01093 function pageNotFoundAndExit($reason='') {
01094 $this->pageNotFoundHandler($this->TYPO3_CONF_VARS['FE']['pageNotFound_handling'], $this->TYPO3_CONF_VARS['FE']['pageNotFound_handling_statheader'], $reason);
01095 exit;
01096 }
01097
01107 function pageNotFoundHandler($code, $header='', $reason='') {
01108
01109 if ($header) {header($header);}
01110
01111
01112 if (gettype($code)=='boolean' || !strcmp($code,1)) {
01113 $this->printError('The page did not exist or was inaccessible.'.($reason ? ' Reason: '.htmlspecialchars($reason) : ''));
01114 exit;
01115 } else if (t3lib_div::testInt($code)) {
01116 $this->printError('Error '.$code.($reason ? ' Reason: '.htmlspecialchars($reason) : ''));
01117 exit;
01118 } elseif (t3lib_div::isFirstPartOfStr($code,'READFILE:')) {
01119 $readFile = t3lib_div::getFileAbsFileName(trim(substr($code,9)));
01120 if (@is_file($readFile)) {
01121 $fileContent = t3lib_div::getUrl($readFile);
01122 $fileContent = str_replace('###CURRENT_URL###', t3lib_div::getIndpEnv('REQUEST_URI'), $fileContent);
01123 $fileContent = str_replace('###REASON###', htmlspecialchars($reason), $fileContent);
01124 echo $fileContent;
01125 } else {
01126 $this->printError('Configuration Error: 404 page "'.$readFile.'" could not be found.');
01127 }
01128 exit;
01129 } elseif (strlen($code)) {
01130 header('Location: '.t3lib_div::locationHeaderUrl($code));
01131 exit;
01132 } else {
01133 $this->printError('Error.'.($reason ? ' Reason: '.htmlspecialchars($reason) : ''));
01134 exit;
01135 }
01136 }
01137
01145 function checkAndSetAlias() {
01146 if ($this->id && !t3lib_div::testInt($this->id)) {
01147 $aid = $this->sys_page->getPageIdFromAlias($this->id);
01148 if ($aid) {$this->id=$aid;}
01149 }
01150 }
01151
01160 function idPartsAnalyze($str) {
01161 $GET_VARS = '';
01162 switch(substr($str,0,2)) {
01163 case 'B6':
01164 $addParams = base64_decode(str_replace('_','=',str_replace('-','/',substr($str,2))));
01165 parse_str($addParams,$GET_VARS);
01166 break;
01167 case 'M5':
01168 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('params', 'cache_md5params', 'md5hash="'.$GLOBALS['TYPO3_DB']->quoteStr(substr($str,2), 'cache_md5params').'"');
01169 $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
01170
01171 $this->updateMD5paramsRecord(substr($str,2));
01172 parse_str($row['params'],$GET_VARS);
01173 break;
01174 }
01175
01176 $this->mergingWithGetVars($GET_VARS);
01177 }
01178
01185 function mergingWithGetVars($GET_VARS) {
01186 if (is_array($GET_VARS)) {
01187 $realGet = t3lib_div::_GET();
01188 if (!is_array($realGet)) $realGet = array();
01189
01190
01191 $realGet = t3lib_div::array_merge_recursive_overrule($realGet,$GET_VARS);
01192
01193
01194 t3lib_div::_GETset($realGet);
01195
01196
01197 if (isset($GET_VARS['type'])) $this->type = intval($GET_VARS['type']);
01198 if (isset($GET_VARS['cHash'])) $this->cHash = $GET_VARS['cHash'];
01199 if (isset($GET_VARS['jumpurl'])) $this->jumpurl = $GET_VARS['jumpurl'];
01200 if (isset($GET_VARS['MP'])) $this->MP = $this->TYPO3_CONF_VARS['FE']['enable_mount_pids'] ? $GET_VARS['MP'] : '';
01201
01202 if (isset($GET_VARS['no_cache']) && $GET_VARS['no_cache']) $this->set_no_cache();
01203 }
01204 }
01205
01206
01207
01208
01209
01210
01211
01212
01213
01214
01215
01216
01217
01218
01219
01220
01221
01222
01223
01224
01225
01226
01227
01233 function makeCacheHash() {
01234 $GET = t3lib_div::_GET();
01235 if ($this->cHash && is_array($GET)) {
01236 $pA = $this->cHashParams(t3lib_div::implodeArrayForUrl('',$GET));
01237 $this->cHash_array = $pA;
01238 $cHash_calc = t3lib_div::shortMD5(serialize($this->cHash_array));
01239 #debug(array($cHash_calc,$this->cHash,$pA));
01240 if ($cHash_calc!=$this->cHash) {
01241 $this->set_no_cache();
01242 $GLOBALS['TT']->setTSlogMessage('The incoming cHash "'.$this->cHash.'" and calculated cHash "'.$cHash_calc.'" did not match, so caching was disabled. The fieldlist used was "'.implode(',',array_keys($pA)).'"',2);
01243 }
01244 }
01245 }
01246
01256 function cHashParams($addQueryParams) {
01257 $params = explode('&',substr($addQueryParams,1));
01258
01259
01260 $pA = array();
01261 foreach($params as $theP) {
01262 $pKV = explode('=', $theP);
01263 if (!t3lib_div::inList('id,type,no_cache,cHash,MP,ftu',$pKV[0])) {
01264 $pA[$pKV[0]] = (string)rawurldecode($pKV[1]);
01265 }
01266 }
01267 $pA['encryptionKey'] = $this->TYPO3_CONF_VARS['SYS']['encryptionKey'];
01268 ksort($pA);
01269 return $pA;
01270 }
01271
01277 function initTemplate() {
01278 $this->tmpl = t3lib_div::makeInstance('t3lib_TStemplate');
01279 $this->tmpl->init();
01280 $this->tmpl->tt_track= $this->beUserLogin ? 1 : 0;
01281 }
01282
01289 function getFromCache() {
01290 $this->tmpl->getCurrentPageData();
01291 $cc = Array();
01292 if (is_array($this->tmpl->currentPageData)) {
01293
01294
01295
01296 $cc['all'] = $this->tmpl->currentPageData['all'];
01297 $cc['rowSum'] = $this->tmpl->currentPageData['rowSum'];
01298 $cc['rootLine'] = $this->tmpl->currentPageData['rootLine'];
01299 $this->all = $this->tmpl->matching($cc);
01300 ksort($this->all);
01301 }
01302
01303 $this->content='';
01304 unset($this->config);
01305 $this->cacheContentFlag=0;
01306 if ($this->all && !$this->no_cache) {
01307 $this->newHash = $this->getHash();
01308
01309 $GLOBALS['TT']->push('Cache Query','');
01310 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
01311 'S.*',
01312 'cache_pages AS S,pages AS P',
01313 'S.hash="'.$GLOBALS['TYPO3_DB']->quoteStr($this->newHash, 'cache_pages').'"
01314 AND S.page_id=P.uid
01315 AND S.expires > '.intval($GLOBALS['EXEC_TIME']).'
01316 AND NOT P.deleted
01317 AND NOT P.hidden
01318 AND P.starttime<='.intval($GLOBALS['EXEC_TIME']).'
01319 AND (P.endtime=0 OR P.endtime>'.intval($GLOBALS['EXEC_TIME']).')'
01320 );
01321 $GLOBALS['TT']->pull();
01322 $GLOBALS['TT']->push('Cache Row','');
01323 if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
01324 $this->config = unserialize($row['cache_data']);
01325 $this->content = $row['HTML'];
01326 $this->cacheContentFlag=1;
01327
01328 if ($this->TYPO3_CONF_VARS['FE']['debug'] || $this->config['config']['debug']) {
01329 $this->content.=chr(10).'<!-- Cached page generated '.Date('d/m Y H:i', $row['tstamp']).'. Expires '.Date('d/m Y H:i', $row['expires']).' -->';
01330 }
01331 }
01332 $GLOBALS['TT']->pull();
01333
01334 $GLOBALS['TYPO3_DB']->sql_free_result($res);
01335 }
01336 }
01337
01347 function getHash() {
01348 $this->hash_base = serialize(
01349 array(
01350 'all' => $this->all,
01351 'id' => intval($this->id),
01352 'type' => intval($this->type),
01353 'gr_list' => $this->gr_list,
01354 'MP' => $this->MP,
01355 'cHash' => $this->cHash_array
01356 )
01357 );
01358
01359 return md5($this->hash_base);
01360 }
01361
01367 function getConfigArray() {
01368 if (!is_array($this->config) || is_array($this->config['INTincScript']) || $this->forceTemplateParsing) {
01369 $GLOBALS['TT']->push('Parse template','');
01370
01371
01372 $this->tmpl->forceTemplateParsing = $this->forceTemplateParsing;
01373
01374
01375 $this->tmpl->start($this->rootLine);
01376 $GLOBALS['TT']->pull();
01377
01378 if ($this->tmpl->loaded) {
01379 $GLOBALS['TT']->push('Setting the config-array','');
01380
01381 $this->sPre = $this->tmpl->setup['types.'][$this->type];
01382 $this->pSetup = $this->tmpl->setup[$this->sPre.'.'];
01383
01384 if (!is_array($this->pSetup)) {
01385 $this->printError('The page is not configured! [type= '.$this->type.']['.$this->sPre.']');
01386 exit;
01387 } else {
01388 $this->config['config']=Array();
01389
01390
01391 if (is_array($this->tmpl->setup['config.'])) {
01392 $this->config['config'] = $this->tmpl->setup['config.'];
01393 }
01394 if (is_array($this->pSetup['config.'])) {
01395 reset($this->pSetup['config.']);
01396 while(list($theK,$theV)=each($this->pSetup['config.'])) {
01397 $this->config['config'][$theK] = $theV;
01398 }
01399 }
01400
01401 if (!isset($this->config['config']['simulateStaticDocuments'])) {
01402 $this->config['config']['simulateStaticDocuments'] = $this->TYPO3_CONF_VARS['FE']['simulateStaticDocuments'];
01403 }
01404
01405
01406 $this->config['rootLine'] = $this->tmpl->rootLine;
01407 $this->config['mainScript'] = trim($this->config['config']['mainScript']) ? trim($this->config['config']['mainScript']) : 'index.php';
01408
01409
01410 $theLogFile = $this->TYPO3_CONF_VARS['FE']['logfile_dir'].$this->config['config']['stat_apache_logfile'];
01411
01412 if(!ereg("^/", $theLogFile)) $theLogFile = PATH_site.$theLogFile;
01413
01414 if ($this->config['config']['stat_apache'] && $this->config['config']['stat_apache_logfile'] && !strstr($this->config['config']['stat_apache_logfile'],'/')) {
01415 if(t3lib_div::isAllowedAbsPath($theLogFile) && @is_file($theLogFile) && @is_writeable($theLogFile)) {
01416 $this->config['stat_vars']['logFile'] = $theLogFile;
01417 $shortTitle = substr(ereg_replace('[^\.[:alnum:]_-]','_',$this->page['title']),0,30);
01418 $pageName = $this->config['config']['stat_apache_pagenames'] ? $this->config['config']['stat_apache_pagenames'] : '[path][title]--[uid].html';
01419 $pageName = str_replace('[title]', $shortTitle ,$pageName);
01420 $pageName = str_replace('[uid]',$this->page['uid'],$pageName);
01421 $pageName = str_replace('[alias]',$this->page['alias'],$pageName);
01422 $pageName = str_replace('[type]',$this->page['type'],$pageName);
01423 $temp = $this->config['rootLine'];
01424 array_pop($temp);
01425 $len = t3lib_div::intInRange($this->config['config']['stat_titleLen'],1,100,20);
01426 $pageName = str_replace('[path]', ereg_replace('[^\.[:alnum:]\/_-]','_',$this->sys_page->getPathFromRootline($temp,$len)).'/' ,$pageName);
01427 $this->config['stat_vars']['pageName'] = $pageName;
01428 } else {
01429 $GLOBALS['TT']->setTSlogMessage('Could not set logfile path. Check filepath and permissions.',3);
01430 }
01431 }
01432 $this->config['FEData'] = $this->tmpl->setup['FEData'];
01433 $this->config['FEData.'] = $this->tmpl->setup['FEData.'];
01434 }
01435 $GLOBALS['TT']->pull();
01436 } else {
01437 $this->printError('No template found!');
01438 exit;
01439 }
01440 }
01441
01442
01443 $this->initLLvars();
01444
01445
01446 if ($this->config['config']['no_cache']) {$this->set_no_cache();}
01447
01448
01449 if ($this->absRefPrefix_force && strcmp($this->config['config']['simulateStaticDocuments'],'PATH_INFO')) {
01450 $redirectUrl = t3lib_div::getIndpEnv('TYPO3_REQUEST_DIR').'index.php?id='.$this->id.'&type='.$this->type;
01451 if ($this->config['config']['simulateStaticDocuments_dontRedirectPathInfoError']) {
01452 $this->printError('PATH_INFO was not configured for this website, and the URL tries to find the page by PATH_INFO!<br /><br /><a href="'.htmlspecialchars($redirectUrl).'">Click here to get to the right page.</a>','Error: PATH_INFO not configured');
01453 } else {
01454 header('Location: '.t3lib_div::locationHeaderUrl($redirectUrl));
01455 }
01456 exit;
01457
01458 }
01459 }
01460
01461
01462
01463
01464
01465
01466
01467
01468
01469
01470
01471
01472
01473
01474
01475
01476
01477
01478
01479
01480
01489 function getCompressedTCarray() {
01490 global $TCA;
01491
01492 $GLOBALS['TT']->push('Get Compressed TC array');
01493 if (!$this->TCAloaded) {
01494
01495 $tempHash = md5('tables.php:'.
01496 filemtime(TYPO3_extTableDef_script ? PATH_typo3conf.TYPO3_extTableDef_script : PATH_t3lib.'stddb/tables.php').
01497 (TYPO3_extTableDef_script?filemtime(PATH_typo3conf.TYPO3_extTableDef_script):'').
01498 ($GLOBALS['TYPO3_LOADED_EXT']['_CACHEFILE'] ? filemtime(PATH_typo3conf.$GLOBALS['TYPO3_LOADED_EXT']['_CACHEFILE'].'_ext_tables.php') : '')
01499 );
01500
01501 list($TCA,$this->TCAcachedExtras) = unserialize($this->sys_page->getHash($tempHash, 0));
01502
01503 if (!is_array($TCA)) {
01504 $this->includeTCA(0);
01505 $newTc = Array();
01506 $this->TCAcachedExtras = array();
01507
01508 foreach($TCA as $key => $val) {
01509 $newTc[$key]['ctrl'] = $val['ctrl'];
01510 $newTc[$key]['feInterface'] = $val['feInterface'];
01511
01512
01513 t3lib_div::loadTCA($key);
01514 if (is_array($TCA[$key]['columns'])) {
01515 $this->TCAcachedExtras[$key]['l10n_mode'] = array();
01516 foreach($TCA[$key]['columns'] as $fN => $fV) {
01517 if ($fV['l10n_mode']) {
01518 $this->TCAcachedExtras[$key]['l10n_mode'][$fN] = $fV['l10n_mode'];
01519 }
01520 }
01521 }
01522 }
01523
01524
01525 $TCA = $newTc;
01526 $this->sys_page->storeHash($tempHash, serialize(array($newTc,$this->TCAcachedExtras)), 'SHORT TC');
01527 }
01528 }
01529 $GLOBALS['TT']->pull();
01530 }
01531
01543 function includeTCA($TCAloaded=1) {
01544 global $TCA, $PAGES_TYPES, $LANG_GENERAL_LABELS, $TBE_MODULES;
01545 if (!$this->TCAloaded) {
01546 $TCA = Array();
01547 include (TYPO3_tables_script ? PATH_typo3conf.TYPO3_tables_script : PATH_t3lib.'stddb/tables.php');
01548
01549 if ($GLOBALS['TYPO3_LOADED_EXT']['_CACHEFILE']) {
01550 include(PATH_typo3conf.$GLOBALS['TYPO3_LOADED_EXT']['_CACHEFILE'].'_ext_tables.php');
01551 } else {
01552 include(PATH_t3lib.'stddb/load_ext_tables.php');
01553 }
01554
01555 if (TYPO3_extTableDef_script) {
01556 include (PATH_typo3conf.TYPO3_extTableDef_script);
01557 }
01558
01559 $this->TCAloaded = $TCAloaded;
01560 }
01561 }
01562
01570 function settingLanguage() {
01571
01572
01573 $this->sys_language_uid = $this->sys_language_content = intval($this->config['config']['sys_language_uid']);
01574 list($this->sys_language_mode,$sys_language_content) = t3lib_div::trimExplode(';', $this->config['config']['sys_language_mode']);
01575 $this->sys_language_contentOL = $this->config['config']['sys_language_overlay'];
01576
01577
01578 if ($this->sys_language_uid>0) {
01579
01580 $olRec = $this->sys_page->getPageOverlay($this->id, $this->sys_language_uid);
01581 if (!count($olRec)) {
01582
01583
01584 if ($this->sys_language_uid) {
01585
01586
01587 if ($this->page['l18n_cfg']&2) {
01588 $this->pageNotFoundAndExit('Page is not available in the requested language.');
01589 } else {
01590 switch((string)$this->sys_language_mode) {
01591 case 'strict':
01592 $this->pageNotFoundAndExit('Page is not available in the requested language (strict).');
01593 break;
01594 case 'content_fallback':
01595 $fallBackOrder = t3lib_div::intExplode(',', $sys_language_content);
01596 foreach($fallBackOrder as $orderValue) {
01597 if (!strcmp($orderValue,'0') || count($this->sys_page->getPageOverlay($this->id, $orderValue))) {
01598 $this->sys_language_content = $orderValue;
01599 break;
01600 }
01601 }
01602 break;
01603 default:
01604
01605 $this->sys_language_uid = $this->sys_language_content = 0;
01606 break;
01607 }
01608 }
01609 }
01610 } else {
01611
01612 $this->page = $this->sys_page->getPageOverlay($this->page, $this->sys_language_uid);
01613 }
01614 }
01615
01616
01617 $this->sys_page->sys_language_uid = $this->sys_language_uid;
01618
01619
01620 if ((!$this->sys_language_uid || !$this->sys_language_content) && $this->page['l18n_cfg']&1) {
01621 $this->pageNotFoundAndExit('Page is not available in default language.');
01622 }
01623
01624
01625 if ($this->sys_language_uid && is_array($this->tmpl->rootLine)) {
01626 reset($this->tmpl->rootLine);
01627 while(list($rLk)=each($this->tmpl->rootLine)) {
01628 $this->tmpl->rootLine[$rLk] = $this->sys_page->getPageOverlay($this->tmpl->rootLine[$rLk]);
01629 }
01630 }
01631 if ($this->sys_language_uid && is_array($this->rootLine)) {
01632 reset($this->rootLine);
01633 while(list($rLk)=each($this->rootLine)) {
01634 $this->rootLine[$rLk] = $this->sys_page->getPageOverlay($this->rootLine[$rLk]);
01635 }
01636 }
01637
01638
01639 if (t3lib_extMgm::isLoaded('static_info_tables') && $this->sys_language_content) {
01640 $sys_language_row = $this->sys_page->getRawRecord('sys_language',$this->sys_language_content,'static_lang_isocode');
01641 if (is_array($sys_language_row) && $sys_language_row['static_lang_isocode']) {
01642 $stLrow = $this->sys_page->getRawRecord('static_languages',$sys_language_row['static_lang_isocode'],'lg_iso_2');
01643 $this->sys_language_isocode = $stLrow['lg_iso_2'];
01644 }
01645 }
01646
01647
01648 $table_fields = t3lib_div::trimExplode(',', $this->config['config']['sys_language_softMergeIfNotBlank'],1);
01649 foreach($table_fields as $TF) {
01650 list($tN,$fN) = explode(':',$TF);
01651 $this->TCAcachedExtras[$tN]['l10n_mode'][$fN] = 'mergeIfNotBlank';
01652 }
01653 }
01654
01660 function settingLocale() {
01661
01662
01663 if ($this->config['config']['locale_all']) {
01664 # Change by Rene Fritz, 22/10 2002
01665 # there`s the problem that PHP parses float values in scripts wrong if the locale LC_NUMERIC is set to something with a komma as decimal point
01666 # this does not work in php 4.2.3
01667 #setlocale('LC_ALL',$this->config['config']['locale_all']);
01668 #setlocale('LC_NUMERIC','en_US');
01669
01670 # so we set all except LC_NUMERIC
01671 setlocale(LC_COLLATE,$this->config['config']['locale_all']);
01672 setlocale(LC_CTYPE,$this->config['config']['locale_all']);
01673 setlocale(LC_MONETARY,$this->config['config']['locale_all']);
01674 setlocale(LC_TIME,$this->config['config']['locale_all']);
01675
01676 $this->localeCharset = $this->csConvObj->get_locale_charset($this->config['config']['locale_all']);
01677 }
01678 }
01679
01685 function checkDataSubmission() {
01686 if ($_POST['formtype_db'] || $_POST['formtype_mail']) {
01687 $refInfo = parse_url(t3lib_div::getIndpEnv('HTTP_REFERER'));
01688 if (t3lib_div::getIndpEnv('TYPO3_HOST_ONLY')==$refInfo['host'] || $this->TYPO3_CONF_VARS['SYS']['doNotCheckReferer']) {
01689 if ($this->locDataCheck($_POST['locationData'])) {
01690 $ret = '';
01691 if ($_POST['formtype_mail']) {
01692 $ret = 'email';
01693 } elseif ($_POST['formtype_db'] && is_array($_POST['data'])) {
01694 $ret = 'fe_tce';
01695 }
01696 $GLOBALS['TT']->setTSlogMessage('"Check Data Submission": Return value: '.$ret,0);
01697 return $ret;
01698 }
01699 } else $GLOBALS['TT']->setTSlogMessage('"Check Data Submission": HTTP_HOST and REFERER HOST did not match when processing submitted formdata!',3);
01700 }
01701 }
01702
01710 function fe_tce() {
01711 $fe_tce = t3lib_div::makeInstance('tslib_feTCE');
01712 $fe_tce->start(t3lib_div::_POST('data'),$this->config['FEData.']);
01713 $fe_tce->includeScripts();
01714 }
01715
01724 function locDataCheck($locationData) {
01725 $locData = explode(':',$locationData);
01726 if (!$locData[1] || $this->sys_page->checkRecord($locData[1],$locData[2],1)) {
01727 if (count($this->sys_page->getPage($locData[0]))) {
01728 return 1;
01729 } else $GLOBALS['TT']->setTSlogMessage('LocationData Error: The page pointed to by location data ('.$locationData.') was not accessible.',2);
01730 } else $GLOBALS['TT']->setTSlogMessage('LocationData Error: Location data ('.$locationData.') record pointed to was not accessible.',2);
01731 }
01732
01740 function sendFormmail() {
01741 $formmail = t3lib_div::makeInstance('t3lib_formmail');
01742
01743 $EMAIL_VARS = t3lib_div::_POST();
01744 unset($EMAIL_VARS['locationData']);
01745 unset($EMAIL_VARS['formtype_mail']);
01746
01747 $integrityCheck = $this->TYPO3_CONF_VARS['FE']['strictFormmail'];
01748
01749
01750 $encodedFields = explode(',','recipient,recipient_copy');
01751 foreach($encodedFields as $fieldKey) {
01752 if (strlen($EMAIL_VARS[$fieldKey])) {
01753 if ($res = $this->codeString($EMAIL_VARS[$fieldKey], TRUE)) {
01754 $EMAIL_VARS[$fieldKey] = $res;
01755 } elseif ($integrityCheck) {
01756 $GLOBALS['TT']->setTSlogMessage('"Formmail" discovered a field ('.$fieldKey.') which could not be decoded to a valid string. Sending formmail aborted due to security reasons!',3);
01757 return FALSE;
01758 } else {
01759 $GLOBALS['TT']->setTSlogMessage('"Formmail" discovered a field ('.$fieldKey.') which could not be decoded to a valid string. The security level accepts this, but you should consider a correct coding though!',2);
01760 }
01761 }
01762 }
01763
01764
01765 if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['sendFormmail-PreProcClass'])) {
01766 foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['sendFormmail-PreProcClass'] as $_classRef) {
01767 $_procObj = &t3lib_div::getUserObj($_classRef);
01768 $EMAIL_VARS = $_procObj->sendFormmail_preProcessVariables($EMAIL_VARS,$this);
01769 }
01770 }
01771
01772 $formmail->start($EMAIL_VARS);
01773 $formmail->sendtheMail();
01774 $GLOBALS['TT']->setTSlogMessage('"Formmail" invoked, sending mail to '.$EMAIL_VARS['recipient'],0);
01775 }
01776
01783 function checkJumpUrl() {
01784 global $TCA;
01785
01786 $mid = t3lib_div::_GP('mid');
01787 $rid = t3lib_div::_GP('rid');
01788 if ((strcmp($this->jumpurl,'') && ((t3lib_div::getIndpEnv('HTTP_REFERER') || $this->TYPO3_CONF_VARS['SYS']['doNotCheckReferer']) || $mid)) || ($this->jumpurl = $this->sys_page->getExtURL($this->page,$this->config['config']['disablePageExternalUrl']))) {
01789 if ($mid && is_array($TCA['sys_dmail'])) {
01790 $temp_recip=explode('_',$rid);
01791 $url_id=0;
01792 if (t3lib_div::testInt($this->jumpurl)) {
01793 $temp_res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('mailContent', 'sys_dmail', 'uid='.intval($mid));
01794 if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($temp_res)) {
01795 $temp_unpackedMail = unserialize($row['mailContent']);
01796 $url_id=$this->jumpurl;
01797 if ($this->jumpurl>=0) {
01798 $responseType=1;
01799 $this->jumpurl = $temp_unpackedMail['html']['hrefs'][$url_id]['absRef'];
01800 } else {
01801 $responseType=2;
01802 $this->jumpurl = $temp_unpackedMail['plain']['link_ids'][abs($url_id)];
01803 }
01804 switch($temp_recip[0]) {
01805 case 't':
01806 $theTable = 'tt_address';
01807 break;
01808 case 'f':
01809 $theTable = 'fe_users';
01810 break;
01811 default:
01812 $theTable='';
01813 break;
01814 }
01815 if ($theTable) {
01816 $recipRow = $this->sys_page->getRawRecord($theTable,$temp_recip[1]);
01817 if (is_array($recipRow)) {
01818
01819 $authCode = t3lib_div::stdAuthCode($recipRow['uid']);
01820 $rowFieldsArray = explode(',', 'uid,name,title,email,phone,www,address,company,city,zip,country,fax,firstname');
01821 reset($rowFieldsArray);
01822 while(list(,$substField)=each($rowFieldsArray)) {
01823 $this->jumpurl = str_replace('###USER_'.$substField.'###', $recipRow[$substField], $this->jumpurl);
01824 }
01825 $this->jumpurl = str_replace('###SYS_TABLE_NAME###', $tableNameChar, $this->jumpurl);
01826 $this->jumpurl = str_replace('###SYS_MAIL_ID###', $mid, $this->jumpurl);
01827 $this->jumpurl = str_replace('###SYS_AUTHCODE###', $authCode, $this->jumpurl);
01828
01829
01830 }
01831 }
01832 }
01833
01834 $GLOBALS['TYPO3_DB']->sql_free_result($temp_res);
01835
01836 if (!$this->jumpurl) die('Error: No further link. Please report error to the mail sender.');
01837 } else {
01838 $responseType=-1;
01839 }
01840 if ($responseType!=0) {
01841 $insertFields = array(
01842 'mid' => intval($mid),
01843 'rtbl' => $temp_recip[0],
01844 'rid' => intval($temp_recip[1]),
01845 'tstamp' => time(),
01846 'url' => $this->jumpurl,
01847 'response_type' => intval($responseType),
01848 'url_id' => intval($url_id)
01849 );
01850
01851 $GLOBALS['TYPO3_DB']->exec_INSERTquery('sys_dmail_maillog', $insertFields);
01852 }
01853 }
01854 } else {
01855 unset($this->jumpurl);
01856 }
01857 }
01858
01865 function jumpUrl() {
01866 if ($this->jumpurl) {
01867 if (t3lib_div::_GP('juSecure')) {
01868 $hArr = array(
01869 $this->jumpurl,
01870 t3lib_div::_GP('locationData'),
01871 $this->TYPO3_CONF_VARS['SYS']['encryptionKey']
01872 );
01873 $calcJuHash=t3lib_div::shortMD5(serialize($hArr));
01874 $locationData = t3lib_div::_GP('locationData');
01875 $juHash = t3lib_div::_GP('juHash');
01876 if ($juHash == $calcJuHash) {
01877 if ($this->locDataCheck($locationData)) {
01878 $this->jumpurl = rawurldecode($this->jumpurl);
01879 if (@is_file($this->jumpurl)) {
01880 $mimeType = t3lib_div::_GP('mimeType');
01881 $mimeType = $mimeType ? $mimeType : 'application/octet-stream';
01882 Header('Content-Type: '.$mimeType);
01883 Header('Content-Disposition: attachment; filename='.basename($this->jumpurl));
01884 readfile($this->jumpurl);
01885 exit;
01886 } else die('jumpurl Secure: "'.$this->jumpurl.'" was not a valid file!');
01887 } else die('jumpurl Secure: locationData, '.$locationData.', was not accessible.');
01888 } else die('jumpurl Secure: Calculated juHash, '.$calcJuHash.', did not match the submitted juHash.');
01889 } else {
01890 $TSConf = $this->getPagesTSconfig();
01891 if ($TSConf['TSFE.']['jumpUrl_transferSession']) {
01892 $uParts = parse_url($this->jumpurl);
01893 $params = '&FE_SESSION_KEY='.rawurlencode($this->fe_user->id.'-'.md5($this->fe_user->id.'/'.$this->TYPO3_CONF_VARS['SYS']['encryptionKey']));
01894 $this->jumpurl.=($uParts['query']?'':'?').$params;
01895 }
01896 Header('Location: '.$this->jumpurl);
01897 exit;
01898 }
01899 }
01900 }
01901
01908 function setUrlIdToken() {
01909 if ($this->config['config']['ftu']) {
01910 $this->getMethodUrlIdToken = $this->TYPO3_CONF_VARS['FE']['get_url_id_token'];
01911 } else {
01912 $this->getMethodUrlIdToken = '';
01913 }
01914 }
01915
01916
01917
01918
01919
01920
01921
01922
01923
01924
01925
01926
01927
01928
01929
01930
01931
01932
01933
01934
01935
01936
01937
01938
01939
01940
01941
01942
01943
01944
01951 function isGeneratePage() {
01952 return (!$this->cacheContentFlag && !$this->jumpurl);
01953 }
01954
01961 function tempPageCacheContent() {
01962 $this->tempContent=0;
01963 if (!$this->no_cache) {
01964 $seconds=30;
01965 $stdMsg = '
01966 <html>
01967 <head>
01968 <title>'.htmlspecialchars($this->tmpl->printTitle($this->page['title'])).'</title>
01969 <meta http-equiv=Refresh Content="3; Url='.htmlspecialchars(t3lib_div::getIndpEnv('REQUEST_URI')).'" />
01970 </head>
01971 <body bgcolor="white">
01972 <font size="1" face="VERDANA,ARIAL,HELVETICA" color="#cccccc">
01973 <div align="center">
01974 <b>Page is being generated.</b><br />
01975 If this message does not disappear within '.$seconds.' seconds, please reload.
01976 </div>
01977 </font>
01978 </body>
01979 </html>';
01980 $temp_content = $this->config['config']['message_page_is_being_generated'] ? $this->config['config']['message_page_is_being_generated'] : $stdMsg;
01981
01982 $this->setPageCacheContent($temp_content,'',$GLOBALS['EXEC_TIME']+$seconds);
01983 $this->tempContent=1;
01984 }
01985 }
01986
01992 function realPageCacheContent() {
01993 $cache_timeout = $this->page['cache_timeout'] ? $this->page['cache_timeout'] : ($this->cacheTimeOutDefault ? $this->cacheTimeOutDefault : 60*60*24);
01994 $timeOutTime = $GLOBALS['EXEC_TIME']+$cache_timeout;
01995 if ($this->config['config']['cache_clearAtMidnight']) {
01996 $midnightTime = mktime (0,0,0,date('m',$timeOutTime),date('d',$timeOutTime),date('Y',$timeOutTime));
01997 if ($midnightTime > time()) {
01998 $timeOutTime = $midnightTime;
01999 }
02000 }
02001 $this->config['hash_base'] = $this->hash_base;
02002 $this->setPageCacheContent($this->content,$this->config,$timeOutTime);
02003
02004
02005 if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['insertPageIncache'])) {
02006 foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['insertPageIncache'] as $_classRef) {
02007 $_procObj = &t3lib_div::getUserObj($_classRef);
02008 $_procObj->insertPageIncache($this,$timeOutTime);
02009 }
02010 }
02011 }
02012
02022 function setPageCacheContent($c,$d,$t) {
02023 $this->clearPageCacheContent();
02024 $insertFields = array(
02025 'hash' => $this->newHash,
02026 'page_id' => $this->id,
02027 'HTML' => $c,
02028 'cache_data' => serialize($d),
02029 'expires' => $t,
02030 'tstamp' => time()
02031 );
02032 if ($this->page_cache_reg1) {
02033 $insertFields['reg1'] = intval($this->page_cache_reg1);
02034 }
02035
02036 $GLOBALS['TYPO3_DB']->exec_INSERTquery('cache_pages', $insertFields);
02037 }
02038
02044 function clearPageCacheContent() {
02045 $GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_pages', 'hash="'.$GLOBALS['TYPO3_DB']->quoteStr($this->newHash, 'cache_pages').'"');
02046 }
02047
02054 function clearPageCacheContent_pidList($pidList) {
02055 $GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_pages', 'page_id IN ('.$GLOBALS['TYPO3_DB']->cleanIntList($pidList).')');
02056 }
02057
02065 function setSysLastChanged() {
02066 if ($this->page['SYS_LASTCHANGED'] < intval($this->register['SYS_LASTCHANGED'])) {
02067 $GLOBALS['TYPO3_DB']->exec_UPDATEquery('pages', 'uid='.intval($this->id), array('SYS_LASTCHANGED' => intval($this->register['SYS_LASTCHANGED'])));
02068 }
02069 }
02070
02071
02072
02073
02074
02075
02076
02077
02078
02079
02080
02081
02082
02083
02084
02085
02086
02087
02088
02089
02090
02091
02092
02093
02094
02095
02101 function generatePage_preProcessing() {
02102 ksort($this->all);
02103
02104 $this->newHash = $this->getHash();
02105
02106
02107 $this->tempPageCacheContent();
02108
02109
02110
02111 $this->cacheTimeOutDefault = intval($this->config['config']['cache_period']);
02112
02113
02114 $this->no_cacheBeforePageGen = $this->no_cache;
02115 }
02116
02123 function generatePage_whichScript() {
02124 if (!$this->TYPO3_CONF_VARS['FE']['noPHPscriptInclude'] && $this->config['config']['pageGenScript']) {
02125 return $this->tmpl->getFileName($this->config['config']['pageGenScript']);
02126 }
02127 }
02128
02135 function generatePage_postProcessing() {
02136
02137 if ($this->no_cacheBeforePageGen) $this->set_no_cache();
02138
02139
02140 if ($this->TYPO3_CONF_VARS['FE']['tidy_option'] == 'all') {
02141 $GLOBALS['TT']->push('Tidy, all','');
02142 $this->content = $this->tidyHTML($this->content);
02143 $GLOBALS['TT']->pull();
02144 }
02145
02146
02147 if ($this->doXHTML_cleaning() == 'all') {
02148 $GLOBALS['TT']->push('XHTML clean, all','');
02149 $XHTML_clean = t3lib_div::makeInstance('t3lib_parsehtml');
02150 $this->content = $XHTML_clean->XHTML_clean($this->content);
02151 $GLOBALS['TT']->pull();
02152 }
02153
02154
02155 if ($this->doLocalAnchorFix() == 'all') {
02156 $GLOBALS['TT']->push('Local anchor fix, all','');
02157 $this->prefixLocalAnchorsWithScript();
02158 $GLOBALS['TT']->pull();
02159 }
02160
02161
02162 if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-all'])) {
02163 $_params = array('pObj' => &$this);
02164 foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-all'] as $_funcRef) {
02165 t3lib_div::callUserFunction($_funcRef,$_params,$this);
02166 }
02167 }
02168
02169
02170 if (!$this->no_cache) {
02171
02172 if ($this->TYPO3_CONF_VARS['FE']['tidy_option'] == 'cached') {
02173 $GLOBALS['TT']->push('Tidy, cached','');
02174 $this->content = $this->tidyHTML($this->content);
02175 $GLOBALS['TT']->pull();
02176 }
02177
02178 if ($this->doXHTML_cleaning() == 'cached') {
02179 $GLOBALS['TT']->push('XHTML clean, cached','');
02180 $XHTML_clean = t3lib_div::makeInstance('t3lib_parsehtml');
02181 $this->content = $XHTML_clean->XHTML_clean($this->content);
02182 $GLOBALS['TT']->pull();
02183 }
02184
02185 if ($this->doLocalAnchorFix() == 'cached') {
02186 $GLOBALS['TT']->push('Local anchor fix, cached','');
02187 $this->prefixLocalAnchorsWithScript();
02188 $GLOBALS['TT']->pull();
02189 }
02190
02191
02192 if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-cached'])) {
02193 $_params = array('pObj' => &$this);
02194 foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-cached'] as $_funcRef) {
02195 t3lib_div::callUserFunction($_funcRef,$_params,$this);
02196 }
02197 }
02198 }
02199
02200
02201 if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageIndexing'])) {
02202 foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageIndexing'] as $_classRef) {
02203 $_procObj = &t3lib_div::getUserObj($_classRef);
02204 $_procObj->hook_indexContent($this);
02205 }
02206 }
02207
02208
02209 $this->content = $this->convOutputCharset($this->content,'mainpage');
02210
02211
02212 if (!$this->no_cache) {
02213 $this->realPageCacheContent();
02214 } elseif ($this->tempContent) {
02215 $this->clearPageCacheContent();
02216 }
02217
02218
02219 $this->setSysLastChanged();
02220 }
02221
02227 function INTincScript() {
02228 $GLOBALS['TT']->push('Split content');
02229 $INTiS_splitC = explode('<!--INT_SCRIPT.',$this->content);
02230 $this->content='';
02231 $GLOBALS['TT']->setTSlogMessage('Parts: '.count($INTiS_splitC));
02232 $GLOBALS['TT']->pull();
02233
02234
02235 $this->additionalHeaderData = is_array($this->config['INTincScript_ext']['additionalHeaderData']) ? $this->config['INTincScript_ext']['additionalHeaderData'] : array();
02236 $this->additionalJavaScript = $this->config['INTincScript_ext']['additionalJavaScript'];
02237 $this->additionalCSS = $this->config['INTincScript_ext']['additionalCSS'];
02238 $this->JSCode = $this->additionalHeaderData['JSCode'];
02239 $this->JSImgCode = $this->additionalHeaderData['JSImgCode'];
02240 $this->divSection='';
02241
02242 $INTiS_config = $GLOBALS['TSFE']->config['INTincScript'];
02243 foreach($INTiS_splitC as $INTiS_c => $INTiS_cPart) {
02244 if (substr($INTiS_cPart,32,3)=='-->') {
02245 $GLOBALS['TT']->push('Include '.$INTiS_config[$INTiS_key]['file'],'');
02246 $INTiS_key = 'INT_SCRIPT.'.substr($INTiS_cPart,0,32);
02247 $incContent='';
02248 if (is_array($INTiS_config[$INTiS_key])) {
02249 $INTiS_cObj = unserialize($INTiS_config[$INTiS_key]['cObj']);
02250 $INTiS_cObj->INT_include=1;
02251 switch($INTiS_config[$INTiS_key]['type']) {
02252 case 'SCRIPT':
02253 $incContent = $INTiS_cObj->PHP_SCRIPT($INTiS_config[$INTiS_key]['conf']);
02254 break;
02255 case 'COA':
02256 $incContent = $INTiS_cObj->COBJ_ARRAY($INTiS_config[$INTiS_key]['conf']);
02257 break;
02258 case 'FUNC':
02259 $incContent = $INTiS_cObj->USER($INTiS_config[$INTiS_key]['conf']);
02260 break;
02261 case 'POSTUSERFUNC':
02262 $incContent = $INTiS_cObj->callUserFunction($INTiS_config[$INTiS_key]['postUserFunc'], $INTiS_config[$INTiS_key]['conf'], $INTiS_config[$INTiS_key]['content']);
02263 break;
02264 }
02265 }
02266 $this->content.= $this->convOutputCharset($incContent,'INC-'.$INTiS_c);
02267 $this->content.= substr($INTiS_cPart,35);
02268 $GLOBALS['TT']->pull($incContent);
02269 } else {
02270 $this->content.= ($INTiS_c?'<!--INT_SCRIPT.':'').$INTiS_cPart;
02271 }
02272 }
02273 $GLOBALS['TT']->push('Substitute header section');
02274 $this->INTincScript_loadJSCode();
02275 $this->content = str_replace('<!--HD_'.$this->config['INTincScript_ext']['divKey'].'-->', $this->convOutputCharset(implode(chr(10),$this->additionalHeaderData),'HD'), $this->content);
02276 $this->content = str_replace('<!--TDS_'.$this->config['INTincScript_ext']['divKey'].'-->', $this->convOutputCharset($this->divSection,'TDS'), $this->content);
02277 $this->setAbsRefPrefix();
02278 $GLOBALS['TT']->pull();
02279 }
02280
02287 function INTincScript_loadJSCode() {
02288 if ($this->JSImgCode) {
02289 $this->additionalHeaderData['JSImgCode']='
02290 <script type="text/javascript">
02291
02292 <!--
02293 if (version == "n3") {
02294 '.trim($this->JSImgCode).'
02295 }
02296
02297
02298 </script>';
02299 }
02300 if ($this->JSCode || count($this->additionalJavaScript)) {
02301 $this->additionalHeaderData['JSCode']='
02302 <script type="text/javascript">
02303
02304 <!--
02305 '.implode(chr(10),$this->additionalJavaScript).'
02306 '.trim($this->JSCode).'
02307
02308
02309 </script>';
02310 }
02311 if (count($this->additionalCSS)) {
02312 $this->additionalHeaderData['_CSS']='
02313 <style type="text/css">
02314
02315 <!--
02316 '.implode(chr(10),$this->additionalCSS).'
02317
02318
02319 </style>';
02320 }
02321 }
02322
02328 function isINTincScript() {
02329 return (is_array($this->config['INTincScript']) && !$this->jumpurl);
02330 }
02331
02337 function doXHTML_cleaning() {
02338 return $this->config['config']['xhtml_cleaning'];
02339 }
02340
02346 function doLocalAnchorFix() {
02347 return $this->config['config']['prefixLocalAnchors'];
02348 }
02349
02350
02351
02352
02353
02354
02355
02356
02357
02358
02359
02360
02361
02362
02363
02364
02365
02366
02367
02368
02369
02370
02377 function isOutputting() {
02378 return (!$this->jumpurl);
02379 }
02380
02388 function processOutput() {
02389
02390 if ($this->fe_user->user['uid']) {
02391 $token = trim($this->config['config']['USERNAME_substToken']);
02392 $this->content = str_replace($token ? $token : '<!--###USERNAME###-->',$this->fe_user->user['username'],$this->content);
02393 }
02394
02395 if ($this->getMethodUrlIdToken) {
02396 $this->content = str_replace($this->getMethodUrlIdToken, $this->fe_user->get_URL_ID, $this->content);
02397 }
02398
02399
02400 if (!$this->config['config']['disableCharsetHeader']) {
02401 $headLine = 'Content-Type:text/html;charset='.trim($this->metaCharset);
02402 header ($headLine);
02403 }
02404
02405
02406 if ($this->config['config']['additionalHeaders']) {
02407 $headerArray = explode('|', $this->config['config']['additionalHeaders']);
02408 while(list(,$headLine)=each($headerArray)) {
02409 $headLine = trim($headLine);
02410 header($headLine);
02411 }
02412 }
02413
02414
02415 if ($this->TYPO3_CONF_VARS['FE']['tidy_option'] == 'output') {
02416 $GLOBALS['TT']->push('Tidy, output','');
02417 $this->content = $this->tidyHTML($this->content);
02418 $GLOBALS['TT']->pull();
02419 }
02420
02421 if ($this->doXHTML_cleaning() == 'output') {
02422 $GLOBALS['TT']->push('XHTML clean, output','');
02423 $XHTML_clean = t3lib_div::makeInstance('t3lib_parsehtml');
02424 $this->content = $XHTML_clean->XHTML_clean($this->content);
02425 $GLOBALS['TT']->pull();
02426 }
02427
02428 if ($this->doLocalAnchorFix() == 'output') {
02429 $GLOBALS['TT']->push('Local anchor fix, output','');
02430 $this->prefixLocalAnchorsWithScript();
02431 $GLOBALS['TT']->pull();
02432 }
02433
02434
02435 if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-output'])) {
02436 $_params = array('pObj' => &$this);
02437 foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-output'] as $_funcRef) {
02438 t3lib_div::callUserFunction($_funcRef,$_params,$this);
02439 }
02440 }
02441
02442
02443
02444
02445
02446 }
02447
02454 function isEXTincScript() {
02455 return is_array($this->config['EXTincScript']);
02456 }
02457
02463 function storeSessionData() {
02464 $this->fe_user->storeSessionData();
02465 }
02466
02473 function setParseTime() {
02474
02475 $this->scriptParseTime = $GLOBALS['TT']->convertMicrotime($GLOBALS['TYPO3_MISC']['microtime_end'])
02476 - $GLOBALS['TT']->convertMicrotime($GLOBALS['TYPO3_MISC']['microtime_start'])
02477 - ($GLOBALS['TT']->convertMicrotime($GLOBALS['TYPO3_MISC']['microtime_BE_USER_end'])-$GLOBALS['TT']->convertMicrotime($GLOBALS['TYPO3_MISC']['microtime_BE_USER_start']));
02478 }
02479
02485 function statistics() {
02486 if ($this->config['config']['stat'] &&
02487 (!strcmp('',$this->config['config']['stat_typeNumList']) || t3lib_div::inList(str_replace(' ','',$this->config['config']['stat_typeNumList']), $this->type)) &&
02488 (!$this->config['config']['stat_excludeBEuserHits'] || !$this->beUserLogin) &&
02489 (!$this->config['config']['stat_excludeIPList'] || !t3lib_div::inList(str_replace(' ','',$this->config['config']['stat_excludeIPList']), t3lib_div::getIndpEnv('REMOTE_ADDR')))) {
02490 $GLOBALS['TT']->push('Stat');
02491 if (t3lib_extMgm::isLoaded('sys_stat') && $this->config['config']['stat_mysql']) {
02492
02493
02494 $sword = t3lib_div::_GP('sword');
02495 if ($sword) {
02496 $jumpurl_msg = 'sword:'.$sword;
02497 } elseif ($this->jumpurl) {
02498 $jumpurl_msg = 'jumpurl:'.$this->jumpurl;
02499 } else {
02500 $jumpurl_msg = '';
02501 }
02502
02503
02504 $flags=0;
02505 if ($this->beUserLogin) {$flags|=1;}
02506 if ($this->cacheContentFlag) {$flags|=2;}
02507
02508
02509 $refUrl = t3lib_div::getIndpEnv('HTTP_REFERER');
02510 $thisUrl = t3lib_div::getIndpEnv('TYPO3_REQUEST_DIR');
02511 if (t3lib_div::isFirstPartOfStr($refUrl,$thisUrl)) {
02512 $refUrl='[LOCAL]';
02513 }
02514
02515 $insertFields = array(
02516 'page_id' => intval($this->id),
02517 'page_type' => intval($this->type),
02518 'jumpurl' => $jumpurl_msg,
02519 'feuser_id' => $this->fe_user->user['uid'],
02520 'cookie' => $this->fe_user->id,
02521 'sureCookie' => hexdec(substr($this->fe_user->cookieId,0,8)),
02522 'rl0' => $this->config['rootLine'][0]['uid'],
02523 'rl1' => $this->config['rootLine'][1]['uid'],
02524 'client_browser' => $GLOBALS['CLIENT']['BROWSER'],
02525 'client_version' => $GLOBALS['CLIENT']['VERSION'],
02526 'client_os' => $GLOBALS['CLIENT']['SYSTEM'],
02527 'parsetime' => intval($this->scriptParseTime),
02528 'flags' => $flags,
02529 'IP' => t3lib_div::getIndpEnv('REMOTE_ADDR'),
02530 'host' => t3lib_div::getIndpEnv('REMOTE_HOST'),
02531 'referer' => $refUrl,
02532 'browser' => t3lib_div::getIndpEnv('HTTP_USER_AGENT'),
02533 'tstamp' => $GLOBALS['EXEC_TIME']
02534 );
02535
02536 $GLOBALS['TT']->push('Store SQL');
02537 $GLOBALS['TYPO3_DB']->exec_INSERTquery('sys_stat', $insertFields);
02538 $GLOBALS['TT']->pull();
02539 }
02540
02541
02542 if ($this->config['config']['stat_apache'] && $this->config['stat_vars']['pageName']) {
02543 if (@is_file($this->config['stat_vars']['logFile']) && TYPO3_OS!='WIN') {
02544 $LogLine = ((t3lib_div::getIndpEnv('REMOTE_HOST') && !$this->config['config']['stat_apache_noHost']) ? t3lib_div::getIndpEnv('REMOTE_HOST') : t3lib_div::getIndpEnv('REMOTE_ADDR')).' - - '.Date('[d/M/Y:H:i:s +0000]',$GLOBALS['EXEC_TIME']).' "GET '.$this->config['stat_vars']['pageName'].' HTTP/1.1" 200 '.strlen($this->content);
02545 if (!$this->config['config']['stat_apache_notExtended']) {
02546 $LogLine.= ' "'.t3lib_div::getIndpEnv('HTTP_REFERER').'" "'.t3lib_div::getIndpEnv('HTTP_USER_AGENT').'"';
02547 }
02548
02549 switch($this->TYPO3_CONF_VARS['FE']['logfile_write']) {
02550 case 'fputs':
02551 $GLOBALS['TT']->push('Write to log file (fputs)');
02552 $logfilehandle = fopen($this->config['stat_vars']['logFile'], 'a');
02553 fputs($logfilehandle, $LogLine."\n");
02554 @fclose($logfilehandle);
02555 $GLOBALS['TT']->pull();
02556 break;
02557 default:
02558 $GLOBALS['TT']->push('Write to log file (echo)');
02559 $execCmd = 'echo "'.addslashes($LogLine).'" >> '.$this->config['stat_vars']['logFile'];
02560 exec($execCmd);
02561 $GLOBALS['TT']->pull();
02562 break;
02563 }
02564
02565 $GLOBALS['TT']->setTSlogMessage('Writing to logfile: OK',0);
02566 } else {
02567 $GLOBALS['TT']->setTSlogMessage('Writing to logfile: Error - logFile did not exist or OS is Windows!',3);
02568 }
02569 }
02570 $GLOBALS['TT']->pull();
02571 }
02572 }
02573
02579 function previewInfo() {
02580 if ($this->fePreview) {
02581 $stdMsg = '
02582 <br />
02583 <div align="center">
02584 <table border="3" bordercolor="black" cellpadding="2" bgcolor="red">
02585 <tr>
02586 <td> <font face="Verdana" size="1"><b>PREVIEW!</b></font> </td>
02587 </tr>
02588 </table>
02589 </div>';
02590 $temp_content = $this->config['config']['message_preview'] ? $this->config['config']['message_preview'] : $stdMsg;
02591 echo $temp_content;
02592 }
02593 }
02594
02600 function beLoginLinkIPList() {
02601 if ($this->config['config']['beLoginLinkIPList']) {
02602 if (t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'), $this->config['config']['beLoginLinkIPList'])) {
02603 $label = !$this->beUserLogin ? $this->config['config']['beLoginLinkIPList_login'] : $this->config['config']['beLoginLinkIPList_logout'];
02604 if ($label) {
02605 if (!$this->beUserLogin) {
02606 $link = '<a href="'.htmlspecialchars(TYPO3_mainDir.'index.php?redirect_url='.rawurlencode(t3lib_div::getIndpEnv("REQUEST_URI"))).'">'.$label.'</a>';
02607 } else {
02608 $link = '<a href="'.htmlspecialchars(TYPO3_mainDir.'index.php?L=OUT&redirect_url='.rawurlencode(t3lib_div::getIndpEnv("REQUEST_URI"))).'">'.$label.'</a>';
02609 }
02610 return $link;
02611 }
02612 }
02613 }
02614 }
02615
02616
02617
02618
02619
02620
02621
02622
02623
02624
02625
02626
02627
02628
02629
02630
02631
02632
02633
02634
02635
02636
02637
02638
02639
02640
02641
02642
02643
02655 function makeSimulFileName($inTitle,$page,$type,$addParams='',$no_cache='') {
02656 $titleChars = intval($this->config['config']['simulateStaticDocuments_addTitle']);
02657 $out = '';
02658 if ($titleChars) {
02659 $out = $this->csConvObj->specCharsToASCII($this->renderCharset, $inTitle);
02660 $out= ereg_replace('[^[:alnum:]_-]','_',trim(substr($out,0,$titleChars)));
02661 $out= ereg_replace('_*$','',$out);
02662 $out= ereg_replace('^_*','',$out);
02663 if ($out) $out.='.';
02664 }
02665 $enc = '';
02666 if (strcmp($addParams,'') && !$no_cache) {
02667 switch ((string)$this->config['config']['simulateStaticDocuments_pEnc']) {
02668 case 'md5':
02669 $md5=substr(md5($addParams),0,10);
02670 $enc='+M5'.$md5;
02671
02672 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('md5hash', 'cache_md5params', 'md5hash="'.$GLOBALS['TYPO3_DB']->quoteStr($md5, 'cache_md5params').'"');
02673 if (!$GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
02674 $insertFields = array(
02675 'md5hash' => $md5,
02676 'tstamp' => time(),
02677 'type' => 1,
02678 'params' => $addParams
02679 );
02680
02681 $GLOBALS['TYPO3_DB']->exec_INSERTquery('cache_md5params', $insertFields);
02682 }
02683 break;
02684 case 'base64':
02685 $enc='+B6'.str_replace('=','_',str_replace('/','-',base64_encode($addParams)));
02686 break;
02687 }
02688 }
02689
02690 $url = $out.$page.$enc;
02691 $url.= ($type || $out || !$this->config['config']['simulateStaticDocuments_noTypeIfNoTitle']) ? '.'.$type : '';
02692 return $url;
02693 }
02694
02702 function simulateStaticDocuments_pEnc_onlyP_proc($linkVars) {
02703 $remainLinkVars = '';
02704 if (strcmp($linkVars,'')) {
02705 $p = explode('&',$linkVars);
02706 sort($p);
02707 $rem = array();
02708 foreach($p as $k => $v) {
02709 if (strlen($v)) {
02710 list($pName) = explode('=',$v,2);
02711 $pName = rawurldecode($pName);
02712 if (!$this->pEncAllowedParamNames[$pName]) {
02713 unset($p[$k]);
02714 $rem[] = $v;
02715 }
02716 } else unset($p[$k]);
02717 }
02718
02719 $linkVars = count($p) ? '&'.implode('&',$p) : '';
02720 $remainLinkVars = count($rem) ? '&'.implode('&',$rem) : '';
02721 }
02722 return array($linkVars, $remainLinkVars);
02723 }
02724
02731 function getSimulFileName() {
02732 $url='';
02733 $url.=$this->makeSimulFileName($this->page['title'], $this->page['alias']?$this->page['alias']:$this->id, $this->type).'.html';
02734 return $url;
02735 }
02736
02744 function encryptEmail($string,$back=0) {
02745 $out = '';
02746 for ($a=0; $a<strlen($string); $a++) {
02747 $charValue = ord(substr($string,$a,1));
02748 $charValue+= intval($this->spamProtectEmailAddresses)*($back?-1:1);
02749 $out.= chr($charValue);
02750 }
02751 return $out;
02752 }
02753
02763 function codeString($string, $decode=FALSE) {
02764
02765 if ($decode) {
02766 list($md5Hash, $str) = explode(':',$string,2);
02767 $newHash = substr(md5($this->TYPO3_CONF_VARS['SYS']['encryptionKey'].':'.$str),0,10);
02768 if (!strcmp($md5Hash, $newHash)) {
02769 $str = base64_decode($str);
02770 $str = $this->roundTripCryptString($str);
02771 return $str;
02772 } else return FALSE;
02773 } else {
02774 $str = $string;
02775 $str = $this->roundTripCryptString($str);
02776 $str = base64_encode($str);
02777 $newHash = substr(md5($this->TYPO3_CONF_VARS['SYS']['encryptionKey'].':'.$str),0,10);
02778 return $newHash.':'.$str;
02779 }
02780 }
02781
02789 function roundTripCryptString($string) {
02790 $out = '';
02791 $strLen = strlen($string);
02792 $cryptLen = strlen($this->TYPO3_CONF_VARS['SYS']['encryptionKey']);
02793
02794 for ($a=0; $a < $strLen; $a++) {
02795 $xorVal = $cryptLen>0 ? ord($this->TYPO3_CONF_VARS['SYS']['encryptionKey']{($a%$cryptLen)}) : 255;
02796 $out.= chr(ord($string{$a}) ^ $xorVal);
02797 }
02798
02799 return $out;
02800 }
02801
02809 function checkFileInclude($incFile) {
02810 return !$this->TYPO3_CONF_VARS['FE']['noPHPscriptInclude']
02811 || substr($incFile,0,14)=='media/scripts/'
02812 || substr($incFile,0,4+strlen(TYPO3_mainDir))==TYPO3_mainDir.'ext/'
02813 || substr($incFile,0,7+strlen(TYPO3_mainDir))==TYPO3_mainDir.'sysext/'
02814 || substr($incFile,0,14)=='typo3conf/ext/';
02815 }
02816
02824 function newCObj() {
02825 $this->cObj =t3lib_div::makeInstance('tslib_cObj');
02826 $this->cObj->start($this->page,'pages');
02827 }
02828
02837 function setAbsRefPrefix() {
02838 if ($this->absRefPrefix) {
02839 $this->content = str_replace('"media/', '"'.$this->absRefPrefix.'media/', $this->content);
02840 $this->content = str_replace('"fileadmin/', '"'.$this->absRefPrefix.'fileadmin/', $this->content);
02841 }
02842 }
02843
02851 function baseUrlWrap($url) {
02852 if ($this->baseUrl) {
02853 $urlParts = parse_url($url);
02854 if (!strlen($urlParts['scheme']) && $url{0}!=='/') {
02855 $url = $this->baseUrl.$url;
02856 }
02857 }
02858 return $url;
02859 }
02860
02870 function printError($label,$header='Error!') {
02871 t3lib_timeTrack::debug_typo3PrintError($header,$label,0,t3lib_div::getIndpEnv('TYPO3_SITE_URL'));
02872 }
02873
02881 function updateMD5paramsRecord($hash) {
02882 $GLOBALS['TYPO3_DB']->exec_UPDATEquery('cache_md5params', 'md5hash="'.$GLOBALS['TYPO3_DB']->quoteStr($hash, 'cache_md5params').'"', array('tstamp' => time()));
02883 }
02884
02892 function tidyHTML($content) {
02893 if ($this->TYPO3_CONF_VARS['FE']['tidy'] && $this->TYPO3_CONF_VARS['FE']['tidy_path']) {
02894 $oldContent = $content;
02895 $fname = t3lib_div::tempnam('Typo3_Tidydoc_');
02896 @unlink ($fname);
02897 $fp = fopen ($fname,'wb');
02898 fputs ($fp, $content);
02899 @fclose ($fp);
02900
02901 exec ($this->TYPO3_CONF_VARS['FE']['tidy_path'].' '.$fname, $output);
02902 @unlink ($fname);
02903 $content = implode(chr(10),$output);
02904 if (!trim($content)) {
02905 $content = $oldContent;
02906 $GLOBALS['TT']->setTSlogMessage('"tidy" returned an empty value!',2);
02907 }
02908 $GLOBALS['TT']->setTSlogMessage('"tidy" content lenght: '.strlen($content),0);
02909 }
02910 return $content;
02911 }
02912
02918 function prefixLocalAnchorsWithScript() {
02919 $scriptPath = substr(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'),strlen(t3lib_div::getIndpEnv('TYPO3_SITE_URL')));
02920 $this->content = eregi_replace('(<(a|area)[[:space:]]+href=")(#[^"]*")','\1'.htmlspecialchars($scriptPath).'\3',$this->content);
02921 }
02922
02923
02924
02925
02926
02927
02928
02929
02930
02931
02932
02933
02934
02935
02936
02937
02938
02939
02940
02941
02942
02943
02944
02945
02946
02947
02948
02949
02950 /********************************************
02951 *
02952 * Various external API functions - for use in plugins etc.
02953 *
02954 *******************************************/
02955
02956
02962 function getStorageSiterootPids() {
02963 $res=array();
02964 reset($this->rootLine);
02965 while(list(,$rC)=each($this->rootLine)) {
02966 if (!$res['_STORAGE_PID']) $res['_STORAGE_PID']=intval($rC['storage_pid']);
02967 if (!$res['_SITEROOT']) $res['_SITEROOT']=$rC['is_siteroot']?intval($rC['uid']):0;
02968 }
02969 return $res;
02970 }
02971
02977 function getPagesTSconfig() {
02978 if (!is_array($this->pagesTSconfig)) {
02979 reset($this->rootLine);
02980 $TSdataArray = array();
02981 $TSdataArray[] = $this->TYPO3_CONF_VARS['BE']['defaultPageTSconfig']; // Setting default configuration:
02982 while(list($k,$v)=each($this->rootLine)) {
02983 $TSdataArray[]=$v['TSconfig'];
02984 }
02985 // Parsing the user TS (or getting from cache)
02986 $TSdataArray = t3lib_TSparser::checkIncludeLines_array($TSdataArray);
02987 $userTS = implode(chr(10).'[GLOBAL]'.chr(10),$TSdataArray);
02988 $hash = md5('pageTS:'.$userTS);
02989 $cachedContent = $this->sys_page->getHash($hash,0);
02990 if (isset($cachedContent)) {
02991 $this->pagesTSconfig = unserialize($cachedContent);
02992 } else {
02993 $parseObj = t3lib_div::makeInstance('t3lib_TSparser');
02994 $parseObj->parse($userTS);
02995 $this->pagesTSconfig = $parseObj->setup;
02996 $this->sys_page->storeHash($hash,serialize($this->pagesTSconfig),'PAGES_TSconfig');
02997 }
02998 }
02999 return $this->pagesTSconfig;
03000 }
03001
03010 function setJS($key,$content='') {
03011 if ($key) {
03012 switch($key) {
03013 case 'mouseOver':
03014 $this->additionalJavaScript[$key]=
03015 ' // JS function for mouse-over
03016 function over(name,imgObj) { //
03017 if (version == "n3" && document[name]) {document[name].src = eval(name+"_h.src");}
03018 else if (imgObj) {imgObj.src = eval(name+"_h.src");}
03019 }
03020 // JS function for mouse-out
03021 function out(name,imgObj) { //
03022 if (version == "n3" && document[name]) {document[name].src = eval(name+"_n.src");}
03023 else if (imgObj) {imgObj.src = eval(name+"_n.src");}
03024 }';
03025 break;
03026 case 'openPic':
03027 $this->additionalJavaScript[$key]=
03028 ' function openPic(url,winName,winParams) { //
03029 var theWindow = window.open(url,winName,winParams);
03030 if (theWindow) {theWindow.focus();}
03031 }';
03032 break;
03033 default:
03034 $this->additionalJavaScript[$key]=$content;
03035 break;
03036 }
03037 }
03038 }
03039
03048 function setCSS($key,$content) {
03049 if ($key) {
03050 switch($key) {
03051 default:
03052 $this->additionalCSS[$key]=$content;
03053 break;
03054 }
03055 }
03056 }
03057
03063 function make_seed() {
03064 list($usec, $sec) = explode(' ', microtime());
03065 $seedV = (float)$sec + ((float)$usec * 100000);
03066 srand($seedV);
03067 }
03068
03076 function uniqueHash($str='') {
03077 return md5($this->uniqueString.'_'.$str.$this->uniqueCounter++);
03078 }
03079
03085 function set_no_cache() {
03086 $this->no_cache = 1;
03087 }
03088
03095 function set_cache_timeout_default($seconds) {
03096 $this->cacheTimeOutDefault = intval($seconds);
03097 }
03098
03111 function plainMailEncoded($email,$subject,$message,$headers='') {
03112 $urlmode=$this->config['config']['notification_email_urlmode']; // '76', 'all', ''
03113
03114 if ($urlmode) {
03115 $message=t3lib_div::substUrlsInPlainText($message,$urlmode);
03116 }
03117
03118 t3lib_div::plainMailEncoded(
03119 $email,
03120 $subject,
03121 $message,
03122 $headers,
03123 $this->config['config']['notification_email_encoding'],
03124 $this->config['config']['notification_email_charset']?$this->config['config']['notification_email_charset']:'ISO-8859-1'
03125 );
03126 }
03127
03128
03129
03130
03131
03132
03133
03134
03135
03136
03137
03138
03139
03140 /**************************
03141 *
03142 * Localization
03143 *
03144 **************************/
03145
03152 function sL($input) {
03153 if (strcmp(substr($input,0,4),'LLL:')) {
03154 $t = explode('|',$input);
03155 return $t[$this->langSplitIndex] ? $t[$this->langSplitIndex] : $t[0];
03156 } else {
03157 if (!isset($this->LL_labels_cache[$this->lang][$input])) { // If cached label
03158 $restStr = trim(substr($input,4));
03159 $extPrfx='';
03160 if (!strcmp(substr($restStr,0,4),'EXT:')) {
03161 $restStr = trim(substr($restStr,4));
03162 $extPrfx='EXT:';
03163 }
03164 $parts = explode(':',$restStr);
03165 $parts[0]=$extPrfx.$parts[0];
03166 if (!isset($this->LL_files_cache[$parts[0]])) { // Getting data if not cached
03167 $this->LL_files_cache[$parts[0]] = $this->readLLfile($parts[0]);
03168 }
03169 $this->LL_labels_cache[$this->lang][$input] = $this->csConv($this->getLLL($parts[1],$this->LL_files_cache[$parts[0]]));
03170 }
03171 return $this->LL_labels_cache[$this->lang][$input];
03172 }
03173 }
03174
03181 function readLLfile($fileRef) {
03182 $file = t3lib_div::getFileAbsFileName($fileRef);
03183 if (@is_file($file)) {
03184 include($file);
03185 }
03186 return is_array($LOCAL_LANG)?$LOCAL_LANG:array();
03187 }
03188
03196 function getLLL($index,$LOCAL_LANG) {
03197 if (strcmp($LOCAL_LANG[$this->lang][$index],'')) {
03198 return $LOCAL_LANG[$this->lang][$index];
03199 } else {
03200 return $LOCAL_LANG['default'][$index];
03201 }
03202 }
03203
03210 function initLLvars() {
03211
03212 // Setting language key and split index:
03213 $this->lang = $this->config['config']['language'] ? $this->config['config']['language'] : 'default';
03214
03215 $ls = explode('|',TYPO3_languages);
03216 while(list($i,$v)=each($ls)) {
03217 if ($v==$this->lang) {$this->langSplitIndex=$i; break;}
03218 }
03219
03220 // Setting charsets:
03221 $this->renderCharset = $this->csConvObj->parse_charset($this->config['config']['renderCharset'] ? $this->config['config']['renderCharset'] : ($this->TYPO3_CONF_VARS['BE']['forceCharset'] ? $this->TYPO3_CONF_VARS['BE']['forceCharset'] : $this->defaultCharSet)); // REndering charset of HTML page.
03222 $this->metaCharset = $this->csConvObj->parse_charset($this->config['config']['metaCharset'] ? $this->config['config']['metaCharset'] : $this->renderCharset); // Output charset of HTML page.
03223 $this->labelsCharset = $this->csConvObj->parse_charset($this->csConvObj->charSetArray[$this->lang] ? $this->csConvObj->charSetArray[$this->lang] : 'iso-8859-1');
03224 if ($this->renderCharset != $this->labelsCharset) {
03225 $this->convCharsetToFrom = array(
03226 'from' => $this->labelsCharset,
03227 'to' => $this->renderCharset
03228 );
03229 }
03230 }
03231
03244 function csConv($str,$from='') {
03245 if ($from) {
03246 $output = $this->csConvObj->conv($str,$this->csConvObj->parse_charset($from),$this->renderCharset,1);
03247 return $output ? $output : $str;
03248 } elseif (is_array($this->convCharsetToFrom)) {
03249 return $this->csConvObj->conv($str,$this->convCharsetToFrom['from'],$this->convCharsetToFrom['to'],1);
03250 } else {
03251 return $str;
03252 }
03253 }
03254
03262 function convOutputCharset($content,$label) {
03263 if ($this->renderCharset != $this->metaCharset) {
03264 $content = $this->csConvObj->conv($content,$this->renderCharset,$this->metaCharset,TRUE);
03265 }
03266
03267 return $content;
03268 }
03269
03275 function convPOSTCharset() {
03276 if ($this->renderCharset != $this->metaCharset && is_array($_POST) && count($_POST)) {
03277 $this->csConvObj->convArray($_POST,$this->metaCharset,$this->renderCharset);
03278 $GLOBALS['HTTP_POST_VARS'] = $_POST;
03279 }
03280 }
03281 }
03282
03283
03284 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/class.tslib_fe.php']) {
03285 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/class.tslib_fe.php']);
03286 }
03287 ?>