[TASK] Return to "Admin Tools > User Admin" when exiting simulated BE User 89/28689/3
authorPascal Dürsteler <pascal.duersteler@gmail.com>
Mon, 24 Mar 2014 08:05:14 +0000 (09:05 +0100)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Sat, 5 Apr 2014 11:58:59 +0000 (13:58 +0200)
When exiting a simulated BE user, you return to the backend user module
instead of the default startup page.

Resolves: #22020
Releases: 6.2
Change-Id: I8de7b6f79e6ddb9bc03f62364f3246ef13a4ddf3
Reviewed-on: https://review.typo3.org/28689
Reviewed-by: Markus Klein
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/sysext/beuser/Classes/Controller/BackendUserController.php
typo3/sysext/beuser/Classes/Hook/SwitchBackUserHook.php

index eb2355d..19255e6 100644 (file)
@@ -220,6 +220,10 @@ class BackendUserController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionCont
                        // User switchback or replace current session?
                        if ($switchBack) {
                                $updateData['ses_backuserid'] = (int)$GLOBALS['BE_USER']->user['uid'];
+
+                               // Set backend user listing module as starting module for switchback
+                               $GLOBALS['BE_USER']->uc['startModuleOnFirstLogin'] = 'system_BeuserTxBeuser';
+                               $GLOBALS['BE_USER']->writeUC();
                        }
 
                        $whereClause = 'ses_id=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($GLOBALS['BE_USER']->id, 'be_sessions');
@@ -231,6 +235,7 @@ class BackendUserController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionCont
                                $whereClause,
                                $updateData
                        );
+
                        $redirectUrl = $GLOBALS['BACK_PATH'] . 'index.php' . ($GLOBALS['TYPO3_CONF_VARS']['BE']['interfaces'] ? '' : '?commandLI=1');
                        \TYPO3\CMS\Core\Utility\HttpUtility::redirect($redirectUrl);
                }
index 9ab6b98..891688d 100644 (file)
@@ -50,9 +50,7 @@ class SwitchBackUserHook {
                        $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
                        $backendUserSessionRepository = $objectManager->get('TYPO3\\CMS\\Beuser\\Domain\\Repository\\BackendUserSessionRepository');
                        $backendUserSessionRepository->switchBackToOriginalUser($authentication);
-
-                       $redirectUrl = $GLOBALS['BACK_PATH'] . 'index.php' . ($GLOBALS['TYPO3_CONF_VARS']['BE']['interfaces'] ? '' : '?commandLI=1');
-                       \TYPO3\CMS\Core\Utility\HttpUtility::redirect($redirectUrl);
+                       \TYPO3\CMS\Core\Utility\HttpUtility::redirect($GLOBALS['BACK_PATH'] . 'backend.php');
                }
        }