Fixed issue #17284: Formprotection persistToken method is called too often, causing...
authorErnesto Baschny <ernst@cron-it.de>
Tue, 25 Jan 2011 09:33:06 +0000 (09:33 +0000)
committerErnesto Baschny <ernst@cron-it.de>
Tue, 25 Jan 2011 09:33:06 +0000 (09:33 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10295 709f56b5-9817-0410-a4d7-c38de5d9e867

20 files changed:
ChangeLog
t3lib/class.t3lib_pagerenderer.php
typo3/alt_clickmenu.php
typo3/alt_doc.php
typo3/alt_menu.php
typo3/classes/class.ajaxlogin.php
typo3/db_new.php
typo3/index.php
typo3/mod.php
typo3/move_el.php
typo3/sysext/cms/layout/db_layout.php
typo3/sysext/info/mod1/index.php
typo3/sysext/lowlevel/dbint/index.php
typo3/sysext/perm/mod1/index.php
typo3/sysext/recordlist/mod1/index.php
typo3/sysext/taskcenter/task/index.php
typo3/sysext/version/cm1/index.php
typo3/sysext/version/ws/index.php
typo3/template.php
typo3/wizard_rte.php

index 26d97bf..5775a79 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-01-25  Ernesto Baschny  <ernst@cron-it.de>
+
+       * Fixed issue #17284: Formprotection persistToken method is called too often, causing unnecessary DB-load (Thanks to Helmut Hummel)
+
 2011-01-25  Jeff Segars  <jeff@webempoweredchurch>
 
        * Fixed bug #17216: Admin panel becomes too wide
index 70582ae..37f7b56 100644 (file)
@@ -949,7 +949,6 @@ class t3lib_PageRenderer implements t3lib_Singleton {
                if (TYPO3_MODE === 'BE') {
                        $formprotection = t3lib_formprotection_Factory::get('t3lib_formprotection_BackendFormProtection');
                        $token = $formprotection->generateToken('extDirect');
-                       $formprotection->persistTokens();
                }
 
                        // Note: we need to iterate thru the object, because the addProvider method
index 568f6be..fc7dda2 100644 (file)
@@ -1776,5 +1776,5 @@ foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
 
 $SOBE->main();
 $SOBE->printContent();
-t3lib_formprotection_Factory::get('t3lib_formprotection_BackendFormProtection')->persistTokens();
+
 ?>
index 60bded7..d43f387 100644 (file)
@@ -1503,6 +1503,5 @@ if ($SOBE->doProcessData())       {               // Checks, if a save button has been clicked (or
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
-$formprotection->persistTokens();
 
 ?>
index eef395b..6ea459a 100644 (file)
@@ -224,6 +224,5 @@ $SOBE = t3lib_div::makeInstance('SC_alt_menu');
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
-t3lib_formprotection_Factory::get('t3lib_formprotection_BackendFormProtection')->persistTokens();
 
 ?>
index db78628..342b1df 100644 (file)
@@ -46,7 +46,6 @@ class AjaxLogin {
                if ($GLOBALS['BE_USER']->user['uid']) {
                        $formprotection = t3lib_formprotection_Factory::get('t3lib_formprotection_BackendFormProtection');
                        $token = $formprotection->generateToken('extDirect');
-                       $formprotection->persistTokens();
 
                        $json = array(
                                'success' => TRUE,
index debf133..a9024f2 100644 (file)
@@ -733,6 +733,5 @@ $SOBE = t3lib_div::makeInstance('SC_db_new');
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
-t3lib_formprotection_Factory::get('t3lib_formprotection_BackendFormProtection')->persistTokens();
 
 ?>
index 00a6115..5a363c6 100644 (file)
@@ -399,7 +399,6 @@ class SC_index {
                        } else {
                                $formprotection = t3lib_formprotection_Factory::get('t3lib_formprotection_BackendFormProtection');
                                $token = $formprotection->generateToken('extDirect');
-                               $formprotection->persistTokens();
                                $TBE_TEMPLATE->JScode.=$TBE_TEMPLATE->wrapScriptTags('
                                        if (parent.opener && (parent.opener.busy || parent.opener.TYPO3.loginRefresh)) {
                                                if (parent.opener.TYPO3.loginRefresh) {
index 6dc5c21..5d0088b 100644 (file)
@@ -66,6 +66,4 @@ if ($isDispatched === FALSE) {
        die('Value "' . htmlspecialchars($temp_M) . '" for "M" was not found as a module');
 }
 
-t3lib_formprotection_Factory::get('t3lib_formprotection_BackendFormProtection')->persistTokens();
-
 ?>
\ No newline at end of file
index 6e61c8b..0bd5faa 100644 (file)
@@ -466,6 +466,5 @@ $SOBE = t3lib_div::makeInstance('SC_move_el');
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
-t3lib_formprotection_Factory::get('t3lib_formprotection_BackendFormProtection')->persistTokens();
 
 ?>
index 70a5f4c..6265653 100755 (executable)
@@ -1413,6 +1413,5 @@ foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
 $SOBE->clearCache();
 $SOBE->main();
 $SOBE->printContent();
-t3lib_formprotection_Factory::get('t3lib_formprotection_BackendFormProtection')->persistTokens();
 
 ?>
\ No newline at end of file
index 308c1b7..d895f2b 100755 (executable)
@@ -233,6 +233,5 @@ $SOBE->checkSubExtObj();    // Checking second level external objects
 
 $SOBE->main();
 $SOBE->printContent();
-t3lib_formprotection_Factory::get('t3lib_formprotection_BackendFormProtection')->persistTokens();
 
 ?>
\ No newline at end of file
index 16e0d21..166004c 100755 (executable)
@@ -694,6 +694,5 @@ $SOBE = t3lib_div::makeInstance('SC_mod_tools_dbint_index');
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
-t3lib_formprotection_Factory::get('t3lib_formprotection_BackendFormProtection')->persistTokens();
 
 ?>
index 910d2d5..f62c75a 100755 (executable)
@@ -851,6 +851,5 @@ $SOBE = t3lib_div::makeInstance('SC_mod_web_perm_index');
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
-t3lib_formprotection_Factory::get('t3lib_formprotection_BackendFormProtection')->persistTokens();
 
 ?>
index 3326879..1bcd41b 100644 (file)
@@ -513,6 +513,5 @@ foreach($SOBE->include_once as $INC_FILE)   include_once($INC_FILE);
 $SOBE->clearCache();
 $SOBE->main();
 $SOBE->printContent();
-t3lib_formprotection_Factory::get('t3lib_formprotection_BackendFormProtection')->persistTokens();
 
 ?>
index 729cf58..9329c5b 100755 (executable)
@@ -534,6 +534,5 @@ foreach($SOBE->include_once as $INC_FILE) {
 
 $SOBE->main();
 $SOBE->printContent();
-t3lib_formprotection_Factory::get('t3lib_formprotection_BackendFormProtection')->persistTokens();
 
 ?>
index 3a1a2e7..7b687cb 100755 (executable)
@@ -1854,6 +1854,4 @@ $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
 
-t3lib_formprotection_Factory::get('t3lib_formprotection_BackendFormProtection')->persistTokens();
-
 ?>
\ No newline at end of file
index 6b87fb1..c5a2ee5 100755 (executable)
@@ -749,10 +749,10 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                        // $BE_USER->isInWebMount() to check mount points.
                $mountpointList = $GLOBALS['BE_USER']->groupData['webmounts'];
                        // If there are DB mountpoints in the workspace record,
-                       // then only show the ones that are allowed there (and that are in the users' webmounts) 
+                       // then only show the ones that are allowed there (and that are in the users' webmounts)
                if (trim($wksp['db_mountpoints'])) {
                        $userMountpoints = explode(',', $mountpointList);
-                               // now filter the users' to only keep the mountpoints 
+                               // now filter the users' to only keep the mountpoints
                                // that are also in the workspaces' db_mountpoints
                        $workspaceMountpoints = explode(',', $wksp['db_mountpoints']);
                        $filteredMountpoints = array_intersect($userMountpoints, $workspaceMountpoints);
@@ -803,10 +803,10 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                        // $BE_USER->isInWebMount() to check mount points.
                $mountpointList = implode(',', $GLOBALS['BE_USER']->groupData['filemounts']);
                        // If there are file mountpoints in the workspace record,
-                       // then only show the ones that are allowed there (and that are in the users' file mounts) 
+                       // then only show the ones that are allowed there (and that are in the users' file mounts)
                if (trim($wksp['file_mountpoints'])) {
                        $userMountpoints = explode(',', $mountpointList);
-                               // now filter the users' to only keep the mountpoints 
+                               // now filter the users' to only keep the mountpoints
                                // that are also in the workspaces' file_mountpoints
                        $workspaceMountpoints = explode(',', $wksp['file_mountpoints']);
                        $filteredMountpoints = array_intersect($userMountpoints, $workspaceMountpoints);
@@ -1091,6 +1091,4 @@ $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
 
-t3lib_formprotection_Factory::get('t3lib_formprotection_BackendFormProtection')->persistTokens();
-
 ?>
\ No newline at end of file
index d76a8b3..cc6858a 100644 (file)
@@ -430,7 +430,6 @@ class template {
                                t3lib_BEfunc::getUrlToken('tceAction') .
                                '&prErr=1&uPT=1';
 
-               t3lib_formprotection_Factory::get('t3lib_formprotection_BackendFormProtection')->persistTokens();
                return $commandUrl;
        }
 
@@ -927,7 +926,7 @@ $str.=$this->docBodyTagBegin().
 
 <!-- Wrapping DIV-section for whole page END -->
 </div>':'') . $this->endOfPageJsBlock ;
-
+                       t3lib_formprotection_Factory::get('t3lib_formprotection_BackendFormProtection')->persistTokens();
                }
 
 
@@ -1570,7 +1569,6 @@ $str.=$this->docBodyTagBegin().
                $af_content = '<select name="cacheCmd" onchange="'.htmlspecialchars($onChange).'">'.implode('',$opt).'</select>';
 
                if (count($opt)>1)      {
-                       t3lib_formprotection_Factory::get('t3lib_formprotection_BackendFormProtection')->persistTokens();
                        return $af_content;
                }
        }
index 243f444..e37c6b4 100644 (file)
@@ -339,6 +339,5 @@ $SOBE = t3lib_div::makeInstance('SC_wizard_rte');
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
-t3lib_formprotection_Factory::get('t3lib_formprotection_BackendFormProtection')->persistTokens();
 
 ?>