‪TYPO3CMS  11.5
TYPO3\CMS\Core\Authentication\AbstractUserAuthentication Class Reference
Inheritance diagram for TYPO3\CMS\Core\Authentication\AbstractUserAuthentication:
TYPO3\CMS\Core\Authentication\BackendUserAuthentication TYPO3\CMS\Core\Tests\Functional\Authentication\Fixtures\AnyUserAuthentication TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication TYPO3\CMS\Backend\FrontendBackendUserAuthentication TYPO3\CMS\Core\Authentication\CommandLineUserAuthentication TYPO3\CMS\Workspaces\Authentication\PreviewUserAuthentication

Public Member Functions

 __construct ()
 
 initializeUserSessionManager (?UserSessionManager $userSessionManager=null)
 
 start (ServerRequestInterface $request=null)
 
ResponseInterface appendCookieToResponse (ResponseInterface $response)
 
bool isSetSessionCookie ()
 
bool isRefreshTimeBasedCookie ()
 
 checkAuthentication (ServerRequestInterface $request=null)
 
bool isMfaSetupRequired ()
 
string createSessionId ()
 
UserSession createUserSession (array $tempuser)
 
array bool fetchUserSession ($skipSessionUpdate=false)
 
 enforceNewSessionId ()
 
 logoff ()
 
 removeCookie ($cookieName=null)
 
bool isCookieSet ()
 
 writeUC ($variable='')
 
 unpack_uc ($theUC='')
 
 pushModuleData ($module, $data, $noSave=0)
 
mixed getModuleData ($module, $type='')
 
mixed getSessionData ($key)
 
 setSessionData ($key, $data)
 
 setAndSaveSessionData ($key, $data)
 
array getLoginFormData ()
 
 isActiveLogin (ServerRequestInterface $request)
 
array processLoginData ($loginData)
 
array getAuthInfoArray ()
 
 writelog ($type, $action, $error, $details_nr, $details, $data, $tablename, $recuid, $recpid)
 
 setBeUserByUid ($uid)
 
 setBeUserByName ($name)
 
array getRawUserByUid ($uid)
 
array getRawUserByName ($name)
 
UserSession getSession ()
 
 __isset (string $propertyName)
 
 __set (string $propertyName, $propertyValue)
 
 __get (string $propertyName)
 
 __unset (string $propertyName)
 

Public Attributes

string $name = ''
 
string $user_table = ''
 
string $usergroup_table = ''
 
string $username_column = ''
 
string $userident_column = ''
 
string $userid_column = ''
 
string $usergroup_column = ''
 
string $lastLogin_column = ''
 
array $enablecolumns
 
string $formfield_uname = ''
 
string $formfield_uident = ''
 
string $formfield_status = ''
 
bool $writeStdLog = false
 
bool $writeAttemptLog = false
 
bool $checkPid = true
 
int string $checkPid_value = 0
 
bool $loginSessionStarted = false
 
array null $user
 
array $userGroups = []
 
bool $dontSetCookie = false
 
string $loginType = ''
 
array $uc
 

Protected Member Functions

 setSessionCookie ()
 
string getCookieDomain ()
 
string getCookie ($cookieName)
 
array getAuthServiceConfiguration ()
 
 evaluateMfaRequirements ()
 
 handleLoginFailure ()
 
Traversable getAuthServices (string $subType, array $loginData, array $authInfo)
 
 regenerateSessionId ()
 
 updateLoginTimestamp (int $userId)
 
array null fetchValidUserFromSessionOrDestroySession (bool $skipSessionUpdate=false)
 
 performLogoff ()
 
QueryRestrictionContainerInterface userConstraints ()
 
mixed removeSensitiveLoginDataForLoggingInfo ($data, bool $isUserRecord=false)
 

Protected Attributes

int $lifetime = 0
 
UserSession $userSession = null
 
UserSessionManager $userSessionManager
 
Cookie $setCookie = null
 

Detailed Description

Authentication of users in TYPO3

This class is used to authenticate a login user. The class is used by both the frontend and backend. In both cases this class is a parent class to BackendUserAuthentication and FrontendUserAuthentication

Definition at line 55 of file AbstractUserAuthentication.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::__construct ( )

Member Function Documentation

◆ __get()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::__get ( string  $propertyName)

◆ __isset()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::__isset ( string  $propertyName)

Definition at line 1327 of file AbstractUserAuthentication.php.

◆ __set()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::__set ( string  $propertyName,
  $propertyValue 
)

◆ __unset()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::__unset ( string  $propertyName)

Definition at line 1361 of file AbstractUserAuthentication.php.

◆ appendCookieToResponse()

ResponseInterface TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::appendCookieToResponse ( ResponseInterface  $response)

Used to apply a cookie to a PSR-7 Response.

Parameters
ResponseInterface$response
Returns
‪ResponseInterface

Definition at line 277 of file AbstractUserAuthentication.php.

Referenced by TYPO3\CMS\Backend\Middleware\BackendUserAuthenticator\enrichResponseWithHeadersAndCookieInformation(), and TYPO3\CMS\Backend\Middleware\BackendUserAuthenticator\redirectToMfaEndpoint().

◆ checkAuthentication()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::checkAuthentication ( ServerRequestInterface  $request = null)

Checks if a submission of username and password is present or use other authentication by auth services

Parameters
ServerRequestInterface | null$request
Todo:
‪: Make mandatory in v12.
Exceptions
MfaRequiredException

Reimplemented in TYPO3\CMS\Core\Authentication\CommandLineUserAuthentication.

Definition at line 407 of file AbstractUserAuthentication.php.

References $GLOBALS, TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\$loginType, TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\$userSession, TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\createUserSession(), TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\evaluateMfaRequirements(), TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\fetchValidUserFromSessionOrDestroySession(), TYPO3\CMS\Core\Http\ServerRequestFactory\fromGlobals(), TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\getAuthInfoArray(), TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\getAuthServiceConfiguration(), TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\getAuthServices(), TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\getLoginFormData(), TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\handleLoginFailure(), TYPO3\CMS\Core\Core\Environment\isCli(), TYPO3\CMS\Core\Session\UserSession\isNew(), TYPO3\CMS\Core\Authentication\LoginType\LOGIN, TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\logoff(), TYPO3\CMS\Core\Authentication\LoginType\LOGOUT, TYPO3\CMS\Core\Authentication\MimicServiceInterface\mimicAuthUser(), TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\regenerateSessionId(), TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\removeSensitiveLoginDataForLoggingInfo(), and TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\writelog().

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\start().

◆ createSessionId()

string TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::createSessionId ( )

Creates a new session ID.

Returns
‪string The new session ID
Deprecated:
‪since TYPO3 v11.0, will be removed in TYPO3 v12, is kept because it is used in Testing Framework

Definition at line 708 of file AbstractUserAuthentication.php.

◆ createUserSession()

UserSession TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::createUserSession ( array  $tempuser)

Creates a user session record and returns its values.

Parameters
array$tempuser‪User data array
Returns
‪UserSession The session data for the newly created session.

Reimplemented in TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication.

Definition at line 759 of file AbstractUserAuthentication.php.

References TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\initializeUserSessionManager(), and TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\updateLoginTimestamp().

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\checkAuthentication().

◆ enforceNewSessionId()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::enforceNewSessionId ( )

◆ evaluateMfaRequirements()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::evaluateMfaRequirements ( )
protected

This method checks if the user is authenticated but has not succeeded in passing his MFA challenge. This method can therefore only be used if a user has been authenticated against his first authentication method (username+password or any other authentication token).

Exceptions
MfaRequiredException

Reimplemented in TYPO3\CMS\Core\Authentication\BackendUserAuthentication.

Definition at line 664 of file AbstractUserAuthentication.php.

References TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\getSessionData().

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\checkAuthentication().

◆ fetchUserSession()

array bool TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::fetchUserSession (   $skipSessionUpdate = false)

Read the user session from db.

Parameters
bool$skipSessionUpdate
Returns
‪array|bool User session data, false if $userSession->getIdentifier() does not represent valid session
Deprecated:
‪since TYPO3 v11, will be removed in TYPO3 v12.

Definition at line 797 of file AbstractUserAuthentication.php.

References TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\fetchValidUserFromSessionOrDestroySession().

◆ fetchValidUserFromSessionOrDestroySession()

array null TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::fetchValidUserFromSessionOrDestroySession ( bool  $skipSessionUpdate = false)
protected

If the session is bound to a user, this method fetches the user record, and returns it. If the session has a timeout, the session date is extended if needed. Also the ìs_online flag is updated for the user.

However, if the session has expired the session is removed and the request is treated as an anonymous session.

Parameters
bool$skipSessionUpdate
Returns
‪array|null

Definition at line 825 of file AbstractUserAuthentication.php.

References TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\getRawUserByUid(), and TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\logoff().

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\checkAuthentication(), and TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\fetchUserSession().

◆ getAuthInfoArray()

◆ getAuthServiceConfiguration()

array TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::getAuthServiceConfiguration ( )
protected

"auth" services configuration array from $GLOBALS['TYPO3_CONF_VARS']['SVCONF']['auth']

Returns
‪array

Definition at line 392 of file AbstractUserAuthentication.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\checkAuthentication().

◆ getAuthServices()

Traversable TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::getAuthServices ( string  $subType,
array  $loginData,
array  $authInfo 
)
protected

Initializes authentication services to be used in a foreach loop

Parameters
string$subType‪e.g. getUserFE
array$loginData
array$authInfo
Returns
‪\Traversable A generator of service objects

Definition at line 721 of file AbstractUserAuthentication.php.

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\checkAuthentication(), and TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\processLoginData().

◆ getCookie()

string TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::getCookie (   $cookieName)
protected

Get the value of a specified cookie.

Parameters
string$cookieName‪The cookie ID
Returns
‪string The value stored in the cookie

Definition at line 361 of file AbstractUserAuthentication.php.

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\isCookieSet().

◆ getCookieDomain()

string TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::getCookieDomain ( )
protected

Gets the domain to be used on setting cookies. The information is taken from the value in $GLOBALS['TYPO3_CONF_VARS']['SYS']['cookieDomain'].

Returns
‪string The domain to be used on setting cookies

Definition at line 331 of file AbstractUserAuthentication.php.

References $GLOBALS, and TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\$loginType.

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\removeCookie(), and TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\setSessionCookie().

◆ getLoginFormData()

◆ getModuleData()

mixed TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::getModuleData (   $module,
  $type = '' 
)

Gets module data for a module (from a loaded ->uc array)

Parameters
string$module‪Is the name of the module ($MCONF['name'])
string$type‪If $type = 'ses' then module data is returned only if it was stored in the current session, otherwise data from a previous session will be returned (if available).
Returns
‪mixed The module data if available: $this->uc['moduleData'][$module];

Definition at line 1054 of file AbstractUserAuthentication.php.

Referenced by TYPO3\CMS\Backend\Controller\EditDocumentController\closeDocument(), TYPO3\CMS\Workspaces\Controller\ReviewController\getDepthSelection(), TYPO3\CMS\Workspaces\Controller\ReviewController\getLanguageSelection(), TYPO3\CMS\Workspaces\Controller\ReviewController\getStageSelection(), TYPO3\CMS\Backend\Clipboard\Clipboard\initializeClipboard(), TYPO3\CMS\Scheduler\Controller\SchedulerModuleController\listTasksAction(), TYPO3\CMS\Backend\Controller\EditDocumentController\preInit(), TYPO3\CMS\Recordlist\LinkHandler\FileLinkHandler\render(), and TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList\setDispFields().

◆ getRawUserByName()

array TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::getRawUserByName (   $name)

Fetching raw user record with username=$name

Parameters
string$name‪The username to look up.
Returns
‪array user record or FALSE
See also
‪\TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::getUserByUid()

Definition at line 1308 of file AbstractUserAuthentication.php.

References TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\$name, TYPO3\CMS\Core\Database\Connection\PARAM_STR, and TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\userConstraints().

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\setBeUserByName().

◆ getRawUserByUid()

array TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::getRawUserByUid (   $uid)

◆ getSession()

◆ getSessionData()

◆ handleLoginFailure()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::handleLoginFailure ( )
protected

Implement functionality when there was a failed login

Definition at line 694 of file AbstractUserAuthentication.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\checkAuthentication().

◆ initializeUserSessionManager()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::initializeUserSessionManager ( ?UserSessionManager  $userSessionManager = null)

◆ isActiveLogin()

◆ isCookieSet()

bool TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::isCookieSet ( )

Returns whether this request is going to set a cookie or a cookie was already found in the system

Returns
‪bool Returns TRUE if a cookie is set

Definition at line 927 of file AbstractUserAuthentication.php.

References TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\getCookie().

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\performLogoff(), and TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication\storeSessionData().

◆ isMfaSetupRequired()

bool TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::isMfaSetupRequired ( )

Whether the user is required to set up MFA

Returns
‪bool

Reimplemented in TYPO3\CMS\Core\Authentication\BackendUserAuthentication.

Definition at line 686 of file AbstractUserAuthentication.php.

◆ isRefreshTimeBasedCookie()

bool TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::isRefreshTimeBasedCookie ( )

Determine whether a non-session cookie needs to be set (lifetime>0)

Returns
‪bool

Reimplemented in TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication.

Definition at line 383 of file AbstractUserAuthentication.php.

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\setSessionCookie(), and TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\start().

◆ isSetSessionCookie()

bool TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::isSetSessionCookie ( )

Determine whether a session cookie needs to be set (lifetime=0)

Returns
‪bool

Reimplemented in TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication.

Definition at line 372 of file AbstractUserAuthentication.php.

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\setSessionCookie().

◆ logoff()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::logoff ( )

Log out current user! Removes the current session record, sets the internal ->user array to a blank string; Thereby the current user (if any) is effectively logged out!

Reimplemented in TYPO3\CMS\Core\Authentication\BackendUserAuthentication.

Definition at line 865 of file AbstractUserAuthentication.php.

References $GLOBALS, and TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\performLogoff().

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\checkAuthentication(), and TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\fetchValidUserFromSessionOrDestroySession().

◆ performLogoff()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::performLogoff ( )
protected

Perform the logoff action. Called from logoff() as a way to allow subclasses to override what happens when a user logs off, without needing to reproduce the hook calls and logging that happens in the public logoff() API method.

Definition at line 889 of file AbstractUserAuthentication.php.

References TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\isCookieSet(), and TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\removeCookie().

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\logoff().

◆ processLoginData()

◆ pushModuleData()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::pushModuleData (   $module,
  $data,
  $noSave = 0 
)

Stores data for a module. The data is stored with the session id so you can even check upon retrieval if the module data is from a previous session or from the current session.

Parameters
string$module‪Is the name of the module ($MCONF['name'])
mixed$data‪Is the data you want to store for that module (array, string, ...)
bool | int$noSave‪If $noSave is set, then the ->uc array (which carries all kinds of user data) is NOT written immediately, but must be written by some subsequent call.

Definition at line 1034 of file AbstractUserAuthentication.php.

References TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\writeUC().

Referenced by TYPO3\CMS\Beuser\Controller\BackendUserController\addToCompareListAction(), TYPO3\CMS\Backend\Controller\EditDocumentController\closeDocument(), TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateObjectBrowserModuleFunctionController\main(), TYPO3\CMS\Backend\Controller\EditDocumentController\main(), TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateObjectBrowserModuleFunctionController\modMenu(), TYPO3\CMS\Beuser\Controller\BackendUserController\removeAllFromCompareListAction(), TYPO3\CMS\Beuser\Controller\BackendUserController\removeFromCompareListAction(), TYPO3\CMS\Recordlist\LinkHandler\FileLinkHandler\render(), TYPO3\CMS\Backend\Clipboard\Clipboard\saveClipboard(), and TYPO3\CMS\Linkvalidator\Report\LinkValidatorReport\validateSettings().

◆ regenerateSessionId()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::regenerateSessionId ( )
protected

Regenerate the session ID and transfer the session to new ID Call this method whenever a user proceeds to a higher authorization level e.g. when an anonymous session is now authenticated.

Reimplemented in TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication.

Definition at line 742 of file AbstractUserAuthentication.php.

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\checkAuthentication(), and TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\enforceNewSessionId().

◆ removeCookie()

◆ removeSensitiveLoginDataForLoggingInfo()

mixed TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::removeSensitiveLoginDataForLoggingInfo (   $data,
bool  $isUserRecord = false 
)
protected

Removes any sensitive data from the incoming data (either from loginData, processedLogin data or the user record from the DB).

No type hinting is added because it might be possible that the incoming data is of any other type.

Parameters
mixed | array$data
bool$isUserRecord
Returns
‪mixed

Definition at line 1183 of file AbstractUserAuthentication.php.

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\checkAuthentication(), and TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\processLoginData().

◆ setAndSaveSessionData()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::setAndSaveSessionData (   $key,
  $data 
)

Sets the session data ($data) for $key and writes all session data (from ->user['ses_data']) to the database. The data will last only for this login session since it is stored in the session table.

Parameters
string$key‪Pointer to an associative key in the session data array which is stored serialized in the field "ses_data" of the session table.
mixed$data‪The data to store in index $key

Reimplemented in TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication.

Definition at line 1103 of file AbstractUserAuthentication.php.

Referenced by TYPO3\CMS\Workspaces\Controller\Remote\MassActionHandler\initFlushData(), TYPO3\CMS\Workspaces\Controller\Remote\MassActionHandler\initPublishData(), TYPO3\CMS\Form\Domain\Configuration\FormDefinitionConversionService\persistSessionToken(), and TYPO3\CMS\Workspaces\Controller\Remote\MassActionHandler\processData().

◆ setBeUserByName()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::setBeUserByName (   $name)

Raw initialization of the be_user with username=$name

Parameters
string$name‪The username to look up.
See also
‪\TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::setBeUserByUid()

Definition at line 1277 of file AbstractUserAuthentication.php.

References TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\getRawUserByName().

Referenced by TYPO3\CMS\Core\Authentication\CommandLineUserAuthentication\authenticate().

◆ setBeUserByUid()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::setBeUserByUid (   $uid)

Raw initialization of the be_user with uid=$uid This will circumvent all login procedures and select a be_users record from the database and set the content of ->user to the record selected. Thus the BE_USER object will appear like if a user was authenticated - however without a session id and the fields from the session table of course. Will check the users for disabled, start/endtime, etc. ($this->user_where_clause())

Parameters
int$uid‪The UID of the backend user to set in ->user

Definition at line 1265 of file AbstractUserAuthentication.php.

References TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\getRawUserByUid().

◆ setSessionCookie()

◆ setSessionData()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::setSessionData (   $key,
  $data 
)

Set session data by key. The data will last only for this login session since it is stored in the user session.

Parameters
string$key‪A non empty string to store the data under
mixed$data‪Data store store in session

Definition at line 1091 of file AbstractUserAuthentication.php.

Referenced by TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication\setAndSaveSessionData(), and TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication\setKey().

◆ start()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::start ( ServerRequestInterface  $request = null)

Starts a user session Typical configurations will: a) check if session cookie was set and if not, set one, b) check if a password/username was sent and if so, try to authenticate the user c) Lookup a session attached to a user and check timeout etc. d) Garbage collection, setting of no-cache headers. If a user is authenticated the database record of the user (array) will be set in the ->user internal variable.

Parameters
ServerRequestInterface | null$request
Todo:
‪: Make mandatory in v12.

Reimplemented in TYPO3\CMS\Core\Authentication\CommandLineUserAuthentication.

Definition at line 235 of file AbstractUserAuthentication.php.

References $GLOBALS, TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\checkAuthentication(), TYPO3\CMS\Core\Http\ServerRequestFactory\fromGlobals(), TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\initializeUserSessionManager(), TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\isRefreshTimeBasedCookie(), and TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\setSessionCookie().

◆ unpack_uc()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::unpack_uc (   $theUC = '')

Sets $theUC as the internal variable ->uc IF $theUC is an array. If $theUC is FALSE, the 'uc' content from the ->user array will be unserialized and restored in ->uc

Parameters
mixed$theUC‪If an array, then set as ->uc, otherwise load from user record
Deprecated:
‪will be removed in TYPO3 v12.0.

Definition at line 1012 of file AbstractUserAuthentication.php.

Referenced by TYPO3\CMS\Core\Authentication\BackendUserAuthentication\backendSetUC(), and TYPO3\CMS\Core\Authentication\Mfa\MfaProviderRegistry\getFirstAuthenticationAwareProvider().

◆ updateLoginTimestamp()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::updateLoginTimestamp ( int  $userId)
protected

◆ userConstraints()

QueryRestrictionContainerInterface TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::userConstraints ( )
protected

This returns the restrictions needed to select the user respecting enable columns and flags like deleted, hidden, starttime, endtime and rootLevel

Returns
‪QueryRestrictionContainerInterface

Definition at line 945 of file AbstractUserAuthentication.php.

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\getAuthInfoArray(), TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\getRawUserByName(), and TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\getRawUserByUid().

◆ writelog()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::writelog (   $type,
  $action,
  $error,
  $details_nr,
  $details,
  $data,
  $tablename,
  $recuid,
  $recpid 
)

DUMMY: Writes to log database table (in some extension classes)

Parameters
int$type‪denotes which module that has submitted the entry. This is the current list: 1=tce_db; 2=tce_file; 3=system (eg. sys_history save); 4=modules; 254=Personal settings changed; 255=login / out action: 1=login, 2=logout, 3=failed login (+ errorcode 3), 4=failure_warning_email sent
int$action‪denotes which specific operation that wrote the entry (eg. 'delete', 'upload', 'update' and so on...). Specific for each $type. Also used to trigger update of the interface. (see the log-module for the meaning of each number !!)
int$error‪flag. 0 = message, 1 = error (user problem), 2 = System Error (which should not happen), 3 = security notice (admin)
int$details_nr‪The message number. Specific for each $type and $action. in the future this will make it possible to translate error messages to other languages
string$details‪Default text that follows the message
array$data‪Data that follows the log. Might be used to carry special information. If an array the first 5 entries (0-4) will be sprintf'ed the details-text...
string$tablename‪Special field used by tce_main.php. These ($tablename, $recuid, $recpid) holds the reference to the record which the log-entry is about. (Was used in attic status.php to update the interface.)
int | string$recuid‪Special field used by tce_main.php. These ($tablename, $recuid, $recpid) holds the reference to the record which the log-entry is about. (Was used in attic status.php to update the interface.)
int | string$recpid‪Special field used by tce_main.php. These ($tablename, $recuid, $recpid) holds the reference to the record which the log-entry is about. (Was used in attic status.php to update the interface.)

Definition at line 1252 of file AbstractUserAuthentication.php.

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\checkAuthentication(), and TYPO3\CMS\Backend\Security\FailedLoginAttemptNotification\sendEmailOnLoginFailures().

◆ writeUC()

TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::writeUC (   $variable = '')

This writes $variable to the user-record. This is a way of providing session-data. You can fetch the data again through $this->uc in this class! If $variable is not an array, $this->uc is saved!

Parameters
array | string$variable‪An array you want to store for the user as session data. If $variable is not supplied (is null), the internal variable, ->uc, is stored by default
Deprecated:
‪will be removed in TYPO3 v12.0.

Definition at line 984 of file AbstractUserAuthentication.php.

References TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\$uc, and TYPO3\CMS\Core\Database\Connection\PARAM_LOB.

Referenced by TYPO3\CMS\Core\Authentication\BackendUserAuthentication\backendSetUC(), TYPO3\CMS\Viewpage\Controller\ViewModuleController\getCurrentLanguage(), TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\pushModuleData(), TYPO3\CMS\Reports\Controller\ReportController\resetState(), TYPO3\CMS\Workspaces\Controller\Remote\ActionHandler\saveColumnModel(), TYPO3\CMS\Reports\Controller\ReportController\saveState(), TYPO3\CMS\Backend\Controller\Page\TreeController\setTemporaryMountPointAction(), and TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication\storeSessionData().

Member Data Documentation

◆ $checkPid

bool TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$checkPid = true

If set, the user-record must be stored at the page defined by $checkPid_value

Definition at line 150 of file AbstractUserAuthentication.php.

◆ $checkPid_value

int string TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$checkPid_value = 0

The page id the user record must be stored at, can also hold a comma separated list of pids

Definition at line 155 of file AbstractUserAuthentication.php.

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\getAuthInfoArray().

◆ $dontSetCookie

bool TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$dontSetCookie = false

Will prevent the setting of the session cookie

Definition at line 175 of file AbstractUserAuthentication.php.

◆ $enablecolumns

array TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$enablecolumns
Initial value:
= array(
'rootLevel' => '',
'disabled' => '',
'starttime' => '',
'endtime' => '',
'deleted' => '',
)

Enable field columns of user table

Definition at line 103 of file AbstractUserAuthentication.php.

◆ $formfield_status

string TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$formfield_status = ''

Form field with status: *'login', 'logout'. If empty login is not verified.

Definition at line 125 of file AbstractUserAuthentication.php.

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\isActiveLogin().

◆ $formfield_uident

string TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$formfield_uident = ''

Form field with password

Definition at line 120 of file AbstractUserAuthentication.php.

◆ $formfield_uname

string TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$formfield_uname = ''

Form field with login-name

Definition at line 115 of file AbstractUserAuthentication.php.

◆ $lastLogin_column

string TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$lastLogin_column = ''

Column name for last login timestamp

Definition at line 98 of file AbstractUserAuthentication.php.

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\updateLoginTimestamp().

◆ $lifetime

int TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$lifetime = 0
protected

Lifetime for the session-cookie (on the client)

If >0: permanent cookie with given lifetime If 0: session-cookie Session-cookie means the browser will remove it when the browser is closed.

Definition at line 135 of file AbstractUserAuthentication.php.

◆ $loginSessionStarted

bool TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$loginSessionStarted = false

Will be set to TRUE if the login session is actually written during auth-check.

Definition at line 160 of file AbstractUserAuthentication.php.

◆ $loginType

◆ $name

string TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$name = ''

◆ $setCookie

Cookie TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$setCookie = null
protected

Definition at line 195 of file AbstractUserAuthentication.php.

◆ $uc

array TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$uc

◆ $user

array null TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$user

contains user- AND session-data from database (joined tables)

Definition at line 165 of file AbstractUserAuthentication.php.

Referenced by TYPO3\CMS\Core\Authentication\BackendUserAuthentication\initializeBackendLogin().

◆ $user_table

string TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$user_table = ''

Table in database with user data

Definition at line 68 of file AbstractUserAuthentication.php.

Referenced by TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\getAuthInfoArray().

◆ $usergroup_column

string TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$usergroup_column = ''

Column for user group information

Definition at line 93 of file AbstractUserAuthentication.php.

◆ $usergroup_table

string TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$usergroup_table = ''

Table in database with user groups

Definition at line 73 of file AbstractUserAuthentication.php.

◆ $userGroups

array TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$userGroups = []

This array will hold the groups that the user is a member of

Definition at line 170 of file AbstractUserAuthentication.php.

Referenced by TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication\createUserAspect().

◆ $userid_column

string TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$userid_column = ''

◆ $userident_column

string TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$userident_column = ''

◆ $username_column

string TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$username_column = ''

◆ $userSession

◆ $userSessionManager

UserSessionManager TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$userSessionManager
protected

◆ $writeAttemptLog

bool TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$writeAttemptLog = false

Log failed login attempts

Definition at line 145 of file AbstractUserAuthentication.php.

◆ $writeStdLog

bool TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::$writeStdLog = false

Decides if the writelog() function is called at login and logout

Definition at line 140 of file AbstractUserAuthentication.php.