From 4c224f1a2b5a668460e15b89b6e91a63fe801d13 Mon Sep 17 00:00:00 2001 From: Georg Ringer Date: Mon, 29 Oct 2012 23:41:32 +0100 Subject: [PATCH] [TASK] Improve Switch-User concept in ext:beuser The "Switch-User" functionality can be improved: * It should be possible to switch to other admin user, just not the current user * The title of the link is reintroduced * The order is as in previous TYPO3 version, switch-back-mode is the 2nd one Resolves: #42502 Releases: 6.0 Change-Id: I7d2a32d5682731798a0671715b2bbfac9a6eee77 Reviewed-on: http://review.typo3.org/16024 Reviewed-by: Helmut Hummel Tested-by: Helmut Hummel --- typo3/sysext/beuser/Classes/ViewHelpers/SUViewHelper.php | 4 ++-- .../sysext/beuser/Resources/Private/Language/locallang.xlf | 6 ++++++ .../Private/Partials/BackendUser/IndexListRow.html | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/typo3/sysext/beuser/Classes/ViewHelpers/SUViewHelper.php b/typo3/sysext/beuser/Classes/ViewHelpers/SUViewHelper.php index f91295fb619b..ae915bdc55ce 100755 --- a/typo3/sysext/beuser/Classes/ViewHelpers/SUViewHelper.php +++ b/typo3/sysext/beuser/Classes/ViewHelpers/SUViewHelper.php @@ -40,10 +40,10 @@ class SuViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper { * @return string */ public function render(\TYPO3\CMS\Beuser\Domain\Model\BackendUser $backendUser, $emulate = FALSE) { - if ($backendUser->getIsAdministrator()) { + if ($backendUser->getUid() == $GLOBALS['BE_USER']->user['uid']) { return ''; } - $title = $GLOBALS['LANG']->getLL('switchUserTo', TRUE) . ' ' . $backendUser->getUserName() . ' ' . $GLOBALS['LANG']->getLL('switchBackMode', TRUE); + $title = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(($emulate ? 'switchBackMode' : 'changeToMode'), 'beuser'); return '' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon(('actions-system-backend-user-' . ($emulate ? 'emulate' : 'switch'))) . ''; } diff --git a/typo3/sysext/beuser/Resources/Private/Language/locallang.xlf b/typo3/sysext/beuser/Resources/Private/Language/locallang.xlf index 32f3865269b2..5c484dd76100 100644 --- a/typo3/sysext/beuser/Resources/Private/Language/locallang.xlf +++ b/typo3/sysext/beuser/Resources/Private/Language/locallang.xlf @@ -114,6 +114,12 @@ Member of groups + + [change-to mode] + + + [switch-back mode] + \ No newline at end of file diff --git a/typo3/sysext/beuser/Resources/Private/Partials/BackendUser/IndexListRow.html b/typo3/sysext/beuser/Resources/Private/Partials/BackendUser/IndexListRow.html index febbbc0b6b26..1f04b15f7feb 100755 --- a/typo3/sysext/beuser/Resources/Private/Partials/BackendUser/IndexListRow.html +++ b/typo3/sysext/beuser/Resources/Private/Partials/BackendUser/IndexListRow.html @@ -44,8 +44,8 @@ Only admin users may use the backend user administration. - + -- 2.20.1