[TYPO3-core] another FE editing issue

Martin Kutschker Martin.Kutschker at blackbox.net
Sat Mar 25 19:58:18 CET 2006


Michael Stucki <michael at typo3.org> writes on 
Sat, 25 Mar 2006 18:15:23 +0100 (MET):

> Hi Martin,
> 
> 
> > The edit panel and edit icons were always shown. With or without
> > access
> > rights to the language. I hide them now when the user has no
> > rights.
> > 
> > At the top of this methods I've added
> > $BE_USER->checkLanguageAccess()
> > 
> > tslib_cObj->editPanel()
> > tslib_cObj->editIcons()
> > 
> > Note that I check with sys_language_uid (also for the admin panel).
> > Should
> > I have used sys_language_content?
> 
> I don't think so. Leave it as it is.


Thinking about it (with a hint from Kasper per PM) the correct code is this. For tslib_cObj->editPanel():

if ($table == 'tt_content') {
$lang = $GLOBALS['TSFE']->sys_language_content;
} elseif ($TCA[$table]['ctrl']['languageField']) {
$lang = $currentRecord[$TCA[$table]['ctrl']['languageField']];
} else {
$lang = -1;
}
if (!$BE_USER->checkLanguageAccess($GLOBALS['TSFE']->sys_language_uid)) {
return $content;
}

So the edit panel is only shown, when the BE user has access right to the language of the *record*.


> A note besides that: Even if those "one-liners" are often small
> things, they can still contain very harmful changes.
> In any case, please always send a patch to this list, so we can review
> it easily. Thanks!


Ok.

Masi




More information about the TYPO3-team-core mailing list