Review main Merged

69635[BUGFIX] Extract switch user handling from EXT:beuser

Oli Bartsch CR +2 V +2 Hard +360 −255 updated 06/29/21, 14:15

Commit message

The switch user handling was previously placed in EXT:beuser,
more precisely in the BackendUserControllers' indexAction.
It was therefore necessary to link to the extbase based
controller with a mix of prefixed arguments and the non
prefixed "switchUser" argument. Latter was internally
evaluated with GU:_GP(). This means, switching users was
done via GET requests in an extbase action, but only in
case a non extbase prefixed argument was set.

In #94209 this got worse when the BackendUserGroupController
was merged into BackendUserController. Since this controller
features a "remember my last action" functionality, switch user
could no longer reliably be triggered. The evaluation of the
non extbase prefixed "switchUser" argument only took place in
the "user listing" (indexAction) and the success of the call
therefore depended on the users' last called action, as this
action was automatically used.

This patch now extracts the switch user functionality from
EXT:beuser into a dedicated EXT:backend controller, featuring
two ajax routes "/switch/user" and "/switch/user/exit". Both
accessible via POST requests only. To trigger those requests,
a new JS module "TYPO3/CMS/Backend/SwitchUser" is introduced.
This also allows to completely remove the logout hook by using
the concrete markup (custom element) for the "exit" button.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 2

Files 14