+2008-03-15 Ingo Renner <ingo@typo3.org>
+
+ * Added follow up to #7588: Accesscheck for clearCache, credits Steffen Kamper
+
2008-03-15 Stanislas Rolland <typo3@sjbr.ca>
* Fixed bug #7857: htmlArea RTE: hidePStyleItems does not work anymore
$alt_menuObj = t3lib_div::makeInstance('alt_menu_functions');
$this->content.= $alt_menuObj->topMenu($this->loadModules->modules);
- // clear cache commands for Admins
- if($BE_USER->isAdmin()) { // && $BE_USER->workspace===0 NOT used anyway because under a workspace developers might still like to clear cache!
+ // clear cache commands for Admins and allowed users
+ if($GLOBALS['BE_USER']->isAdmin()
+ || $GLOBALS['BE_USER']->getTSConfigVal('options.clearCache.pages')
+ || $GLOBALS['BE_USER']->getTSConfigVal('options.clearCache.all')) { // && $BE_USER->workspace===0 NOT used anyway because under a workspace developers might still like to clear cache!
$functionsArray = $alt_menuObj->adminFunctions($backPath);
$this->content.='
</tr>';
$rows=array();
- foreach($functionsArray as $functionsArraySetup) {
- $rows[]='
- <tr class="c-subitem">
- <td valign="top" align="center" class="icon">'.$functionsArraySetup['icon'].'</td>
- <td><a href="'.htmlspecialchars($functionsArraySetup['href']).'">'.htmlspecialchars($functionsArraySetup['title']).'</a></td>
- </tr>';
+ foreach($functionsArray as $functionsArraySetup) {
+ if(($functionsArraySetup['id'] == 'all' && ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->getTSConfigVal('options.clearCache.all')))
+ || ($functionsArraySetup['id'] == 'temp_CACHED' && $GLOBALS['BE_USER']->isAdmin())) {
+ $rows[]='
+ <tr class="c-subitem">
+ <td valign="top" align="center" class="icon">'.$functionsArraySetup['icon'].'</td>
+ <td><a href="'.htmlspecialchars($functionsArraySetup['href']).'">'.htmlspecialchars($functionsArraySetup['title']).'</a></td>
+ </tr>';
+ }
}
// Imploding around the divider table row:
'icon' => '<img'.t3lib_iconWorks::skinImg($this->backPath, 'gfx/lightning_red.png', 'width="16" height="16"').' title="'.htmlspecialchars($title).'" alt="" />'
);
}
+
// Clear cache for either ALL pages
if($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->getTSConfigVal('options.clearCache.pages')) {
$title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:rm.clearCacheMenu_pages');
}
// Clearing of cache-files in typo3conf/ + menu
- if ($GLOBALS['BE_USER']->isAdmin() && $GLOBALS['TYPO3_CONF_VARS']['EXT']['extCache']) {
+ if($GLOBALS['BE_USER']->isAdmin() && $GLOBALS['TYPO3_CONF_VARS']['EXT']['extCache']) {
$title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:rm.clearCacheMenu_allTypo3Conf');
$this->cacheActions[] = array(
'id' => 'temp_CACHED',
* @return boolean true if user has access, false if not
*/
public function checkAccess() {
- return ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->getTSConfigVal('options.clearCache.pages') || $GLOBALS['BE_USER']->getTSConfigVal('options.clearCache.pages'));
+ return (
+ $GLOBALS['BE_USER']->isAdmin()
+ || $GLOBALS['BE_USER']->getTSConfigVal('options.clearCache.pages')
+ || $GLOBALS['BE_USER']->getTSConfigVal('options.clearCache.all')
+ );
}
/**