Bug #18250 » 20080219_checkAccessClearCache.diff
t3lib/class.t3lib_userauthgroup.php (working copy) | ||
---|---|---|
var $checkWorkspaceCurrent_cache=NULL; // Cache for checkWorkspaceCurrent()
|
||
var $allowClearCache=false; // flag for clearing cache rights
|
||
... | ... | |
/************************************
|
||
*
|
||
* Permission checking functions:
|
||
... | ... | |
$this->dataLists['webmount_list'] = $this->user['db_mountpoints']; // Database mountpoints
|
||
$this->dataLists['filemount_list'] = $this->user['file_mountpoints']; // File mountpoints
|
||
$this->allowClearCache = $this->user['allow_clear_cache'];
|
||
|
||
// Setting default User TSconfig:
|
||
$this->TSdataArray[]=$this->addTScomment('From $GLOBALS["TYPO3_CONF_VARS"]["BE"]["defaultUserTSconfig"]:').
|
||
$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultUserTSconfig'];
|
||
... | ... | |
}
|
||
$this->groupData['webmounts'] = implode(',',$webmounts); // Implode mounts in the end.
|
||
}
|
||
|
||
|
||
// Setting up workspace situation (after webmounts are processed!):
|
||
$this->workspaceInit();
|
||
}
|
||
... | ... | |
if (!strcmp($idList,'') && !$this->firstMainGroup) {
|
||
$this->firstMainGroup=$uid;
|
||
}
|
||
|
||
$this->allowClearCache = $this->allowClearCache | $row['allow_clear_cache'];
|
||
}
|
||
}
|
||
t3lib/stddb/tables.sql (working copy) | ||
---|---|---|
subgroup varchar(255) DEFAULT '' NOT NULL,
|
||
hide_in_lists tinyint(4) DEFAULT '0' NOT NULL,
|
||
workspace_perms tinyint(3) DEFAULT '1' NOT NULL,
|
||
allow_clear_cache tinyint(4) DEFAULT '0' NOT NULL,
|
||
PRIMARY KEY (uid),
|
||
KEY parent (pid)
|
||
);
|
||
... | ... | |
usergroup_cached_list varchar(255) DEFAULT '' NOT NULL,
|
||
workspace_id int(11) DEFAULT '0' NOT NULL,
|
||
workspace_preview tinyint(3) DEFAULT '1' NOT NULL,
|
||
allow_clear_cache tinyint(4) DEFAULT '0' NOT NULL,
|
||
PRIMARY KEY (uid),
|
||
KEY parent (pid),
|
||
KEY username (username)
|
t3lib/stddb/tbl_be.php (working copy) | ||
---|---|---|
),
|
||
'defaultExtras' => 'fixed-font : enable-tab',
|
||
),
|
||
'allow_clear_cache' => array(
|
||
'label' => 'LLL:EXT:lang/locallang_tca.xml:be_groups.allow_clear_cache',
|
||
'config' => array(
|
||
'type' => 'check',
|
||
'default' => 0
|
||
)
|
||
),
|
||
'createdByAction' => array('config' => array('type' => 'passthrough'))
|
||
),
|
||
'types' => array(
|
||
'0' => array('showitem' => 'username;;;;2-2-2, password, usergroup, lockToDomain, disableIPlock, admin;;;;5-5-5, realName;;;;3-3-3, email, lang, userMods;;;;4-4-4, allowed_languages, workspace_perms, options, db_mountpoints, file_mountpoints, fileoper_perms, --div--, TSconfig;;;;5-5-5'),
|
||
'1' => array('showitem' => 'username;;;;2-2-2, password, usergroup, disableIPlock, admin;;;;5-5-5, realName;;;;3-3-3, email, lang, options;;;;4-4-4, allowed_languages, db_mountpoints, file_mountpoints, fileoper_perms, --div--, TSconfig;;;;5-5-5')
|
||
'0' => array('showitem' => 'username;;;;2-2-2, password, usergroup, lockToDomain, disableIPlock, admin;;;;5-5-5, realName;;;;3-3-3, email, lang, userMods;;;;4-4-4, allowed_languages, workspace_perms, options, db_mountpoints, file_mountpoints, fileoper_perms, --div--, TSconfig;;;;5-5-5,allow_clear_cache'),
|
||
'1' => array('showitem' => 'username;;;;2-2-2, password, usergroup, disableIPlock, admin;;;;5-5-5, realName;;;;3-3-3, email, lang, options;;;;4-4-4, allowed_languages, db_mountpoints, file_mountpoints, fileoper_perms, --div--, TSconfig;;;;5-5-5,allow_clear_cache')
|
||
),
|
||
'palettes' => array(
|
||
'1' => array('showitem' => 'disable, starttime, endtime')
|
||
... | ... | |
'renderMode' => $GLOBALS['TYPO3_CONF_VARS']['BE']['accessListRenderMode'],
|
||
'iconsInOptionTags' => 1,
|
||
)
|
||
)
|
||
),
|
||
'allow_clear_cache' => array(
|
||
'label' => 'LLL:EXT:lang/locallang_tca.xml:be_groups.allow_clear_cache',
|
||
'config' => array(
|
||
'type' => 'check',
|
||
'default' => 0
|
||
)
|
||
),
|
||
),
|
||
'types' => array(
|
||
'0' => array('showitem' => 'hidden;;;;1-1-1, title;;;;2-2-2,description, subgroup;;;;3-3-3, --div--;LLL:EXT:lang/locallang_tca.xml:be_groups.tabs.base_rights, inc_access_lists;;;;1-1-1, --div--;LLL:EXT:lang/locallang_tca.xml:be_groups.tabs.mounts_and_workspaces, db_mountpoints;;;;1-1-1,file_mountpoints, workspace_perms;;;;2-2-2, , --div--;LLL:EXT:lang/locallang_tca.xml:be_groups.tabs.options, lockToDomain;;;;1-1-1, hide_in_lists;;;;2-2-2, TSconfig;;;;3-3-3, --div--;LLL:EXT:lang/locallang_tca.xml:be_groups.tabs.extended'),
|
||
'1' => array('showitem' => 'hidden;;;;1-1-1, title;;;;2-2-2,description, subgroup;;;;3-3-3, --div--;LLL:EXT:lang/locallang_tca.xml:be_groups.tabs.base_rights, inc_access_lists;;;;1-1-1, groupMods, tables_select, tables_modify, pagetypes_select, non_exclude_fields, explicit_allowdeny , allowed_languages;;;;2-2-2, custom_options;;;;3-3-3, --div--;LLL:EXT:lang/locallang_tca.xml:be_groups.tabs.mounts_and_workspaces, db_mountpoints;;;;1-1-1,file_mountpoints, workspace_perms;;;;2-2-2, --div--;LLL:EXT:lang/locallang_tca.xml:be_groups.tabs.options, lockToDomain;;;;1-1-1, hide_in_lists;;;;2-2-2, TSconfig;;;;3-3-3, --div--;LLL:EXT:lang/locallang_tca.xml:be_groups.tabs.extended')
|
||
'0' => array('showitem' => 'hidden;;;;1-1-1, title;;;;2-2-2,description, subgroup;;;;3-3-3, --div--;LLL:EXT:lang/locallang_tca.xml:be_groups.tabs.base_rights, inc_access_lists;;;;1-1-1, --div--;LLL:EXT:lang/locallang_tca.xml:be_groups.tabs.mounts_and_workspaces, db_mountpoints;;;;1-1-1,file_mountpoints, workspace_perms;;;;2-2-2, , --div--;LLL:EXT:lang/locallang_tca.xml:be_groups.tabs.options, lockToDomain;;;;1-1-1, hide_in_lists;;;;2-2-2, allow_clear_cache, TSconfig;;;;3-3-3, --div--;LLL:EXT:lang/locallang_tca.xml:be_groups.tabs.extended'),
|
||
'1' => array('showitem' => 'hidden;;;;1-1-1, title;;;;2-2-2,description, subgroup;;;;3-3-3, --div--;LLL:EXT:lang/locallang_tca.xml:be_groups.tabs.base_rights, inc_access_lists;;;;1-1-1, groupMods, tables_select, tables_modify, pagetypes_select, non_exclude_fields, explicit_allowdeny , allowed_languages;;;;2-2-2, custom_options;;;;3-3-3, --div--;LLL:EXT:lang/locallang_tca.xml:be_groups.tabs.mounts_and_workspaces, db_mountpoints;;;;1-1-1,file_mountpoints, workspace_perms;;;;2-2-2, --div--;LLL:EXT:lang/locallang_tca.xml:be_groups.tabs.options, lockToDomain;;;;1-1-1, hide_in_lists;;;;2-2-2, allow_clear_cache, TSconfig;;;;3-3-3, --div--;LLL:EXT:lang/locallang_tca.xml:be_groups.tabs.extended')
|
||
)
|
||
);
|
||
... | ... | |
)
|
||
);
|
||
?>
|
||
?>
|
typo3/classes/class.clearcachemenu.php (working copy) | ||
---|---|---|
);
|
||
// Clearing of cache-files in typo3conf/ + menu
|
||
if ($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.clearCache_allTypo3Conf');
|
||
$this->cacheActions[] = array(
|
||
'id' => 'temp_CACHED',
|
||
... | ... | |
* @return boolean true if user has access, false if not
|
||
*/
|
||
public function checkAccess() {
|
||
// FIXME - needs proper access check
|
||
return true;
|
||
return ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->allowClearCache);
|
||
}
|
||
/**
|
||
... | ... | |
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/classes/class.clearcachemenu.php']);
|
||
}
|
||
?>
|
||
?>
|
typo3/sysext/lang/locallang_tca.xml (working copy) | ||
---|---|---|
<label index="be_groups.tabs.base_rights">Access Lists</label>
|
||
<label index="be_groups.tabs.mounts_and_workspaces">Mounts and Workspaces</label>
|
||
<label index="be_groups.tabs.options">Options</label>
|
||
<label index="be_groups.tabs.extended">Extended</label>
|
||
<label index="be_groups.tabs.extended">Extended</label>
|
||
<label index="be_groups.allow_clear_cache">Allow clear cache</label>
|
||
<label index="sys_filemounts.title">Label:</label>
|
||
<label index="sys_filemounts.path">Path:</label>
|
||
<label index="sys_filemounts.base">Base:</label>
|
||
... | ... | |
<label index="editlock">Restrict editing by non-Admins:</label>
|
||
</languageKey>
|
||
</data>
|
||
</T3locallang>
|
||
</T3locallang>
|