From 686be53c5ab8e90b6609e61ceac2dd91ccb57411 Mon Sep 17 00:00:00 2001 From: Toben Schmidt Date: Fri, 28 Jul 2017 15:35:45 +0200 Subject: [PATCH] [TASK] Remove remains of db mountpoint functionality The function "Create Backend User" provided by system extension sys_action once allowed to set a db mountpoint for backend users created this way. This has been removed a while ago. Yet there are some remains that are not only unneccessary but prevent to inherit the db mountpoint from the template backend user. --- typo3/sysext/sys_action/Classes/ActionTask.php | 31 -------------------------- 1 file changed, 31 deletions(-) diff --git a/typo3/sysext/sys_action/Classes/ActionTask.php b/typo3/sysext/sys_action/Classes/ActionTask.php index 490bdd116f..2a88dcaced 100644 --- a/typo3/sysext/sys_action/Classes/ActionTask.php +++ b/typo3/sysext/sys_action/Classes/ActionTask.php @@ -547,8 +547,6 @@ protected function action_linkUserName($username, $realName, $sysActionUid, $use */ protected function saveNewBackendUser($record, $vars) { - // Check if the db mount is a page the current user is allowed to.); - $vars['db_mountpoints'] = $this->fixDbMount($vars['db_mountpoints']); // Check if the usergroup is allowed $vars['usergroup'] = $this->fixUserGroup($vars['usergroup'], $record); $key = $vars['key']; @@ -571,7 +569,6 @@ protected function saveNewBackendUser($record, $vars) $data['be_users'][$key]['disable'] = (int)$vars['disable']; $data['be_users'][$key]['admin'] = 0; $data['be_users'][$key]['usergroup'] = $vars['usergroup']; - $data['be_users'][$key]['db_mountpoints'] = $vars['db_mountpoints']; $data['be_users'][$key]['createdByAction'] = $record['uid']; } } else { @@ -588,7 +585,6 @@ protected function saveNewBackendUser($record, $vars) $data['be_users'][$key]['disable'] = (int)$vars['disable']; $data['be_users'][$key]['admin'] = 0; $data['be_users'][$key]['usergroup'] = $vars['usergroup']; - $data['be_users'][$key]['db_mountpoints'] = $vars['db_mountpoints']; $newUserId = $key; } } @@ -652,33 +648,6 @@ protected function fixUserGroup($appliedUsergroups, $actionRecord) } /** - * Clean the to be applied DB-Mounts from not allowed ones - * - * @param string $appliedDbMounts List of pages like pages_123,pages456 - * @return string Cleaned list - */ - protected function fixDbMount($appliedDbMounts) - { - // Admins can see any page, no need to check there - if (!empty($appliedDbMounts) && !$this->getBackendUser()->isAdmin()) { - $cleanDbMountList = []; - $dbMounts = GeneralUtility::trimExplode(',', $appliedDbMounts, true); - // Walk through every wanted DB-Mount and check if it allowed for the current user - foreach ($dbMounts as $dbMount) { - $uid = (int)substr($dbMount, strrpos($dbMount, '_') + 1); - $page = BackendUtility::getRecord('pages', $uid); - // Check rootline and access rights - if ($this->checkRootline($uid) && $this->getBackendUser()->calcPerms($page)) { - $cleanDbMountList[] = 'pages_' . $uid; - } - } - // Build the clean list - $appliedDbMounts = implode(',', $cleanDbMountList); - } - return $appliedDbMounts; - } - - /** * Check if a page is inside the rootline the current user can see * * @param int $pageId Id of the the page to be checked