Commit 42f7fa6b authored by Benni Mack's avatar Benni Mack Committed by Benjamin Franzke
Browse files

[TASK] Remove unused internal methods in BackendUtility

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: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: Benjamin Franzke's avatarBenjamin Franzke <bfr@qbus.de>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Benjamin Franzke's avatarBenjamin Franzke <bfr@qbus.de>
parent d52baab2
......@@ -819,71 +819,6 @@ class BackendUtility
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
......@@ -3688,29 +3623,6 @@ class BackendUtility
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.
*
......
......@@ -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`
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment