Bug #23241 » 15189.diff
t3lib/class.t3lib_frontendedit.php (working copy) | ||
---|---|---|
// Unless permissions specifically allow it, editing is not allowed.
|
||
$mayEdit = false;
|
||
if ($table=='pages') {
|
||
// 2 = permission to edit the page
|
||
if ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->doesUserHaveAccess($dataArray, 2)) {
|
||
$mayEdit = true;
|
||
if ($GLOBALS['BE_USER']->recordEditAccessInternals($table, $dataArray)) {
|
||
if ($table=='pages') {
|
||
// 2 = permission to edit the page
|
||
if ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->doesUserHaveAccess($dataArray, 2)) {
|
||
$mayEdit = true;
|
||
}
|
||
} else {
|
||
// 16 = permission to edit content on the page
|
||
if ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->doesUserHaveAccess(t3lib_BEfunc::getRecord('pages', $dataArray['pid']), 16)) {
|
||
$mayEdit = true;
|
||
}
|
||
}
|
||
} else {
|
||
// 16 = permission to edit content on the page
|
||
if ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->doesUserHaveAccess(t3lib_BEfunc::getRecord('pages', $dataArray['pid']), 16)) {
|
||
$mayEdit = true;
|
||
}
|
||
}
|
||
if (!$conf['onlyCurrentPid'] || ($dataArray['pid'] == $GLOBALS['TSFE']->id)) {
|
||
// Permissions:
|
||
$types = t3lib_div::trimExplode(',', t3lib_div::strtolower($conf['allow']),1);
|
||
$allow = array_flip($types);
|
||
if (!$conf['onlyCurrentPid'] || ($dataArray['pid'] == $GLOBALS['TSFE']->id)) {
|
||
// Permissions:
|
||
$types = t3lib_div::trimExplode(',', t3lib_div::strtolower($conf['allow']),1);
|
||
$allow = array_flip($types);
|
||
$perms = $GLOBALS['BE_USER']->calcPerms($GLOBALS['TSFE']->page);
|
||
if ($table == 'pages') {
|
||
$allow = $this->getAllowedEditActions($table, $conf, $dataArray['pid'], $allow);
|
||
$perms = $GLOBALS['BE_USER']->calcPerms($GLOBALS['TSFE']->page);
|
||
if ($table == 'pages') {
|
||
$allow = $this->getAllowedEditActions($table, $conf, $dataArray['pid'], $allow);
|
||
// Can only display editbox if there are options in the menu
|
||
if (count($allow)) {
|
||
$mayEdit = true;
|
||
// Can only display editbox if there are options in the menu
|
||
if (count($allow)) {
|
||
$mayEdit = true;
|
||
}
|
||
} else {
|
||
$mayEdit = count($allow) && ($perms & 16);
|
||
}
|
||
} else {
|
||
$mayEdit = count($allow) && ($perms & 16);
|
||
}
|
||
}
|
||