Hooks in tslib_fe, Frontend login mode feature for pages; various other things. see...
authorKasper Skårhøj <kasper@typo3.org>
Tue, 8 Mar 2005 16:38:00 +0000 (16:38 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Tue, 8 Mar 2005 16:38:00 +0000 (16:38 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@574 709f56b5-9817-0410-a4d7-c38de5d9e867

17 files changed:
ChangeLog
TODO.txt
t3lib/class.t3lib_befunc.php
t3lib/class.t3lib_div.php
t3lib/class.t3lib_page.php
typo3/sysext/cms/ext_tables.php
typo3/sysext/cms/ext_tables.sql
typo3/sysext/cms/layout/class.tx_cms_layout.php
typo3/sysext/cms/locallang_tca.xml
typo3/sysext/cms/tslib/class.tslib_content.php
typo3/sysext/cms/tslib/class.tslib_fe.php
typo3/sysext/cms/tslib/class.tslib_feuserauth.php
typo3/sysext/cms/tslib/index_ts.php
typo3/sysext/cms/web_info/class.tx_cms_webinfo.php
typo3/sysext/indexed_search/class.indexer.php
typo3/sysext/indexed_search/ext_localconf.php
typo3/sysext/lang/locallang_core.xml

index e1ef362..6d42727 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-03-08  Kasper Skårhøj,,,  <kasper@typo3.com>
+
+       * New feature for page records: Frontend Login Mode. Makes it possible to disable (and enable later) frontend logins for branches of the page tree. Disabling will make it look like no user is authenticated. This feature is very useful if you wish a highly performant website using cache control headers while specifying sections where user logins are accepted (for dynamic content)
+       * Implemented a bunch of hooks in tslib_fe
+       * Minor bug fixes and re-arrangements
+       * Support for "crawler" extension in indexed_search; Makes it possible to index pages in the page tree by starting a crawler from the backend of TYPO3 (The extension "crawler" is specifically supported) and thus preventing the process from happening during frontend users browsing.
+
 2005-03-07  Karsten Dambekalns  <karsten@typo3.org>
 
        * Fixed the potential security issue with mailforms, allowing
index ff8b8aa..23dcda5 100755 (executable)
--- a/TODO.txt
+++ b/TODO.txt
@@ -153,6 +153,7 @@ Element Browser:
 - Selecting files from other resource-fields of records (which the user can actually read) - maybe with the Element Browser, browsing for record, clicking it, seeing a list of files inside the record?)
 - Ability to insert images when their info page (larger thumbnail) is displayed. Maybe a small + (plus) icon would do. (Notify Patrick Roeder)
 - Some quick-lookup feature (like we have on TER)
+- Showing more than the title column for records listing and making it possible to sort by the columns.
 
 Wizards:
 - Add wizard icon to TSconfig and Setup/Constants fields for immediate syntax highlighting (in popup window)
index a18ea08..c0f2ede 100755 (executable)
@@ -1365,8 +1365,6 @@ class t3lib_BEfunc        {
         *
         *******************************************/
 
-
-
        /**
         * Returns the difference in days between input $tstamp and $EXEC_TIME
         * Usage: 2 (class t3lib_BEfunc)
@@ -1387,7 +1385,7 @@ class t3lib_BEfunc        {
         * @return      string          Formatted time
         */
        function date($tstamp)  {
-               return Date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'],$tstamp);
+               return date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'],$tstamp);
        }
 
        /**
@@ -1398,7 +1396,7 @@ class t3lib_BEfunc        {
         * @return      string          Formatted time
         */
        function datetime($value)       {
-               return Date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'].' '.$GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'],$value);
+               return date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'].' '.$GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'], $value);
        }
 
        /**
index 112e225..e305785 100755 (executable)
@@ -3017,6 +3017,31 @@ class t3lib_div {
        }
 
        /**
+        * Splits the input query-parameters into an array with certain parameters filtered out.
+        * Used to create the cHash value
+        *
+        * @param       string          Query-parameters: "&xxx=yyy&zzz=uuu"
+        * @return      array           Array with key/value pairs of query-parameters WITHOUT a certain list of variable names (like id, type, no_cache etc) and WITH a variable, encryptionKey, specific for this server/installation
+        * @see tslib_fe::makeCacheHash(), tslib_cObj::typoLink()
+        */
+       function cHashParams($addQueryParams) {
+               $params = explode('&',substr($addQueryParams,1));       // Splitting parameters up
+
+                       // Make array:
+               $pA = array();
+               foreach($params as $theP)       {
+                       $pKV = explode('=', $theP);     // Splitting single param by '=' sign
+                       if (!t3lib_div::inList('id,type,no_cache,cHash,MP,ftu',$pKV[0]))        {
+                               $pA[$pKV[0]] = (string)rawurldecode($pKV[1]);
+                       }
+               }
+               $pA['encryptionKey'] = $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'];
+               ksort($pA);
+
+               return $pA;
+       }
+
+       /**
         * Loads the $TCA (Table Configuration Array) for the $table
         *
         * Requirements:
index 28e0791..31d9436 100755 (executable)
@@ -454,7 +454,7 @@ class t3lib_pageSelect {
                                if ($row['prepend_params'])     {
                                        $rURL = ereg_replace('\/$','',$rURL);
                                        $prependStr = ereg_replace('^\/','',substr($request_uri,strlen($path)));
-                                       $rURL.='/'.$prependStr;
+                                       $rURL.= '/'.$prependStr;
                                }
                                Header('Location: '.t3lib_div::locationHeaderUrl($rURL));
                                exit;
@@ -479,7 +479,7 @@ class t3lib_pageSelect {
        function getRootLine($uid, $MP='', $ignoreMPerrors=FALSE)       {
 
                        // Initialize:
-               $selFields = t3lib_div::uniqueList('pid,uid,t3ver_oid,title,alias,nav_title,media,layout,hidden,starttime,endtime,fe_group,extendToSubpages,doktype,TSconfig,storage_pid,is_siteroot,mount_pid,mount_pid_ol,'.$GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields']);
+               $selFields = t3lib_div::uniqueList('pid,uid,t3ver_oid,title,alias,nav_title,media,layout,hidden,starttime,endtime,fe_group,extendToSubpages,doktype,TSconfig,storage_pid,is_siteroot,mount_pid,mount_pid_ol,fe_login_mode,'.$GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields']);
                $this->error_getRootLine = '';
                $this->error_getRootLine_failPid = 0;
 
index 85f7fd1..b6d199b 100755 (executable)
@@ -434,6 +434,18 @@ if (TYPO3_MODE=='BE')      {
                                'default' => ''
                        )
                ),
+               'fe_login_mode' => Array (
+                       'exclude' => 1,
+                       'label' => 'LLL:EXT:cms/locallang_tca.php:pages.fe_login_mode',
+                       'config' => Array (
+                               'type' => 'select',
+                               'items' => Array (
+                                       Array('', 0),
+                                       Array('LLL:EXT:cms/locallang_tca.php:pages.fe_login_mode.disable', 1),
+                                       Array('LLL:EXT:cms/locallang_tca.php:pages.fe_login_mode.enable', 2),
+                               )
+                       )
+               ),
                'l18n_cfg' => Array (
                        'exclude' => 1,
                        'label' => 'LLL:EXT:cms/locallang_tca.php:pages.l18n_cfg',
@@ -456,11 +468,11 @@ if (TYPO3_MODE=='BE')     {
                // Totally overriding all type-settings:
        $TCA['pages']['types'] = Array (
                '1' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, nav_hide, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, l18n_cfg'),
-               '2' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, nav_hide, nav_title, --div--, abstract;;5;;3-3-3, keywords, description, media;;;;4-4-4, --div--, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, l18n_cfg, module, content_from_pid'),
+               '2' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, nav_hide, nav_title, --div--, abstract;;5;;3-3-3, keywords, description, media;;;;4-4-4, --div--, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, l18n_cfg, fe_login_mode, module, content_from_pid'),
                '3' => Array('showitem' => 'hidden;;;;1-1-1, doktype, title;;3;;2-2-2, nav_hide, url;;;;3-3-3, urltype, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, l18n_cfg'),
                '4' => Array('showitem' => 'hidden;;;;1-1-1, doktype, title;;3;;2-2-2, nav_hide, shortcut;;;;3-3-3, shortcut_mode, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, l18n_cfg'),
-               '5' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, nav_hide, nav_title, --div--, media;;;;4-4-4, --div--, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, l18n_cfg, module, content_from_pid'),
-               '7' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, nav_hide, nav_title, --div--, mount_pid;;;;3-3-3, mount_pid_ol, media;;;;4-4-4, --div--, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, l18n_cfg, module, content_from_pid'),
+               '5' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, nav_hide, nav_title, --div--, media;;;;4-4-4, --div--, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, l18n_cfg, fe_login_mode, module, content_from_pid'),
+               '7' => Array('showitem' => 'hidden;;;;1-1-1, doktype;;2;button, title;;3;;2-2-2, subtitle, nav_hide, nav_title, --div--, mount_pid;;;;3-3-3, mount_pid_ol, media;;;;4-4-4, --div--, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, l18n_cfg, fe_login_mode, module, content_from_pid'),
                '199' => Array('showitem' => 'hidden;;;;1-1-1, doktype, title;;;;2-2-2, TSconfig;;6;nowrap;5-5-5, storage_pid;;7'),
                '254' => Array('showitem' => 'hidden;;;;1-1-1, doktype, title;LLL:EXT:lang/locallang_general.php:LGL.title;;;2-2-2, --div--, TSconfig;;6;nowrap;5-5-5, storage_pid;;7, module'),
                '255' => Array('showitem' => 'hidden;;;;1-1-1, doktype, title;;;;2-2-2')
index 323d941..1bbf7d0 100755 (executable)
@@ -387,5 +387,6 @@ CREATE TABLE pages (
   mount_pid_ol tinyint(4) DEFAULT '0' NOT NULL,
   alias varchar(20) DEFAULT '' NOT NULL,
   l18n_cfg tinyint(4) DEFAULT '0' NOT NULL,
+  fe_login_mode tinyint(4) DEFAULT '0' NOT NULL,
   KEY alias (alias)
 );
\ No newline at end of file
index 326481e..19c234d 100755 (executable)
@@ -266,10 +266,10 @@ class tx_cms_layout extends recordList {
                                        $this->fieldArray = explode(',','title,uid,'.implode(',',array_keys($tableNames)));
                                break;
                                case 2:
-                                       $this->fieldArray = explode(',','title,uid,lastUpdated,newUntil,no_cache,cache_timeout,php_tree_stop,TSconfig,storage_pid,is_siteroot');
+                                       $this->fieldArray = explode(',','title,uid,lastUpdated,newUntil,no_cache,cache_timeout,php_tree_stop,TSconfig,storage_pid,is_siteroot,fe_login_mode');
                                break;
                                default:
-                                       $this->fieldArray = explode(',','title,uid,alias,starttime,endtime,fe_group,target,url,shortcut');
+                                       $this->fieldArray = explode(',','title,uid,alias,starttime,endtime,fe_group,target,url,shortcut,shortcut_mode');
                                break;
                        }
 
index 143a4ee..9aafd23 100755 (executable)
@@ -80,6 +80,9 @@
                        <label index="pages_language_overlay">Alternative Page Language</label>
                        <label index="sys_template">Template</label>
                        <label index="static_template">Static templates</label>
+                       <label index="pages.fe_login_mode">Login Mode:</label>
+                       <label index="pages.fe_login_mode.disable">Disable</label>
+                       <label index="pages.fe_login_mode.enable">Enable</label>
                </languageKey>
                <languageKey index="dk">EXT:csh_dk/cms/dk.locallang_tca.xml</languageKey>
                <languageKey index="de">EXT:csh_de/cms/de.locallang_tca.xml</languageKey>
index 93c883a..9ea9184 100755 (executable)
@@ -4987,7 +4987,7 @@ class tslib_cObj {
                                                if (substr($addQueryParams,0,1)!='&')           {
                                                        $addQueryParams = '';
                                                } elseif ($conf['useCacheHash']) {      // cache hashing:
-                                                       $pA = $GLOBALS['TSFE']->cHashParams($addQueryParams.$GLOBALS['TSFE']->linkVars);        // Added '.$this->linkVars' dec 2003: The need for adding the linkVars is that they will be included in the link, but not the cHash. Thus the linkVars will always be the problem that prevents the cHash from working. I cannot see what negative implications in terms of incompatibilities this could bring, but for now I hope there are none. So here we go... (- kasper)
+                                                       $pA = t3lib_div::cHashParams($addQueryParams.$GLOBALS['TSFE']->linkVars);       // Added '.$this->linkVars' dec 2003: The need for adding the linkVars is that they will be included in the link, but not the cHash. Thus the linkVars will always be the problem that prevents the cHash from working. I cannot see what negative implications in terms of incompatibilities this could bring, but for now I hope there are none. So here we go... (- kasper)
                                                        $addQueryParams.= '&cHash='.t3lib_div::shortMD5(serialize($pA));
                                                }
                                                        // Add "&MP" var:
index cde0efd..3b98e3e 100755 (executable)
  *
  *
  *
- *  192: class tslib_fe
- *  356:     function tslib_fe($TYPO3_CONF_VARS, $id, $type, $no_cache='', $cHash='', $jumpurl='',$MP='',$RDCT='')
- *  387:     function connectToMySQL()
- *  423:     function sendRedirect()
+ *  200: class tslib_fe
+ *  366:     function tslib_fe($TYPO3_CONF_VARS, $id, $type, $no_cache='', $cHash='', $jumpurl='',$MP='',$RDCT='')
+ *  399:     function connectToMySQL()
+ *  409:     function connectToDB()
+ *  454:     function sendRedirect()
  *
  *              SECTION: Initializing, resolving page id
- *  461:     function initFEuser()
- *  501:     function initUserGroups()
- *  549:     function checkAlternativeIdMethods()
- *  601:     function clear_preview()
- *  614:     function determineId()
- *  720:     function fetch_the_id()
- *  812:     function getPageAndRootline()
- *  878:     function getPageShortcut($SC,$mode,$thisUid,$itera=20,$pageLog=array())
- *  928:     function checkRootlineForIncludeSection()
- *  961:     function checkEnableFields($row)
- *  979:     function checkPageGroupAccess($row, $groupList=NULL)
- *  998:     function checkPagerecordForIncludeSection($row)
- * 1010:     function setIDfromArgV()
- * 1026:     function getPageAndRootlineWithDomain($domainStartPage)
- * 1053:     function setSysPageWhereClause()
- * 1063:     function getPagesGroupClause()
- * 1074:     function findDomainRecord($recursive=0)
- * 1093:     function pageNotFoundAndExit($reason='')
- * 1107:     function pageNotFoundHandler($code, $header='', $reason='')
- * 1145:     function checkAndSetAlias()
- * 1160:     function idPartsAnalyze($str)
- * 1185:     function mergingWithGetVars($GET_VARS)
+ *  492:     function initFEuser()
+ *  542:     function initUserGroups()
+ *  589:     function checkAlternativeIdMethods()
+ *  641:     function clear_preview()
+ *  654:     function determineId()
+ *  772:     function fetch_the_id()
+ *  867:     function getPageAndRootline()
+ *  933:     function getPageShortcut($SC,$mode,$thisUid,$itera=20,$pageLog=array())
+ *  983:     function checkRootlineForIncludeSection()
+ * 1016:     function checkEnableFields($row)
+ * 1034:     function checkPageGroupAccess($row, $groupList=NULL)
+ * 1053:     function checkPagerecordForIncludeSection($row)
+ * 1062:     function checkIfLoginAllowedInBranch()
+ * 1090:     function setIDfromArgV()
+ * 1106:     function getPageAndRootlineWithDomain($domainStartPage)
+ * 1133:     function setSysPageWhereClause()
+ * 1143:     function getPagesGroupClause()
+ * 1154:     function findDomainRecord($recursive=0)
+ * 1173:     function pageNotFoundAndExit($reason='')
+ * 1187:     function pageNotFoundHandler($code, $header='', $reason='')
+ * 1225:     function checkAndSetAlias()
+ * 1240:     function idPartsAnalyze($str)
+ * 1265:     function mergingWithGetVars($GET_VARS)
  *
  *              SECTION: Template and caching related functions.
- * 1233:     function makeCacheHash()
- * 1256:     function cHashParams($addQueryParams)
- * 1277:     function initTemplate()
- * 1289:     function getFromCache()
- * 1347:     function getHash()
- * 1367:     function getConfigArray()
+ * 1313:     function makeCacheHash()
+ * 1336:     function cHashParams($addQueryParams)
+ * 1345:     function initTemplate()
+ * 1357:     function getFromCache()
+ * 1416:     function headerNoCache()
+ * 1443:     function getHash()
+ * 1463:     function getConfigArray()
  *
  *              SECTION: Further initialization and data processing
- * 1485:     function getCompressedTCarray()
- * 1539:     function includeTCA($TCAloaded=1)
- * 1566:     function settingLanguage()
- * 1656:     function settingLocale()
- * 1681:     function checkDataSubmission()
- * 1706:     function fe_tce()
- * 1720:     function locDataCheck($locationData)
- * 1736:     function sendFormmail()
- * 1779:     function checkJumpUrl()
- * 1861:     function jumpUrl()
- * 1904:     function setUrlIdToken()
+ * 1585:     function getCompressedTCarray()
+ * 1639:     function includeTCA($TCAloaded=1)
+ * 1666:     function settingLanguage()
+ * 1756:     function settingLocale()
+ * 1781:     function checkDataSubmission()
+ * 1806:     function fe_tce()
+ * 1820:     function locDataCheck($locationData)
+ * 1836:     function sendFormmail()
+ * 1879:     function checkJumpUrl()
+ * 1961:     function jumpUrl()
+ * 2004:     function setUrlIdToken()
  *
  *              SECTION: Page generation; cache handling
- * 1947:     function isGeneratePage()
- * 1957:     function tempPageCacheContent()
- * 1988:     function realPageCacheContent()
- * 2018:     function setPageCacheContent($c,$d,$t)
- * 2040:     function clearPageCacheContent()
- * 2050:     function clearPageCacheContent_pidList($pidList)
- * 2061:     function setSysLastChanged()
+ * 2047:     function isGeneratePage()
+ * 2057:     function tempPageCacheContent()
+ * 2089:     function realPageCacheContent()
+ * 2119:     function setPageCacheContent($c,$d,$t)
+ * 2144:     function clearPageCacheContent()
+ * 2154:     function clearPageCacheContent_pidList($pidList)
+ * 2165:     function setSysLastChanged()
  *
  *              SECTION: Page generation; rendering and inclusion
- * 2097:     function generatePage_preProcessing()
- * 2119:     function generatePage_whichScript()
- * 2131:     function generatePage_postProcessing()
- * 2223:     function INTincScript()
- * 2283:     function INTincScript_loadJSCode()
- * 2324:     function isINTincScript()
- * 2333:     function doXHTML_cleaning()
- * 2342:     function doLocalAnchorFix()
+ * 2201:     function generatePage_preProcessing()
+ * 2223:     function generatePage_whichScript()
+ * 2235:     function generatePage_postProcessing()
+ * 2327:     function INTincScript()
+ * 2387:     function INTincScript_loadJSCode()
+ * 2428:     function isINTincScript()
+ * 2437:     function doXHTML_cleaning()
+ * 2446:     function doLocalAnchorFix()
  *
  *              SECTION: Finished off; outputting, storing session data, statistics...
- * 2373:     function isOutputting()
- * 2384:     function processOutput()
- * 2450:     function isEXTincScript()
- * 2459:     function storeSessionData()
- * 2469:     function setParseTime()
- * 2481:     function statistics()
- * 2575:     function previewInfo()
- * 2596:     function beLoginLinkIPList()
+ * 2477:     function isOutputting()
+ * 2500:     function processOutput()
+ * 2572:     function sendCacheHeaders()
+ * 2633:     function isStaticCacheble()
+ * 2648:     function contentStrReplace()
+ * 2674:     function isEXTincScript()
+ * 2683:     function storeSessionData()
+ * 2693:     function setParseTime()
+ * 2705:     function statistics()
+ * 2804:     function previewInfo()
+ * 2825:     function hook_eofe()
+ * 2841:     function beLoginLinkIPList()
  *
  *              SECTION: Various internal API functions
- * 2651:     function makeSimulFileName($inTitle,$page,$type,$addParams='',$no_cache='')
- * 2698:     function simulateStaticDocuments_pEnc_onlyP_proc($linkVars)
- * 2727:     function getSimulFileName()
- * 2740:     function encryptEmail($string,$back=0)
- * 2759:     function codeString($string, $decode=FALSE)
- * 2785:     function roundTripCryptString($string)
- * 2805:     function checkFileInclude($incFile)
- * 2820:     function newCObj()
- * 2833:     function setAbsRefPrefix()
- * 2847:     function baseUrlWrap($url)
- * 2866:     function printError($label,$header='Error!')
- * 2877:     function updateMD5paramsRecord($hash)
- * 2888:     function tidyHTML($content)
- * 2914:     function prefixLocalAnchorsWithScript()
+ * 2896:     function makeSimulFileName($inTitle,$page,$type,$addParams='',$no_cache='')
+ * 2939:     function simulateStaticDocuments_pEnc_onlyP_proc($linkVars)
+ * 2968:     function getSimulFileName()
+ * 2982:     function fileNameASCIIPrefix($inTitle,$titleChars,$mergeChar='.')
+ * 3000:     function encryptEmail($string,$back=0)
+ * 3019:     function codeString($string, $decode=FALSE)
+ * 3045:     function roundTripCryptString($string)
+ * 3065:     function checkFileInclude($incFile)
+ * 3080:     function newCObj()
+ * 3093:     function setAbsRefPrefix()
+ * 3107:     function baseUrlWrap($url)
+ * 3126:     function printError($label,$header='Error!')
+ * 3137:     function updateMD5paramsRecord($hash)
+ * 3148:     function tidyHTML($content)
+ * 3174:     function prefixLocalAnchorsWithScript()
  *
  *              SECTION: Various external API functions - for use in plugins etc.
- * 2958:     function getStorageSiterootPids()
- * 2973:     function getPagesTSconfig()
- * 3006:     function setJS($key,$content='')
- * 3044:     function setCSS($key,$content)
- * 3059:     function make_seed()
- * 3072:     function uniqueHash($str='')
- * 3081:     function set_no_cache()
- * 3091:     function set_cache_timeout_default($seconds)
- * 3107:     function plainMailEncoded($email,$subject,$message,$headers='')
+ * 3218:     function getStorageSiterootPids()
+ * 3233:     function getPagesTSconfig()
+ * 3266:     function setJS($key,$content='')
+ * 3304:     function setCSS($key,$content)
+ * 3319:     function make_seed()
+ * 3332:     function uniqueHash($str='')
+ * 3341:     function set_no_cache()
+ * 3351:     function set_cache_timeout_default($seconds)
+ * 3367:     function plainMailEncoded($email,$subject,$message,$headers='')
  *
  *              SECTION: Localization
- * 3148:     function sL($input)
- * 3177:     function readLLfile($fileRef)
- * 3192:     function getLLL($index,$LOCAL_LANG)
- * 3206:     function initLLvars()
- * 3240:     function csConv($str,$from='')
- * 3258:     function convOutputCharset($content,$label)
- * 3271:     function convPOSTCharset()
+ * 3408:     function sL($input)
+ * 3437:     function readLLfile($fileRef)
+ * 3452:     function getLLL($index,$LOCAL_LANG)
+ * 3466:     function initLLvars()
+ * 3500:     function csConv($str,$from='')
+ * 3518:     function convOutputCharset($content,$label)
+ * 3531:     function convPOSTCharset()
  *
- * TOTAL FUNCTIONS: 95
+ * TOTAL FUNCTIONS: 103
  * (This index is automatically created/updated by the extension "extdeveval")
  *
  */
                        $this->printError('The current username, password or host was not accepted when the connection to the database was attempted to be established!','Database Error');
                        exit;
                }
+
+
+                       // Call post processing function for DB connection:
+               if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['connectToDB']))  {
+                       $_params = array('pObj' => &$this);
+                       foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['connectToDB'] as $_funcRef)   {
+                               t3lib_div::callUserFunction($_funcRef,$_params,$this);
+                       }
+               }
        }
 
        /**
                if (t3lib_div::_GP('FE_SESSION_KEY'))   {
                        $fe_sParts = explode('-',t3lib_div::_GP('FE_SESSION_KEY'));
                        if (!strcmp(md5($fe_sParts[0].'/'.$this->TYPO3_CONF_VARS['SYS']['encryptionKey']), $fe_sParts[1]))      {       // If the session key hash check is OK:
-                               $_COOKIE[$this->fe_user->name]=$fe_sParts[0];
-                               $this->fe_user->forceSetCookie=1;
+                               $_COOKIE[$this->fe_user->name] = $fe_sParts[0];
+                               $this->fe_user->forceSetCookie = 1;
                        }
                }
 
                        $this->fe_user->record_registration($recs);
                }
 
+                       // Call hook for possible manipulation of frontend user object
+               if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['initFEuser']))   {
+                       $_params = array('pObj' => &$this);
+                       foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['initFEuser'] as $_funcRef)    {
+                               t3lib_div::callUserFunction($_funcRef,$_params,$this);
+                       }
+               }
+
                        // For every 60 seconds the is_online timestamp is updated.
-               if (is_array($this->fe_user->user) && $this->fe_user->user['is_online']<($GLOBALS['EXEC_TIME']-60))     {
+               if (is_array($this->fe_user->user) && $this->fe_user->user['uid'] && $this->fe_user->user['is_online']<($GLOBALS['EXEC_TIME']-60))      {
                        $GLOBALS['TYPO3_DB']->exec_UPDATEquery('fe_users', 'uid='.intval($this->fe_user->user['uid']), array('is_online' => $GLOBALS['EXEC_TIME']));
                }
        }
 
        /**
         * Initializes the front-end user groups.
+        * Sets ->loginUser and ->gr_list based on front-end user status.
         *
         * @return      void
         */
        function initUserGroups() {
-                       // Sets ->loginUser and ->gr_list based on front-end user status.
+
                $this->fe_user->showHiddenRecords = $this->showHiddenRecords;           // This affects the hidden-flag selecting the fe_groups for the user!
-               // if (is_array($this->fe_user->user) && $this->fe_user->fetchGroupData())      {
-               $this->fe_user->fetchGroupData();       // no matter if we have an active user we try to fetch matching groups which can be set without an user.
+               $this->fe_user->fetchGroupData();       // no matter if we have an active user we try to fetch matching groups which can be set without an user (simulation for instance!)
+
                if (is_array($this->fe_user->user) && count($this->fe_user->groupData['uid']))  {
                        $this->loginUser=1;     // global flag!
                        $this->gr_list = '0,-2';        // group -2 is not an existing group, but denotes a 'default' group when a user IS logged in. This is used to let elements be shown for all logged in users!
                        $this->gr_list = '0,-1';        // group -1 is not an existing group, but denotes a 'default' group when not logged in. This is used to let elements be hidden, when a user is logged in!
                        $gr_array = $this->fe_user->groupData['uid'];
                }
-
                // TYPO3_CONF_VARS']['FE']['IPmaskMountGroups'] moved to sysext/sv/class.tx_sv_auth.php service
 
                        // Clean up.
                if ($this->fe_user->writeDevLog)        t3lib_div::devLog('Valid usergroups for TSFE: '.$this->gr_list, 'tslib_fe');
        }
 
-
        /**
         * Provides ways to bypass the '?id=[xxx]&type=[xx]' format, using either PATH_INFO or virtual HTML-documents (using Apache mod_rewrite)
         *
-        * Two options:
-        * 1) Apache mod_rewrite: Here a .htaccess file maps all .html-files to index.php and then we extract the id and type from the name of that HTML-file.
-        * 2) Use PATH_INFO (also Apache) to extract id and type from that var. Does not require any special modules compiled with apache.
+        * Three options:
+        * 1) Apache mod_rewrite: Here a .htaccess file maps all .html-files to index.php and then we extract the id and type from the name of that HTML-file. (AKA "simulateStaticDocuments")
+        * 2) Use PATH_INFO (also Apache) to extract id and type from that var. Does not require any special modules compiled with apache. (less typical)
+        * 3) Using hook which enables features like those provided from "realurl" extension (AKA "Speaking URLs")
         *
         * Support for RewriteRule to generate   (simulateStaticDocuments)
         * With the mod_rewrite compiled into apache, put these lines into a .htaccess in this directory:
                                        // Resetting
                                $this->clear_preview();
                                $this->fe_user->user['usergroup'] = $fe_user_OLD_USERGROUP;
+
+                                       // Fetching the id again, now with the preview settings reset.
+                               $this->fetch_the_id();
+                       }
+               }
+
+                       // Checks if user logins are blocked for a certain branch and if so, will unset user login and re-fetch ID.
+               if (is_array($this->fe_user->user))     {       // Only if there is a login will we run this...
+                       if (!$this->checkIfLoginAllowedInBranch())      {
+                               unset($this->fe_user->user);
+
                                        // Fetching the id again, now with the preview settings reset.
                                $this->fetch_the_id();
                        }
                }
+
+
                        // Final cleaning.
                $this->id = $this->contentPid = intval($this->id);      // Make sure it's an integer
                $this->type = intval($this->type);      // Make sure it's an integer
 
-
                        // Call post processing function for id determination:
                if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['determineId-PostProc'])) {
                        $_params = array('pObj' => &$this);
                $this->sys_page->versioningPreview = $this->fePreview ? TRUE : FALSE;
                if ($this->sys_page->versioningPreview) {
                        $this->sys_page->versionPreviewMap = $this->versionPreviewMap;
-#debug($this->sys_page->versionPreviewMap);
                }
 
                        // Set the valid usergroups for FE
        }
 
        /**
+        * Checks if logins are allowed in the current branch of the page tree. Traverses the full root line and returns TRUE if logins are OK, otherwise false (and then the login user must be unset!)
+        *
+        * @return      boolean         returns TRUE if logins are OK, otherwise false (and then the login user must be unset!)
+        */
+       function checkIfLoginAllowedInBranch()  {
+
+                       // Initialize:
+               $c = count($this->rootLine);
+               $disable = FALSE;
+
+                       // Traverse root line from root and outwards:
+               for ($a=0; $a<$c; $a++) {
+
+                               // If a value is set for login state:
+                       if ($this->rootLine[$a]['fe_login_mode'] > 0)   {
+
+                                       // Determine state from value:
+                               $disable = (int)$this->rootLine[$a]['fe_login_mode'] === 1 ? TRUE : FALSE;
+                       }
+               }
+
+               return !$disable;
+       }
+
+       /**
         * This checks if there are ARGV-parameters in the QUERY_STRING and if so, those are used for the id
         * $this->id must be 'false' in order for any processing to happen in here
         * If an id/alias value is extracted from the QUERY_STRING it is set in $this->id
        function makeCacheHash()        {
                $GET = t3lib_div::_GET();
                if ($this->cHash && is_array($GET))     {
-                       $pA = $this->cHashParams(t3lib_div::implodeArrayForUrl('',$GET));
-                       $this->cHash_array = $pA;
+                       $this->cHash_array = t3lib_div::cHashParams(t3lib_div::implodeArrayForUrl('',$GET));
                        $cHash_calc = t3lib_div::shortMD5(serialize($this->cHash_array));
-#debug(array($cHash_calc,$this->cHash,$pA));
+
                        if ($cHash_calc!=$this->cHash)  {
                                $this->set_no_cache();
-                               $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);
+                               $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($this->cHash_array)).'"',2);
                        }
                }
        }
         * @return      array           Array with key/value pairs of query-parameters WITHOUT a certain list of variable names (like id, type, no_cache etc) and WITH a variable, encryptionKey, specific for this server/installation
         * @access private
         * @see makeCacheHash(), tslib_cObj::typoLink()
+        * @obsolete
         */
        function cHashParams($addQueryParams) {
-               $params = explode('&',substr($addQueryParams,1));       // Splitting parameters up
-
-                       // Make array:
-               $pA = array();
-               foreach($params as $theP)       {
-                       $pKV = explode('=', $theP);     // SPlitting single param by '=' sign
-                       if (!t3lib_div::inList('id,type,no_cache,cHash,MP,ftu',$pKV[0]))        {
-                               $pA[$pKV[0]] = (string)rawurldecode($pKV[1]);
-                       }
-               }
-               $pA['encryptionKey'] = $this->TYPO3_CONF_VARS['SYS']['encryptionKey'];
-               ksort($pA);
-               return $pA;
+               return t3lib_div::cHashParams($addQueryParams);
        }
 
        /**
 
                        // Look for page in cache only if caching is not disabled and if a shift-reload is not sent to the server.
                if ($this->all && !$this->no_cache && !$this->headerNoCache())  {
+
                        $this->newHash = $this->getHash();
 
                        $GLOBALS['TT']->push('Cache Query','');
        }
 
        /**
-        *      Detecting if shift-reload has been clicked
+        * Detecting if shift-reload has been clicked
+        * Will not be called if re-generation of page happens by other reasons (for instance that the page is not in cache yet!)
         *
         * @return      boolean         If shift-reload in client browser has been clicked, disable getting cached page (and regenerate it).
         */
        function headerNoCache()        {
+               $disableAcquireCacheData = FALSE;
+
                if (strtolower($_SERVER['HTTP_CACHE_CONTROL'])==='no-cache' || strtolower($_SERVER['HTTP_PRAGMA'])==='no-cache')        {
-                       return TRUE;
+                       $disableAcquireCacheData = TRUE;
                }
+
+                       // Call hook for possible by-pass of requiring of page cache (for recaching purpose)
+               if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['headerNoCache']))        {
+                       $_params = array('pObj' => &$this, 'disableAcquireCacheData' => &$disableAcquireCacheData);
+                       foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['headerNoCache'] as $_funcRef) {
+                               t3lib_div::callUserFunction($_funcRef,$_params,$this);
+                       }
+               }
+
+               return $disableAcquireCacheData;
        }
 
        /**
                $integrityCheck = $this->TYPO3_CONF_VARS['FE']['strictFormmail'];
 
                if(!$this->TYPO3_CONF_VARS['FE']['secureFormmail']) {
-                 // Check recipient field:
-                 $encodedFields = explode(',','recipient,recipient_copy');     // These two fields are the ones which contain recipient addresses that can be misused to send mail from foreign servers.
-                 foreach($encodedFields as $fieldKey)  {
-                   if (strlen($EMAIL_VARS[$fieldKey])) {
-                     if ($res = $this->codeString($EMAIL_VARS[$fieldKey], TRUE))       {       // Decode...
-                     $EMAIL_VARS[$fieldKey] = $res;    // Set value if OK
-                     } elseif ($integrityCheck)        {       // Otherwise abort:
-                     $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);
-                     return false;
-                     } else {
-                       $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);
-                     }
-                   }
-                 }
-               }
-               else {
+                       // Check recipient field:
+                       $encodedFields = explode(',','recipient,recipient_copy');       // These two fields are the ones which contain recipient addresses that can be misused to send mail from foreign servers.
+                       foreach($encodedFields as $fieldKey)    {
+                               if (strlen($EMAIL_VARS[$fieldKey]))     {
+                                       if ($res = $this->codeString($EMAIL_VARS[$fieldKey], TRUE))     {       // Decode...
+                                               $EMAIL_VARS[$fieldKey] = $res;  // Set value if OK
+                                       } elseif ($integrityCheck)      {       // Otherwise abort:
+                                               $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);
+                                               return false;
+                                       } else {
+                                               $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);
+                                       }
+                               }
+                       }
+               } else {
                  $locData = explode(':',$locationData);
                  $record = $this->sys_page->checkRecord($locData[1],$locData[2],1);
                  $EMAIL_VARS['recipient'] = $record['subheader'];
         * @return string The value of the recipient_copy field, or an empty string
         */
        function extractRecipientCopy($bodytext) {
-         $recipient_copy = '';
-         $fdef = array();
-         //|recipient_copy=hidden|karsten@localhost.localdomain
-         preg_match('/^[\s]*\|[\s]*recipient_copy[\s]*=[\s]*hidden[\s]*\|(.*)$/m', $bodytext, $fdef);
-         $recipient_copy = (!empty($fdef[1])) ? $fdef[1] : '';
-         return $recipient_copy;
+               $recipient_copy = '';
+               $fdef = array();
+               //|recipient_copy=hidden|karsten@localhost.localdomain
+               preg_match('/^[\s]*\|[\s]*recipient_copy[\s]*=[\s]*hidden[\s]*\|(.*)$/m', $bodytext, $fdef);
+               $recipient_copy = (!empty($fdef[1])) ? $fdef[1] : '';
+               return $recipient_copy;
        }
 
        /**
@@ -2436,7 +2498,19 @@ if (version == "n3") {
         * @return      boolean         Returns true if $this->jumpurl is not set.
         */
        function isOutputting() {
-               return (!$this->jumpurl);
+
+                       // Initialize by status of jumpUrl:
+               $enableOutput = (!$this->jumpurl);
+
+                       // Call hook for possible disabling of output:
+               if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['isOutputting'])) {
+                       $_params = array('pObj' => &$this, 'enableOutput' => &$enableOutput);
+                       foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['isOutputting'] as $_funcRef)  {
+                               t3lib_div::callUserFunction($_funcRef,$_params,$this);
+                       }
+               }
+
+               return $enableOutput;
        }
 
        /**
@@ -2520,13 +2594,8 @@ if (version == "n3") {
         */
        function sendCacheHeaders()     {
 
-                       // no_cache cannot be set: If it is, the page might contain dynamic content and should never be cached.
-                       // There can be no USER_INT objects on the page ("isINTincScript()") because they implicitly indicate dynamic content
-                       // There can be no logged in user because user sessions are based on a cookie and thereby does not offer client caching a chance to know if the user is logged in. Actually, there will be a reverse problem here; If a page will somehow change when a user is logged in he may not see it correctly if the non-login version sent a cache-header! So do NOT use cache headers in page sections where user logins change the page content.
-               $doCache = !$this->no_cache
-                               && !$this->isINTincScript()
-                               && !$this->isEXTincScript()
-                               && !is_array($this->fe_user->user);
+                       // Getting status whether we can send cache control headers for proxy caching:
+               $doCache = $this->isStaticCacheble();
 
                        // Finally, when backend users are logged in, do not send cache headers at all (Admin Panel might be displayed for instance).
                if ($doCache
@@ -2575,6 +2644,26 @@ if (version == "n3") {
        }
 
        /**
+        * Reporting status whether we can send cache control headers for proxy caching or publishing to static files
+        *
+        * Rules are:
+        * no_cache cannot be set: If it is, the page might contain dynamic content and should never be cached.
+        * There can be no USER_INT objects on the page ("isINTincScript()" / "isEXTincScript()") because they implicitly indicate dynamic content
+        * There can be no logged in user because user sessions are based on a cookie and thereby does not offer client caching a chance to know if the user is logged in. Actually, there will be a reverse problem here; If a page will somehow change when a user is logged in he may not see it correctly if the non-login version sent a cache-header! So do NOT use cache headers in page sections where user logins change the page content. (unless using such as realurl to apply a prefix in case of login sections)
+        *
+        * @return      boolean
+        */
+       function isStaticCacheble()     {
+
+               $doCache = !$this->no_cache
+                               && !$this->isINTincScript()
+                               && !$this->isEXTincScript()
+                               && !is_array($this->fe_user->user);
+
+               return $doCache;
+       }
+
+       /**
         * Substitute various tokens in content. This should happen only if the content is not cached by proxies or client browsers.
         *
         * @return      void
@@ -2752,6 +2841,22 @@ if (version == "n3") {
        }
 
        /**
+        * End-Of-Frontend hook
+        *
+        * @return      void
+        */
+       function hook_eofe()    {
+
+                       // Call hook for end-of-frontend processing:
+               if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe']))    {
+                       $_params = array('pObj' => &$this);
+                       foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe'] as $_funcRef)     {
+                               t3lib_div::callUserFunction($_funcRef,$_params,$this);
+                       }
+               }
+       }
+
+       /**
         * Returns a link to the login screen with redirect to the front-end
         *
         * @return      string          HTML, a tag for a link to the backend.
index 3358d4a..7f2c6f7 100644 (file)
@@ -142,6 +142,11 @@ class tslib_feUserAuth extends t3lib_userAuth {
                $this->TSdataArray = array();
                $this->userTS = array();
                $this->userTSUpdated = 0;
+               $this->groupData = Array(
+                       'title' => Array(),
+                       'uid' => Array(),
+                       'pid' => Array()
+               );
 
                        // Setting default configuration:
                $this->TSdataArray[]=$GLOBALS['TYPO3_CONF_VARS']['FE']['defaultUserTSconfig'];
index e5e2132..c93dc4d 100755 (executable)
@@ -75,7 +75,7 @@ $TT->push('','Script start');
 
 
 // *********************
-// DIV Library included
+// Mandatory libraries included
 // *********************
 $TT->push('Include class t3lib_db, t3lib_div, t3lib_extmgm','');
        require(PATH_t3lib.'class.t3lib_div.php');
@@ -95,7 +95,7 @@ if (!t3lib_extMgm::isLoaded('cms'))   die('<strong>Error:</strong> The main fronte
 require(PATH_t3lib.'class.t3lib_db.php');
 $TYPO3_DB = t3lib_div::makeInstance('t3lib_DB');
 
-$CLIENT=t3lib_div::clientInfo();                               // Set to the browser: net / msie if 4+ browsers
+$CLIENT = t3lib_div::clientInfo();                             // Set to the browser: net / msie if 4+ browsers
 $TT->pull();
 
 
@@ -131,7 +131,7 @@ if (!get_magic_quotes_gpc())        {
 // Create $TSFE object (TSFE = TypoScript Front End)
 // Connecting to database
 // ***********************************
-$temp_TSFEclassName=t3lib_div::makeInstanceClassName('tslib_fe');
+$temp_TSFEclassName = t3lib_div::makeInstanceClassName('tslib_fe');
 $TSFE = new $temp_TSFEclassName(
                $TYPO3_CONF_VARS,
                t3lib_div::_GP('id'),
@@ -484,6 +484,12 @@ if (is_object($BE_USER))   {
 }
 
 
+// ******************
+// Hook for end-of-frontend
+// ******************
+$TSFE->hook_eofe();
+
+
 // ********************
 // Finish timetracking
 // ********************
index d50efec..e786df9 100644 (file)
@@ -147,7 +147,6 @@ class tx_cms_webinfo_page extends t3lib_extobjbase {
                        );
                } else {
                        $h_func.= t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[pages]',$this->pObj->MOD_SETTINGS['pages'],$this->pObj->MOD_MENU['pages'],'index.php');
-
                        $dblist->start($this->pObj->id,'pages',0);
                        $dblist->generateList();
 
index 7c525bc..a894efd 100755 (executable)
@@ -158,6 +158,9 @@ class tx_indexedsearch_indexer {
        var $tstamp_minAge = 0;         // If set, this tells a minimum limit before a document can be indexed again. This is regardless of mtime.
        var $maxExternalFiles = 0;      // Max number of external files to index.
 
+       var $forceIndexing = FALSE;             // If true, indexing is forced despite of hashes etc.
+       var $crawlerActive = FALSE;             // Set when crawler is detected (internal)
+
                // INTERNALS:
        var $defaultContentArray=array(
                'title' => '',
@@ -200,11 +203,25 @@ class tx_indexedsearch_indexer {
                        // Indexer configuration from Extension Manager interface:
                $indexerConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['indexed_search']);
 
+                       // Crawler activation:
+                       // Requirements are that the crawler is loaded, a crawler session is running and re-indexing requested as processing instruction:
+               if (t3lib_extMgm::isLoaded('crawler')
+                               && $pObj->applicationData['tx_crawler']['running']
+                               && in_array('tx_indexedsearch_reindex', $pObj->applicationData['tx_crawler']['parameters']['procInstructions']))        {
+
+                               // Setting simple log message:
+                       $pObj->applicationData['tx_crawler']['log'][] = 'Forced Re-indexing enabled';
+
+                               // Setting variables:
+                       $this->crawlerActive = TRUE;    // Crawler active flag
+                       $this->forceIndexing = TRUE;    // Force indexing despite timestamps etc.
+               }
+
                        // Determine if page should be indexed, and if so, configure and initialize indexer
                if ($pObj->config['config']['index_enable'])    {
                        $this->log_push('Index page','');
 
-                       if (!$indexerConfig['disableFrontendIndexing']) {
+                       if (!$indexerConfig['disableFrontendIndexing'] || $this->crawlerActive) {
                                if (!$pObj->page['no_search'])  {
                                        if (!$pObj->no_cache)   {
 
@@ -482,10 +499,12 @@ class tx_indexedsearch_indexer {
                $check = $this->checkMtimeTstamp($this->conf['mtime'], $this->hash['phash']);
                $is_grlist = $this->is_grlist_set($this->hash['phash']);
 
-               if ($check > 0 || !$is_grlist)  {
+               if ($check > 0 || !$is_grlist || $this->forceIndexing)  {
 
                                // Setting message:
-                       if ($check > 0) {
+                       if ($this->forceIndexing)       {
+                               $this->log_setTSlogMessage('Indexing needed, reason: Forced',1);
+                       } elseif ($check > 0)   {
                                $this->log_setTSlogMessage('Indexing needed, reason: '.$this->reasons[$check],1);
                        } else {
                                $this->log_setTSlogMessage('Indexing needed, reason: Updates gr_list!',1);
@@ -1861,18 +1880,8 @@ class tx_indexedsearch_indexer {
         */
        function makeCHash($paramArray) {
                $addQueryParams = t3lib_div::implodeArrayForUrl('', $paramArray);
-               $params = explode('&',substr($addQueryParams,1));       // Splitting parameters up
-
-                       // Make array:
-               $pA = array();
-               foreach($params as $theP)       {
-                       $pKV = explode('=', $theP);     // SPlitting single param by '=' sign
-                       if (!t3lib_div::inList('id,type,no_cache,cHash,MP,ftu',$pKV[0]))        {
-                               $pA[$pKV[0]] = (string)rawurldecode($pKV[1]);
-                       }
-               }
-               $pA['encryptionKey'] = $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'];
-               ksort($pA);
+
+               $pA = t3lib_div::cHashParams($addQueryParams);
 
                return t3lib_div::shortMD5(serialize($pA));
        }
@@ -1925,10 +1934,45 @@ class tx_indexedsearch_indexer {
                if (is_object($GLOBALS['TT']))          $GLOBALS['TT']->setTSlogMessage($msg,$errorNum);
                $this->internal_log[] = $msg;
        }
+
+
+
+
+
+
+
+
+       /**************************
+        *
+        * tslib_fe hooks:
+        *
+        **************************/
+
+       /**
+        * Frontend hook: If the page is not being re-generated this is our chance to force it to be (because re-generation of the page is required in order to have the indexer called!)
+        *
+        * @param       array           Parameters from frontend
+        * @param       object          TSFE object (reference under PHP5)
+        * @return      void
+        */
+       function fe_headerNoCache(&$params, $ref)       {
+
+                       // Requirements are that the crawler is loaded, a crawler session is running and re-indexing requested as processing instruction:
+               if (t3lib_extMgm::isLoaded('crawler')
+                               && $params['pObj']->applicationData['tx_crawler']['running']
+                               && in_array('tx_indexedsearch_reindex', $params['pObj']->applicationData['tx_crawler']['parameters']['procInstructions']))      {
+
+                               // Setting simple log entry:
+                       $params['pObj']->applicationData['tx_crawler']['log'][] = 'RE_CACHE (indexed), old status: '.$params['disableAcquireCacheData'];
+
+                               // Disables a look-up for cached page data - thus resulting in re-generation of the page even if cached.
+                       $params['disableAcquireCacheData'] = TRUE;
+               }
+       }
 }
 
 
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/indexed_search/class.indexer.php'])   {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/indexed_search/class.indexer.php']);
 }
-?>
+?>
\ No newline at end of file
index bd9df6c..4d4a56f 100755 (executable)
@@ -7,9 +7,12 @@ t3lib_extMgm::addTypoScript($_EXTKEY,'editorcfg','
        tt_content.CSS_editor.ch.tx_indexedsearch = < plugin.tx_indexedsearch.CSS_editor
 ',43);
 
-
+       // Attach to hooks:
 $TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageIndexing'][] = 'EXT:indexed_search/class.indexer.php:tx_indexedsearch_indexer';
+$TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['headerNoCache']['tx_indexedsearch'] = 'EXT:indexed_search/class.indexer.php:&tx_indexedsearch_indexer->fe_headerNoCache';
 
+       // Register with "crawler" extension:
+$TYPO3_CONF_VARS['EXTCONF']['crawler']['procInstructions']['tx_indexedsearch_reindex'] = 'Re-indexing';
 
        // Configure default document parsers:
 $TYPO3_CONF_VARS['EXTCONF']['indexed_search']['external_parsers'] = array(
index 68cf1ad..922bc82 100755 (executable)
@@ -55,6 +55,8 @@ Do you want to continue WITHOUT saving?</label>
                        <label index="labels.depth_1">1 level</label>
                        <label index="labels.depth_2">2 levels</label>
                        <label index="labels.depth_3">3 levels</label>
+                       <label index="labels.depth_4">4 levels</label>
+                       <label index="labels.depth_infi">Infinite</label>
                        <label index="labels.allow">Allow</label>
                        <label index="labels.deny">Deny</label>
                        <label index="labels.generalTab">General</label>