diff --git a/typo3/sysext/backend/Classes/Toolbar/ClearCacheToolbarItem.php b/typo3/sysext/backend/Classes/Toolbar/ClearCacheToolbarItem.php index 3ea426e3d3448dcb066a972e8277858860401cf0..3d2f0ec304da9ecdf11c9ad04c7820c004e59086 100644 --- a/typo3/sysext/backend/Classes/Toolbar/ClearCacheToolbarItem.php +++ b/typo3/sysext/backend/Classes/Toolbar/ClearCacheToolbarItem.php @@ -100,7 +100,9 @@ class ClearCacheToolbarItem implements ToolbarItemHookInterface { // Clearing of system cache (core cache, class cache etc) // is only shown explicitly if activated for a BE-user (not activated for admins by default) // or if the system runs in development mode - if ($backendUser->getTSConfigVal('options.clearCache.system') || GeneralUtility::getApplicationContext()->isDevelopment()) { + // or if $GLOBALS['TYPO3_CONF_VARS']['SYS']['clearCacheSystem'] is set (only for admins) + if ($backendUser->getTSConfigVal('options.clearCache.system') || GeneralUtility::getApplicationContext()->isDevelopment() + || ((bool) $GLOBALS['TYPO3_CONF_VARS']['SYS']['clearCacheSystem'] === TRUE && $backendUser->isAdmin())) { $this->cacheActions[] = array( 'id' => 'system', 'title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:flushSystemCachesTitle', TRUE), diff --git a/typo3/sysext/core/Classes/DataHandling/DataHandler.php b/typo3/sysext/core/Classes/DataHandling/DataHandler.php index b7f5284c70c37878f55afed8ed213659bfc39dc7..41f93e2fb11159fb704cf02f2f4800ca63d9338a 100644 --- a/typo3/sysext/core/Classes/DataHandling/DataHandler.php +++ b/typo3/sysext/core/Classes/DataHandling/DataHandler.php @@ -7166,7 +7166,8 @@ class DataHandler { break; case 'temp_cached': case 'system': - if ($this->admin || $this->BE_USER->getTSConfigVal('options.clearCache.system')) { + if ($this->admin || $this->BE_USER->getTSConfigVal('options.clearCache.system') + || ((bool) $GLOBALS['TYPO3_CONF_VARS']['SYS']['clearCacheSystem'] === TRUE && $this->admin)) { GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager')->flushCachesInGroup('system'); } break; diff --git a/typo3/sysext/core/Configuration/DefaultConfiguration.php b/typo3/sysext/core/Configuration/DefaultConfiguration.php index 0d6556a565ce138abff192c2e4cf5288ea0d4586..86abdeab99f1a5bf3fc612be4d22367a54a40449 100644 --- a/typo3/sysext/core/Configuration/DefaultConfiguration.php +++ b/typo3/sysext/core/Configuration/DefaultConfiguration.php @@ -256,6 +256,7 @@ return array( ) ), 'isInitialInstallationInProgress' => FALSE, // Boolean: If TRUE, the installation is 'in progress'. This value is handled within the install tool step installer internally. + 'clearCacheSystem' => FALSE, // Boolean: If set, the toolbar menu entry for clearing system caches (core cache, class cache, etc.) is visible for admin users. ), 'EXT' => array( // Options related to the Extension Management 'allowGlobalInstall' => FALSE, // Boolean: If set, global extensions in typo3/ext/ are allowed to be installed, updated and deleted etc. diff --git a/typo3/sysext/install/Classes/Configuration/Context/CustomPreset.php b/typo3/sysext/install/Classes/Configuration/Context/CustomPreset.php index a7c24466d736c60bb222a524856a344aeadc9cbb..351a413ea9b7ee3ec4f4759586b824728caef2d7 100644 --- a/typo3/sysext/install/Classes/Configuration/Context/CustomPreset.php +++ b/typo3/sysext/install/Classes/Configuration/Context/CustomPreset.php @@ -42,5 +42,6 @@ class CustomPreset extends Configuration\AbstractCustomPreset implements Configu 'SYS/enableDeprecationLog' => '', 'SYS/sqlDebug' => '', 'SYS/systemLogLevel' => '', + 'SYS/clearCacheSystem' => '', ); } diff --git a/typo3/sysext/install/Classes/Configuration/Context/DevelopmentPreset.php b/typo3/sysext/install/Classes/Configuration/Context/DevelopmentPreset.php index 2a8bce66ce948621d217c3053765b1e29de43689..000608f6c38642088da758065dbddd2ffd0e7c3b 100644 --- a/typo3/sysext/install/Classes/Configuration/Context/DevelopmentPreset.php +++ b/typo3/sysext/install/Classes/Configuration/Context/DevelopmentPreset.php @@ -54,6 +54,7 @@ class DevelopmentPreset extends Configuration\AbstractPreset { 'SYS/systemLogLevel' => 0, // E_WARNING | E_RECOVERABLE_ERROR | E_DEPRECATED | E_USER_DEPRECATED 'SYS/exceptionalErrors' => 28674, + 'SYS/clearCacheSystem' => TRUE, ); /** diff --git a/typo3/sysext/install/Classes/Configuration/Context/ProductionPreset.php b/typo3/sysext/install/Classes/Configuration/Context/ProductionPreset.php index 7b79153531ecf65aee5d3a202ab7d11a540f44b3..6a7332f8e5af1b56737538c60182ca8f3e035a4f 100644 --- a/typo3/sysext/install/Classes/Configuration/Context/ProductionPreset.php +++ b/typo3/sysext/install/Classes/Configuration/Context/ProductionPreset.php @@ -52,6 +52,7 @@ class ProductionPreset extends Configuration\AbstractPreset { 'SYS/enableDeprecationLog' => FALSE, 'SYS/sqlDebug' => 0, 'SYS/systemLogLevel' => 2, + 'SYS/clearCacheSystem' => FALSE, ); /**