Skip to content

Commit

Permalink
[TASK] Remove unused internal methods in BackendUtility
Browse files Browse the repository at this point in the history
The internal methods
* BackendUtility::blindUserNames()
* BackendUtility::blindGroupNames()
* BackendUtility::getBackendScript()
are not in use anymore by TYPO3 Core and are removed.

Also fix Breaking-91473-DeprecatedFunctionalityRemoved.rst
to not reference BackendUtility::getBackendScript() as
breaking removal, as it was an internal method.

Resolves: #93001
Releases: master
Change-Id: Icd280dada15b99266dd6542f8b256f03dc3c992a
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/67037
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Benjamin Franzke <bfr@qbus.de>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Benjamin Franzke <bfr@qbus.de>
  • Loading branch information
bmack authored and bnf committed Dec 7, 2020
1 parent d52baab commit 42f7fa6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 89 deletions.
88 changes: 0 additions & 88 deletions typo3/sysext/backend/Classes/Utility/BackendUtility.php
Expand Up @@ -819,71 +819,6 @@ protected static function getRecordsSortedByTitle(array $fields, $table, $titleF
return ArrayUtility::sortArraysByKey($result, $titleField);
}

/**
* Returns the array $usernames with the names of all users NOT IN $groupArray changed to the uid (hides the usernames!).
* If $excludeBlindedFlag is set, then these records are unset from the array $usernames
* Takes $usernames (array made by \TYPO3\CMS\Backend\Utility\BackendUtility::getUserNames()) and a $groupArray (array with the groups a certain user is member of) as input
*
* @param array $usernames User names
* @param array $groupArray Group names
* @param bool $excludeBlindedFlag If $excludeBlindedFlag is set, then these records are unset from the array $usernames
* @return array User names, blinded
* @internal
*/
public static function blindUserNames($usernames, $groupArray, $excludeBlindedFlag = false)
{
if (is_array($usernames) && is_array($groupArray)) {
foreach ($usernames as $uid => $row) {
$userN = $uid;
$set = 0;
if ($row['uid'] != static::getBackendUserAuthentication()->user['uid']) {
foreach ($groupArray as $v) {
if ($v && GeneralUtility::inList($row['usergroup_cached_list'], $v)) {
$userN = $row['username'];
$set = 1;
}
}
} else {
$userN = $row['username'];
$set = 1;
}
$usernames[$uid]['username'] = $userN;
if ($excludeBlindedFlag && !$set) {
unset($usernames[$uid]);
}
}
}
return $usernames;
}

/**
* Corresponds to blindUserNames but works for groups instead
*
* @param array $groups Group names
* @param array $groupArray Group names (reference)
* @param bool $excludeBlindedFlag If $excludeBlindedFlag is set, then these records are unset from the array $usernames
* @return array
* @internal
*/
public static function blindGroupNames($groups, $groupArray, $excludeBlindedFlag = false)
{
if (is_array($groups) && is_array($groupArray)) {
foreach ($groups as $uid => $row) {
$groupN = $uid;
$set = 0;
if (in_array($uid, $groupArray, false)) {
$groupN = $row['title'];
$set = 1;
}
$groups[$uid]['title'] = $groupN;
if ($excludeBlindedFlag && !$set) {
unset($groups[$uid]);
}
}
}
return $groups;
}

/*******************************************
*
* Output related
Expand Down Expand Up @@ -3688,29 +3623,6 @@ public static function ADMCMD_previewCmds($pageInfo, Context $context)
return $simUser . $simTime;
}

/**
* Returns the name of the backend script relative to the TYPO3 main directory.
*
* @param string $interface Name of the backend interface (backend, frontend) to look up the script name for. If no interface is given, the interface for the current backend user is used.
* @return string The name of the backend script relative to the TYPO3 main directory.
* @internal should only be used from within TYPO3 Core
*/
public static function getBackendScript($interface = '')
{
if (!$interface) {
$interface = static::getBackendUserAuthentication()->uc['interfaceSetup'];
}
switch ($interface) {
case 'frontend':
$script = '../.';
break;
case 'backend':
default:
$script = (string)GeneralUtility::makeInstance(UriBuilder::class)->buildUriFromRoute('main');
}
return $script;
}

/**
* Determines whether a table is enabled for workspaces.
*
Expand Down
Expand Up @@ -101,7 +101,6 @@ The following PHP static class methods that have been previously deprecated for
- :php:`\TYPO3\CMS\Backend\Utility\BackendUtility::getRawPagesTSconfig`
- :php:`\TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick`
- :php:`\TYPO3\CMS\Backend\Utility\BackendUtility::getViewDomain`
- :php:`\TYPO3\CMS\Backend\Utility\BackendUtility::getBackendScript`
- :php:`\TYPO3\CMS\Backend\Utility\BackendUtility::TYPO3_copyRightNotice`
- :php:`\TYPO3\CMS\Core\Localization\Locales::initialize`
- :php:`\TYPO3\CMS\Core\Utility\GeneralUtility::compressIPv6`
Expand Down

0 comments on commit 42f7fa6

Please sign in to comment.