Skip to content
Snippets Groups Projects
Commit e7204abb authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[!!!][TASK] Avoid TSFE->fe_user

TypoScriptFrontendController->fe_user is the current
FrontendUserAuthentication object. It is set when
constructing the instance.

Since TypoScriptFrontendController is also still set
as $GLOBALS['TSFE'], some extensions tend to fetch
the current FE user from this global state, and
sometimes even inject that into other classes like
repositories. Extension felogin is a victim here: It
models some state of FrontendUserAuthentication in the
service object 'UserService', to then inject this into
repositories and other classes. This indirection is an
anti-pattern.

The current Frontend user is already available either
as Request attribute 'frontend.user', and a limited
list of user details is also available as context
aspect.

The patch removes TSFE->fe_user entirely and dissolves
the offending felogin class. Various other core usages
are adapted as well to avoid fetching this state from
TypoScriptFrontendController.

Resolves: #102605
Releases: main
Change-Id: Ibc33cefa2b24658406a7c0f7ce8fd80eaf7c9f3b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82089


Reviewed-by: default avatarSascha Nowak <sascha.nowak@netlogix.de>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
parent d0c8195e
Branches
Tags
No related merge requests found
Showing
with 205 additions and 320 deletions
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