‪TYPO3CMS  11.5
TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication:
TYPO3\CMS\Core\Authentication\AbstractUserAuthentication

Public Member Functions

 __construct ()
 
bool isSetSessionCookie ()
 
bool isRefreshTimeBasedCookie ()
 
array getLoginFormData ()
 
UserSession createUserSession (array $tempuser)
 
 fetchGroupData (ServerRequestInterface $request=null)
 
UserAspect createUserAspect (bool $respectUserGroups=true)
 
array getUserTSconf ()
 
 storeSessionData ()
 
 removeSessionData ()
 
mixed getKey ($type, $key)
 
 setKey ($type, $key, $data)
 
 setAndSaveSessionData ($key, $data)
 
 hideActiveLogin ()
 
 updateOnlineTimestamp ()
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Authentication\AbstractUserAuthentication
 initializeUserSessionManager (?UserSessionManager $userSessionManager=null)
 
 start (ServerRequestInterface $request=null)
 
ResponseInterface appendCookieToResponse (ResponseInterface $response)
 
 checkAuthentication (ServerRequestInterface $request=null)
 
bool isMfaSetupRequired ()
 
string createSessionId ()
 
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)
 
 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)
 

Static Public Member Functions

static string getCookieName ()
 

Public Attributes

string $loginType = 'FE'
 
string $formfield_uname = 'user'
 
string $formfield_uident = 'pass'
 
string $formfield_status = 'logintype'
 
string $formfield_permanent = 'permalogin'
 
string $user_table = 'fe_users'
 
string $username_column = 'username'
 
string $userident_column = 'password'
 
string $userid_column = 'uid'
 
string $lastLogin_column = 'lastlogin'
 
string $usergroup_column = 'usergroup'
 
string $usergroup_table = 'fe_groups'
 
array $enablecolumns
 
array $groupData
 
bool $is_permanent = false
 
bool $dontSetCookie = true
 
- ‪Public Attributes inherited from ‪TYPO3\CMS\Core\Authentication\AbstractUserAuthentication
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

 regenerateSessionId ()
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Core\Authentication\AbstractUserAuthentication
 setSessionCookie ()
 
string getCookieDomain ()
 
string getCookie ($cookieName)
 
array getAuthServiceConfiguration ()
 
 evaluateMfaRequirements ()
 
 handleLoginFailure ()
 
Traversable getAuthServices (string $subType, array $loginData, array $authInfo)
 
 updateLoginTimestamp (int $userId)
 
array null fetchValidUserFromSessionOrDestroySession (bool $skipSessionUpdate=false)
 
 performLogoff ()
 
QueryRestrictionContainerInterface userConstraints ()
 
mixed removeSensitiveLoginDataForLoggingInfo ($data, bool $isUserRecord=false)
 

Protected Attributes

array $TSdataArray = array( )
 
array $userTS = array( )
 
bool $userData_change = false
 
bool $loginHidden = false
 
bool $forceSetCookie = false
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Core\Authentication\AbstractUserAuthentication
int $lifetime = 0
 
UserSession $userSession = null
 
UserSessionManager $userSessionManager
 
Cookie $setCookie = null
 

Detailed Description

Extension class for Front End User Authentication.

Definition at line 31 of file FrontendUserAuthentication.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::__construct ( )

Member Function Documentation

◆ createUserAspect()

UserAspect TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::createUserAspect ( bool  $respectUserGroups = true)

Initializes the front-end user groups for the context API, based on the user groups and the logged-in state.

Parameters
bool$respectUserGroups‪used with the $TSFE->loginAllowedInBranch flag to disable the inclusion of the users' groups
Returns
‪UserAspect

Definition at line 302 of file FrontendUserAuthentication.php.

References TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\$userGroups, and TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication\updateOnlineTimestamp().

◆ createUserSession()

UserSession TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::createUserSession ( array  $tempuser)

Creates a user session record and returns its values. However, as the FE user cookie is normally not set, this has to be done before the parent class is doing the rest.

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

Reimplemented from TYPO3\CMS\Core\Authentication\AbstractUserAuthentication.

Definition at line 225 of file FrontendUserAuthentication.php.

References TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication\$is_permanent, and TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\updateLoginTimestamp().

◆ fetchGroupData()

TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::fetchGroupData ( ServerRequestInterface  $request = null)

Will select all fe_groups records that the current fe_user is member of.

It also accumulates the TSconfig for the fe_user/fe_groups in ->TSdataArray

Parameters
ServerRequestInterface | null$request‪(will become a requirement in v12.0)

Definition at line 249 of file FrontendUserAuthentication.php.

References $GLOBALS, and TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication\$groupData.

◆ getCookieName()

static string TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::getCookieName ( )
static

Returns the configured cookie name

Returns
‪string

Definition at line 156 of file FrontendUserAuthentication.php.

References $GLOBALS.

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

◆ getKey()

mixed TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::getKey (   $type,
  $key 
)

Returns session data for the fe_user; Either persistent data following the fe_users uid/profile (requires login) or current-session based (not available when browse is closed, but does not require login)

Parameters
string$type‪Session data type; Either "user" (persistent, bound to fe_users profile) or "ses" (temporary, bound to current session cookie)
string$key‪Key from the data array to return; The session data (in either case) is an array ($this->uc / $this->sessionData) and this value determines which key to return the value for.
Returns
‪mixed Returns whatever value there was in the array for the key, $key
See also
setKey()

Definition at line 434 of file FrontendUserAuthentication.php.

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

Referenced by TYPO3\CMS\Form\Domain\Runtime\FormRuntime\getHoneypotNameFromSession().

◆ getLoginFormData()

array TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::getLoginFormData ( )

Returns an info array with Login/Logout data submitted by a form or params

Returns
‪array
See also
AbstractUserAuthentication::getLoginFormData()

Reimplemented from TYPO3\CMS\Core\Authentication\AbstractUserAuthentication.

Definition at line 194 of file FrontendUserAuthentication.php.

References $GLOBALS.

◆ getUserTSconf()

array TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::getUserTSconf ( )

Returns the parsed TSconfig for the fe_user The TSconfig will be cached in $this->userTS.

Returns
‪array TSconfig array for the fe_user

Definition at line 344 of file FrontendUserAuthentication.php.

References TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication\$userTS, and TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser\checkIncludeLines_array().

◆ hideActiveLogin()

TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::hideActiveLogin ( )

Hide the current login

This is used by the fe_login_mode feature for pages. A current login is unset, but we remember that there has been one.

Definition at line 502 of file FrontendUserAuthentication.php.

◆ isRefreshTimeBasedCookie()

bool TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::isRefreshTimeBasedCookie ( )

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

Returns
‪bool

Reimplemented from TYPO3\CMS\Core\Authentication\AbstractUserAuthentication.

Definition at line 183 of file FrontendUserAuthentication.php.

◆ isSetSessionCookie()

bool TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::isSetSessionCookie ( )

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

Returns
‪bool

Reimplemented from TYPO3\CMS\Core\Authentication\AbstractUserAuthentication.

Definition at line 171 of file FrontendUserAuthentication.php.

◆ regenerateSessionId()

TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::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. Forces cookie to be set

Reimplemented from TYPO3\CMS\Core\Authentication\AbstractUserAuthentication.

Definition at line 418 of file FrontendUserAuthentication.php.

◆ removeSessionData()

TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::removeSessionData ( )

Removes data of the current session.

Definition at line 399 of file FrontendUserAuthentication.php.

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

◆ setAndSaveSessionData()

TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::setAndSaveSessionData (   $key,
  $data 
)

Saves the tokens so that they can be used by a later incarnation of this class.

Parameters
string$key
mixed$data

Reimplemented from TYPO3\CMS\Core\Authentication\AbstractUserAuthentication.

Definition at line 490 of file FrontendUserAuthentication.php.

References TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\setSessionData(), and TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication\storeSessionData().

◆ setKey()

TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::setKey (   $type,
  $key,
  $data 
)

Saves session data, either persistent or bound to current session cookie. Please see getKey() for more details. When a value is set the flag $this->userData_change will be set so that the final call to ->storeSessionData() will know if a change has occurred and needs to be saved to the database. Notice: Simply calling this function will not save the data to the database! The actual saving is done in storeSessionData() which is called as some of the last things in \TYPO3\CMS\Frontend\Http\RequestHandler. So if you exit before this point, nothing gets saved of course! And the solution is to call $GLOBALS['TSFE']->storeSessionData(); before you exit.

Parameters
string$type‪Session data type; Either "user" (persistent, bound to fe_users profile) or "ses" (temporary, bound to current session cookie)
string$key‪Key from the data array to store incoming data in; The session data (in either case) is an array ($this->uc / $this->sessionData) and this value determines in which key the $data value will be stored.
mixed$data‪The data value to store in $key
See also
setKey()
storeSessionData()

Definition at line 462 of file FrontendUserAuthentication.php.

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

Referenced by TYPO3\CMS\Form\Domain\Runtime\FormRuntime\setHoneypotNameInSession().

◆ storeSessionData()

TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::storeSessionData ( )

◆ updateOnlineTimestamp()

TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::updateOnlineTimestamp ( )

Update the field "is_online" every 60 seconds of a logged-in user

Definition at line 513 of file FrontendUserAuthentication.php.

References $GLOBALS.

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

Member Data Documentation

◆ $dontSetCookie

bool TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::$dontSetCookie = true

Will prevent the setting of the session cookie (takes precedence over forceSetCookie) Disable cookie by default, will be activated if saveSessionData() is called, a user is logging-in or an existing session is found

Definition at line 142 of file FrontendUserAuthentication.php.

◆ $enablecolumns

array TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::$enablecolumns
Initial value:
= array(
'deleted' => 'deleted',
'disabled' => 'disable',
'starttime' => 'starttime',
'endtime' => 'endtime',
)

Enable field columns of user table

Definition at line 96 of file FrontendUserAuthentication.php.

◆ $forceSetCookie

bool TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::$forceSetCookie = false
protected

Will force the session cookie to be set every time (lifetime must be 0).

Definition at line 135 of file FrontendUserAuthentication.php.

◆ $formfield_permanent

string TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::$formfield_permanent = 'permalogin'

form field with 0 or 1 1 = permanent login enabled 0 = session is valid for a browser session only

Definition at line 58 of file FrontendUserAuthentication.php.

◆ $formfield_status

string TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::$formfield_status = 'logintype'

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

Definition at line 51 of file FrontendUserAuthentication.php.

◆ $formfield_uident

string TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::$formfield_uident = 'pass'

Form field with password

Definition at line 46 of file FrontendUserAuthentication.php.

◆ $formfield_uname

string TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::$formfield_uname = 'user'

Form field with login-name

Definition at line 41 of file FrontendUserAuthentication.php.

◆ $groupData

array TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::$groupData
Initial value:
= array(
'title' => [],
'uid' => [],
'pid' => [],
)

Definition at line 105 of file FrontendUserAuthentication.php.

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

◆ $is_permanent

bool TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::$is_permanent = false

◆ $lastLogin_column

string TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::$lastLogin_column = 'lastlogin'

Column name for last login timestamp

Definition at line 83 of file FrontendUserAuthentication.php.

◆ $loginHidden

bool TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::$loginHidden = false
protected

Definition at line 130 of file FrontendUserAuthentication.php.

◆ $loginType

string TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::$loginType = 'FE'

Login type, used for services.

Definition at line 36 of file FrontendUserAuthentication.php.

◆ $TSdataArray

array TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::$TSdataArray = array( )
protected

Used to accumulate the TSconfig data of the user

Definition at line 114 of file FrontendUserAuthentication.php.

◆ $user_table

string TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::$user_table = 'fe_users'

Table in database with user data

Definition at line 63 of file FrontendUserAuthentication.php.

◆ $userData_change

bool TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::$userData_change = false
protected

Definition at line 122 of file FrontendUserAuthentication.php.

◆ $usergroup_column

string TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::$usergroup_column = 'usergroup'

Definition at line 87 of file FrontendUserAuthentication.php.

◆ $usergroup_table

string TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::$usergroup_table = 'fe_groups'

Definition at line 91 of file FrontendUserAuthentication.php.

◆ $userid_column

string TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::$userid_column = 'uid'

Column for user-id

Definition at line 78 of file FrontendUserAuthentication.php.

◆ $userident_column

string TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::$userident_column = 'password'

Column for password

Definition at line 73 of file FrontendUserAuthentication.php.

◆ $username_column

string TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::$username_column = 'username'

Column for login-name

Definition at line 68 of file FrontendUserAuthentication.php.

◆ $userTS

array TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::$userTS = array( )
protected