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
* @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 '<a href="' . \TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript(array('SwitchUser' => $backendUser->getUid(), 'switchBackUser' => $emulate)) . '" target="_top" title="' . htmlspecialchars($title) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon(('actions-system-backend-user-' . ($emulate ? 'emulate' : 'switch'))) . '</a>';
}
<trans-unit id="backendUserGroups" xml:space="preserve">
<source>Member of groups</source>
</trans-unit>
+ <trans-unit id="changeToMode" xml:space="preserve">
+ <source>[change-to mode]</source>
+ </trans-unit>
+ <trans-unit id="switchBackMode" xml:space="preserve">
+ <source>[switch-back mode]</source>
+ </trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
Only admin users may use the backend user administration.
</f:comment>
<f:if condition="{backendUser.active} == 1">
- <bu:SU backendUser="{backendUser}" emulate="TRUE" />
<bu:SU backendUser="{backendUser}" emulate="FALSE" />
+ <bu:SU backendUser="{backendUser}" emulate="TRUE" />
</f:if>
</td>
<td>