Project

General

Profile

Bug #91594 » patch.txt

Danilo Caccialanza, 2020-06-05 09:57

 
protected function initializeDbMountpointsInWorkspace()
{
$dbMountpoints = trim($this->workspaceRec['db_mountpoints'] ?? '');
if ($this->workspace > 0 && $dbMountpoints != '') {
$filteredDbMountpoints = [];
// Notice: We cannot call $this->getPagePermsClause(1);
// as usual because the group-list is not available at this point.
// But bypassing is fine because all we want here is check if the
// workspace mounts are inside the current webmounts rootline.
// The actual permission checking on page level is done elsewhere
// as usual anyway before the page tree is rendered.
$readPerms = '1=1';
// Traverse mount points of the
// PATCH begin
$wsWebmounts = implode(',', GeneralUtility::intExplode(',', $this->workspaceRec['db_mountpoints']));
$userMounts = $this->dataLists['webmount_list'];
$wsArr = GeneralUtility::intExplode(',', $wsWebmounts);
$userArrTemp = GeneralUtility::intExplode(',', $userMounts);
$userArr = array();
if (is_array($userArrTemp) && count($userArrTemp) > 0) {
foreach ($userArrTemp as $userPage) {
$rL = BackendUtility::BEgetRootLine($userPage);
if (is_array($rL) && count($rL)) {
$rPages = array();
foreach ($rL as $rPage)
$rPages[] = $rPage['uid'];
if (is_array($wsArr) && count($wsArr) > 0) {
$valore = array(
$wsArr[0]
);
if (is_array($rPages) && in_array($rPages, $valore)) {
$userArr[] = $userPage;
}
}
}
}
$resultArr = array_unique(array_merge($userArr, array_intersect($wsArr, $userArrTemp)));
$webmountUidList = implode(',', $resultArr);
}
$dbMountpoints = GeneralUtility::intExplode(',', $webmountUidList);
foreach ($dbMountpoints as $mpId) {
if ($mpId > 0 && $this->isInWebMount($mpId, $readPerms)) {
$filteredDbMountpoints[] = $mpId;
}
}
// PATCH end
// Re-insert webmounts:
$filteredDbMountpoints = array_unique($filteredDbMountpoints);
$this->groupData['webmounts'] = implode(',', $filteredDbMountpoints);
}
}
(2-2/2)