Commit f3e3ab66 authored by Helmut Hummel's avatar Helmut Hummel Committed by Christian Kuhn
Browse files

[BUGFIX] Do not try to access user session on CLI

Since CommandLineUserAuthentication does not initialize
the session property (because session handling is not needed
on cli), a fatal error occurs, when calling the `writeLog`
because a potentially simulated user is checked by accessing
the session within this method.

Therefore this check is now overridden as well
in CommandLineUserAuthentication to always assume the
original (cli) user for logging.

Resolves: #93127
Releases: master
Change-Id: Ife7d969944f7775e015b8366450dc09b6ffb36b7
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/67184

Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Simon Gilli's avatarSimon Gilli <typo3@gilbertsoft.org>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Simon Gilli's avatarSimon Gilli <typo3@gilbertsoft.org>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 3b03ef46
......@@ -73,6 +73,14 @@ class CommandLineUserAuthentication extends BackendUserAuthentication
// do nothing
}
/**
* On CLI there is no session and no switched user
*/
public function getOriginalUserIdWhenInSwitchUserMode(): ?int
{
return null;
}
/**
* Logs-in the _CLI_ user. It does not need to check for credentials.
*
......
Supports Markdown
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