BackendUser 

\nn\t3::BackendUser() 

Methods to check in the frontend whether a user is logged into the Typo3 backend and has admin rights, for example. Methods to start a backend user if it does not exist (e.g. during a scheduler job).

Overview of Methods 

\nn\t3::BackendUser()->get(); 

Gets the current backend user. Corresponds to $GLOBALS['BE_USER'] in previous Typo3 versions.

\nn\t3::BackendUser()->get();
Copied!

| @return \TYPO3\CMS\Backend\FrontendBackendUserAuthentication

| ➜ Go to source code of BackendUser::get()

\nn\t3::BackendUser()->getCookieName(); 

Get the cookie name of the backend user cookie. Usually be_typo_user, unless it has been changed in the LocalConfiguration.

\nn\t3::BackendUser()->getCookieName();
Copied!

return string

| ➜ Go to source code of BackendUser::getCookieName()

\nn\t3::BackendUser()->getSettings($moduleName = 'nnhelpers', $path = NULL); 

Retrieves user-specific settings for the currently logged in backend user. See \nn\t3::BackendUser()->updateSettings() to save the data.

\nn\t3::BackendUser()->getSettings('myext'); // => ['wants'=>['drink'=>'coffee']]
\nn\t3::BackendUser()->getSettings('myext', 'wants'); // => ['drink'=>'coffee']
\nn\t3::BackendUser()->getSettings('myext', 'wants.drink'); // => 'coffee'
Copied!

| @return mixed

| ➜ Go to source code of BackendUser::getSettings()

\nn\t3::BackendUser()->isAdmin(); 

Checks whether the BE user is an admin. Earlier: $GLOBALS['TSFE']->beUserLogin

\nn\t3::BackendUser()->isAdmin();
Copied!

| @return bool

| ➜ Go to source code of BackendUser::isAdmin()

\nn\t3::BackendUser()->isLoggedIn($request = NULL); 

Checks whether a BE user is logged in. Example: Only show certain content in the frontend if the user is logged in in the backend. Previously: $GLOBALS['TSFE']->beUserLogin

// Check after complete initialization of the front/backend
\nn\t3::BackendUser()->isLoggedIn();

// Check using the JWT, e.g. in an eID script before authentication
\nn\t3::BackendUser()->isLoggedIn( $request );
Copied!
@param ServerRequest $request
@return bool

| ➜ Go to source code of BackendUser::isLoggedIn()

\nn\t3::BackendUser()->start(); 

Start (fake) backend user. Solves the problem that, for example, certain functions from the scheduler such as log() are not possible if there is no active BE user.

\nn\t3::BackendUser()->start();
Copied!

| @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication

| ➜ Go to source code of BackendUser::start()

\nn\t3::BackendUser()->updateSettings($moduleName = 'nnhelpers', $settings = []); 

Saves user-specific settings for the currently logged in backend user. These settings are also available again for the user after logout/login. See \nn\t3::BackendUser()->getSettings('myext') to read the data.

\nn\t3::BackendUser()->updateSettings('myext', ['wants'=>['drink'=>'coffee']]);
Copied!

| @return array

| ➜ Go to source code of BackendUser::updateSettings()

Methods